AODL.Document.Content.Charts.ChartStyleProcessor.ReadStyleNode C# (CSharp) Метод

ReadStyleNode() публичный Метод

read the style node
public ReadStyleNode ( string styleName ) : XmlNode
styleName string
Результат System.Xml.XmlNode
		public XmlNode ReadStyleNode(string styleName)
		{
			XmlNode automaticStyleNode            = null;

			automaticStyleNode                    = this.Chart.ChartDoc .SelectSingleNode (AutomaticStylePath,this.Chart .Document .NamespaceManager );

			if (automaticStyleNode!=null)
			{

				foreach(XmlNode nodeChild in automaticStyleNode.ChildNodes )
				{
					XmlNode family                = nodeChild.SelectSingleNode ("@style:family",this.Chart .Document .NamespaceManager );
				
					if (family!=null&&family.InnerText =="chart")
					{
						XmlNode stylename         = nodeChild.SelectSingleNode ("@style:name",this.Chart .Document .NamespaceManager);

						if ( stylename.InnerText ==styleName)

							return nodeChild;
					}
				}
			}

			return null;
			
		}

Usage Example

Пример #1
0
        /// <summary>
        /// create the chart legend
        /// </summary>
        /// <param name="node"></param>
        /// <returns></returns>

        private IContent CreateChartLegend(XmlNode node)
        {
            try
            {
                ChartLegend legend = new ChartLegend(this.Chart.Document, node);
                legend.Chart = this.Chart;
                //legend.Node                  = node;
                this.Chart.ChartLegend = legend;
                ChartStyleProcessor csp       = new ChartStyleProcessor(this.Chart);
                XmlNode             nodeStyle = csp.ReadStyleNode(legend.StyleName);
                IStyle style = csp.ReadStyle(nodeStyle, "legend");

                if (style != null)
                {
                    legend.Style = style;
                    this.Chart.Styles.Add(style);
                }

                return(legend);
            }

            catch (Exception ex)
            {
                throw new AODLException("Exception while creating the chart legend!", ex);
            }
        }
All Usage Examples Of AODL.Document.Content.Charts.ChartStyleProcessor::ReadStyleNode