Exemplo n.º 1
0
		/// <summary>
		/// Creates the section style.
		/// </summary>
		/// <param name="styleNode">The style node.</param>
		private void CreateSectionStyle(XmlNode styleNode)
		{
			SectionStyle sectionStyle			= new SectionStyle(this._document, styleNode.CloneNode(true));
			IPropertyCollection pCollection		= new IPropertyCollection();

			if (styleNode.HasChildNodes)
			{
				foreach(XmlNode node in styleNode.ChildNodes)
				{
					IProperty property			= this.GetProperty(sectionStyle, node.CloneNode(true));
					if (property != null)
						pCollection.Add(property);
				}
			}

			sectionStyle.Node.InnerXml			= "";

			foreach(IProperty property in pCollection)
				sectionStyle.PropertyCollection.Add(property);

			if (!this._common)
				this._document.Styles.Add(sectionStyle);
			else
				this._document.CommonStyles.Add(sectionStyle);
		}
		/// <summary>
		/// create chart wall style
		/// </summary>
		/// <param name="nodeStyle"></param>
		/// <returns></returns>

		private WallStyle CreateChartWallStyle(XmlNode nodeStyle)
		{
			WallStyle    wallStyle              =new WallStyle (this.Chart .Document);
			wallStyle.Node                      = nodeStyle;

			IPropertyCollection  pCollection    = new IPropertyCollection ();

			if (nodeStyle.HasChildNodes)
			{

				foreach(XmlNode nodeChild in nodeStyle.ChildNodes )
				{
					IProperty property          = this.GetProperty (wallStyle,nodeChild);
					if (property!=null)
					
						pCollection.Add (property);
					
				}
			}

			wallStyle.Node.InnerXml="";

			foreach(IProperty property in pCollection)

				wallStyle.PropertyCollection .Add (property);

			//this.Chart .Styles .Add (wallStyle);

			return wallStyle;

		}
		/// <summary>
		/// create chart floor style
		/// </summary>
		/// <param name="nodeStyle"></param>
		/// <returns></returns>

		
		private FloorStyle CreateChartFloorStyle(XmlNode nodeStyle)
		{
			FloorStyle    floorStyle              =new FloorStyle (this.Chart .Document);
			floorStyle.Node                      = nodeStyle;

			IPropertyCollection  pCollection    = new IPropertyCollection ();

			if (nodeStyle.HasChildNodes)
			{

				foreach(XmlNode nodeChild in nodeStyle.ChildNodes )
				{
					IProperty property          = this.GetProperty (floorStyle,nodeChild);
					if (property!=null)
					
						pCollection.Add (property);
					
				}
			}

			floorStyle.Node.InnerXml="";

			foreach(IProperty property in pCollection)

				floorStyle.PropertyCollection .Add (property);

			//this.Chart .Styles .Add (floorStyle);

			return floorStyle;

		}
		/// <summary>
		/// create chart series style
		/// </summary>
		/// <param name="nodeStyle"></param>
		/// <returns></returns>

		private SeriesStyle CreateChartSeriesStyle(XmlNode nodeStyle)
		{
			SeriesStyle    seriesStyle          =new SeriesStyle (this.Chart .Document, nodeStyle);
			seriesStyle.Node                    = nodeStyle;

			IPropertyCollection  pCollection    = new IPropertyCollection ();

			if (nodeStyle.HasChildNodes)
			{

				foreach(XmlNode nodeChild in nodeStyle.ChildNodes )
				{
					IProperty property          = this.GetProperty (seriesStyle,nodeChild);
					if (property!=null)
					
						pCollection.Add (property);
					
				}
			}

			seriesStyle.Node.InnerXml="";

			foreach(IProperty property in pCollection)

				seriesStyle.PropertyCollection .Add (property);

			//this.Chart .Styles .Add (seriesStyle);

			return seriesStyle;

		}
		/// <summary>
		/// create chart axes style
		/// </summary>
		/// <param name="nodeStyle"></param>
		/// <returns></returns>

		private AxesStyle CreateChartAxesStyle(XmlNode nodeStyle)
		{
			AxesStyle  axesStyle                  = new AxesStyle (this.Chart .Document);
			axesStyle.Node                        = nodeStyle;
			IPropertyCollection  pCollection      = new IPropertyCollection ();

			if (nodeStyle.HasChildNodes)
			{

				foreach(XmlNode nodeChild in nodeStyle.ChildNodes )
				{
					IProperty property            = this.GetProperty (axesStyle,nodeChild);
					if (property!=null)
					
						pCollection.Add (property);
					
				}
			}

			axesStyle.Node.InnerXml="";

			foreach(IProperty property in pCollection)

				axesStyle.PropertyCollection .Add (property);

			//this.Chart .Styles .Add (axesStyle);

			return axesStyle;
			 
		}
		/// <summary>
		/// create chart plotarea style
		/// </summary>
		/// <param name="nodeStyle"></param>
		/// <returns></returns>

		public PlotAreaStyle   CreateChartPlotAreaStyle(XmlNode nodeStyle)
		{
			PlotAreaStyle plotareaStyle           = new PlotAreaStyle (this.Chart .Document);
			plotareaStyle.Node                    = nodeStyle;

			IPropertyCollection  pCollection      = new IPropertyCollection ();

			if (nodeStyle.HasChildNodes)
			{

				foreach(XmlNode nodeChild in nodeStyle.ChildNodes )
				{
					IProperty property            = this.GetProperty (plotareaStyle,nodeChild);
					if (property!=null)
					
						pCollection.Add (property);
					
				}
			}

			plotareaStyle.Node.InnerXml="";

			foreach(IProperty property in pCollection)

				plotareaStyle.PropertyCollection .Add (property);

			//this.Chart .Styles .Add (plotareaStyle);

			return plotareaStyle;
		}
		/// <summary>
		/// create chart legend style
		/// </summary>
		/// <param name="nodeStyle"></param>
		/// <returns></returns>

		public LegendStyle CreateChartLegendStyle(XmlNode nodeStyle)
		{
			LegendStyle legendStyle              = new LegendStyle (this.Chart .Document);
			legendStyle.Node                     = nodeStyle;

			IPropertyCollection  pCollection     = new IPropertyCollection ();

			if (nodeStyle.HasChildNodes)
			{

				foreach(XmlNode nodeChild in nodeStyle.ChildNodes )
				{
					IProperty property          = this.GetProperty (legendStyle,nodeChild);
					if (property!=null)
					
						pCollection.Add (property);
					
				}
			}

			legendStyle.Node.InnerXml="";

			foreach(IProperty property in pCollection)

				legendStyle.PropertyCollection .Add (property);

			//this.Chart .Styles .Add (legendStyle);

			return legendStyle;

		}
		/// <summary>
		/// create chart title style
		/// </summary>
		/// <param name="nodeStyle"></param>
		/// <returns></returns>

		public TitleStyle CreateChartTitleStyle(XmlNode nodeStyle)
		{

			TitleStyle titleStyle              = new TitleStyle (this.Chart .Document);
			titleStyle.Node                    = nodeStyle;

			IPropertyCollection  pCollection=new IPropertyCollection ();

			if (nodeStyle.HasChildNodes)
			{

				foreach(XmlNode nodeChild in nodeStyle.ChildNodes )
				{
					IProperty property         = this.GetProperty (titleStyle,nodeChild);
					if (property!=null)
					
						pCollection.Add (property);
					
				}
			}

			titleStyle.Node.InnerXml="";

			foreach(IProperty property in pCollection)

				titleStyle.PropertyCollection .Add (property);

			return titleStyle;
		}