AODL.Document.Content.Charts.ChartImporter.CreateChartTitle C# (CSharp) Method

CreateChartTitle() private method

create the chart title
private CreateChartTitle ( XmlNode node ) : IContent
node System.Xml.XmlNode
return IContent
		private IContent CreateChartTitle(XmlNode node)
		{
			try
			{
				ChartTitle title             = new ChartTitle (this.Chart.Document ,node);
				title.Chart                  = this.Chart ;
				this.Chart .ChartTitle       =title;
				//title.Node                   = node;
				ChartStyleProcessor csp      = new ChartStyleProcessor (this.Chart );
				XmlNode nodeStyle            = csp.ReadStyleNode(title .StyleName);
				IStyle style                 = csp.ReadStyle (nodeStyle,"title");
				ContentCollection iColl     = new ContentCollection ();

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

				foreach(XmlNode nodeChild in title.Node .ChildNodes )
				{
					IContent icontent       = CreateContent(nodeChild);

					if (icontent!= null)
						AddToCollection(icontent,iColl);
				}

				title.Node.InnerXml  ="";

				foreach(IContent icontent in iColl)
				{
					AddToCollection(icontent,title.Content );
				}
				
				return title;
			}

			catch(Exception ex)
			{
				throw new AODLException("Exception while creating the chart title!", ex);
			}
		}