Click here to Skip to main content
15,889,840 members
Articles / Desktop Programming / WPF

OpenWPFChart: assembling charts from components: Part I - Parts

Rate me:
Please Sign up or sign in to vote.
4.29/5 (17 votes)
19 Mar 2009CPOL14 min read 82K   4K   81  
Provides the component model along with base components to assemble charts.
// <copyright file="ItemData.cs" company="Oleg V. Polikarpotchkin">
// Copyright © 2008 Oleg V. Polikarpotchkin. All Right Reserved
// </copyright>
// <author>Oleg V. Polikarpotchkin</author>
// <email>ov-p@yandex.ru</email>
// <date>2008-12-23</date>
// <summary>OpenWPFChart library. ItemData is the abstract base class of all Data classes.</summary>
// <revision>$Id: ItemData.cs 18093 2009-03-16 04:15:06Z unknown $</revision>

using System;
using System.ComponentModel; // For INotifyPropertyChanged

namespace OpenWPFChart.Parts
{
	/// <summary>
	/// <see cref="ItemData"/> is the abstract base class of all Data classes.
	/// </summary>
	public abstract class ItemData : INotifyPropertyChanged
	{
		#region ItemName
		string itemName;
		/// <summary>
		/// Gets or sets the <see cref="ItemName"/> property.
		/// </summary>
		/// <remarks>The name of the item.</remarks>
		/// <value>Item Name string or null.</value>
		public string ItemName 
		{
			get { return itemName; }
			set
			{
				if (itemName != value)
				{
					itemName = value;
					NotifyPropertyChanged("ItemName");
				}
			}
		}
		#endregion ItemName

		/// <summary>
		/// Gets the type of the abscissa.
		/// </summary>
		/// <value>The abscissa base type.</value>
		/// <remarks>
		/// <see cref="ItemData"/> represents two-dimensional data and each dimension is expressed 
		/// in its distinct base type (e.g. <see langword="double"/>, <see langword="DateTime"/> 
		/// or <see langword="object"/>).
		/// </remarks>
		/// <returns>The base type of the abscissa (e.g. <see langword="double"/>,
		/// <see langword="DateTime"/> or <see langword="object"/>).</returns>
		public abstract Type TypeOfAbscissa { get; }

		/// <summary>
		/// Gets the type of the ordinate.
		/// </summary>
		/// <value>The ordinate base type.</value>
		/// <remarks>
		/// <see cref="ItemData"/> represents two-dimensional data and each dimension is expressed 
		/// in its distinct base type (e.g. <see langword="double"/>, <see langword="DateTime"/> 
		/// or <see langword="object"/>).
		/// </remarks>
		/// <returns>The base type of the ordinate (e.g. <see langword="double"/>,
		/// <see langword="DateTime"/> or <see langword="object"/>).</returns>
		public abstract Type TypeOfOrdinate { get; }

		/// <summary>
		/// Determines whether the set of abscissas of this item is equal to the one of 
		/// the specified <paramref name="item"/>.
		/// </summary>
		/// <param name="item">The item.</param>
		/// <returns>
		/// 	<c>true</c> if two sets of abscissas are equa; otherwise, <c>false</c>.
		/// </returns>
		public abstract bool IsAbscissasEqual(ItemData item);

		/// <summary>
		/// Determines whether the set of ordinates of this item is equal to the one of 
		/// the specified <paramref name="item"/>.
		/// </summary>
		/// <param name="item">The item.</param>
		/// <returns>
		/// 	<c>true</c> if two sets of ordinates are equa; otherwise, <c>false</c>.
		/// </returns>
		public abstract bool IsOrdinatesEqual(ItemData item);

		#region INotifyPropertyChanged Members
		/// <summary>
		/// Occurs when a property value changes.
		/// </summary>
		public event PropertyChangedEventHandler PropertyChanged;

		/// <summary>
		/// Notifies the property changed.
		/// </summary>
		/// <param name="propertyName">Name of the property.</param>
		protected void NotifyPropertyChanged(string propertyName)
		{
			if (PropertyChanged != null) 
				PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
		}
		#endregion INotifyPropertyChanged Members
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Team Leader
Russian Federation Russian Federation
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions