Click here to Skip to main content
15,884,237 members
Articles / Programming Languages / C# 4.0

Relationship Oriented Programming - The IDE plus More on Agile Project Management

Rate me:
Please Sign up or sign in to vote.
4.98/5 (25 votes)
12 Mar 2012CPOL81 min read 77.4K   1.2K   49  
An Integrated Development Environment (IDE) for the Relationship Oriented Programming Tool.
/*
 * Copyright (c) 2004-2007 Marc Clifton
 * All Rights Reserved
 * 
 * This code has been placed in the public domain and can be used and modified
 * freely in both open source and commercial applications, as long as the above
 * copyright is retained in this comment header.
*/

using System;
using System.ComponentModel;
using System.Reflection;
using System.Xml;

namespace MyXaml.Core
{
	/// <summary>
	/// Defines the event args for the InstantiateBegin and InstantiateEnd events.
	/// </summary>
	public class InstantiateEventArgs : EventArgs
	{
		/// <summary>
		/// The instance being instantiated.
		/// </summary>
		protected object instance;

		/// <summary>
		/// Gets the instance being instantiated.
		/// </summary>
		public object Instance
		{
			get {return instance;}
		}

		/// <summary>
		/// Constructor.
		/// </summary>
		/// <param name="instance">The instance being instantiated.</param>
		public InstantiateEventArgs(object instance)
		{
			this.instance=instance;
		}
	}

	/// <summary>
	/// Defines the event args for the AddToCollection event.
	/// </summary>
	public class AddToCollectionEventArgs : EventArgs
	{
		/// <summary>
		/// The container object implementing ICollection.
		/// </summary>
		protected object container;

		/// <summary>
		/// The instance being added to the collection.
		/// </summary>
		protected object instance;

		/// <summary>
		/// The result of the operation.
		/// </summary>
		protected bool result;

		/// <summary>
		/// Gets the container object implementing ICollection.
		/// </summary>
		public object Container
		{
			get {return container;}
		}

		/// <summary>
		/// Get the instance to be added to the collection.
		/// </summary>
		public object Instance
		{
			get {return instance;}
		}

		/// <summary>
		/// Get/set the result.  True if adding to the collection succeeded.
		/// </summary>
		public bool Result
		{
			get {return result;}
			set {result=value;}
		}

		protected XmlNode node;
		
		/// <summary>
		/// Gets/sets Node
		/// </summary>
		public XmlNode Node
		{
			get { return node; }
		}

		/// <summary>
		/// Constructor.
		/// </summary>
		/// <param name="container">The ICollection implementer.</param>
		/// <param name="instance">The instance to add to the collection.</param>
		public AddToCollectionEventArgs(object container, object instance, XmlNode node)
		{
			this.container=container;
			this.instance=instance;
			this.node = node;
		}
	}

	public class PropertyDeclarationTestEventArgs : EventArgs
	{
		protected PropertyInfo propertyInfo;
		protected string childQualifiedName;
		protected bool result;

		public PropertyInfo PropertyInfo
		{
			get {return propertyInfo;}
		}

		public string ChildQualifiedName
		{
			get {return childQualifiedName;}
		}

		public bool Result
		{
			get {return result;}
			set {result=value;}
		}

		public PropertyDeclarationTestEventArgs(PropertyInfo propertyInfo, string childQualifiedName)
		{
			this.propertyInfo=propertyInfo;
			this.childQualifiedName=childQualifiedName;
			result=false;
		}
	}

	public class InstantiatePropertyDeclarationEventArgs : EventArgs
	{
		protected PropertyInfo propertyInfo;
		protected string childQualifiedName;
		protected object result;

		public PropertyInfo PropertyInfo
		{
			get {return propertyInfo;}
		}

		public string ChildQualifiedName
		{
			get {return childQualifiedName;}
		}

		public object Result
		{
			get {return result;}
			set {result=value;}
		}

		public InstantiatePropertyDeclarationEventArgs(PropertyInfo propertyInfo, string childQualifiedName)
		{
			this.propertyInfo=propertyInfo;
			this.childQualifiedName=childQualifiedName;
			result=null;
		}
	}

	public class InstantiateClassEventArgs : EventArgs
	{
		protected string qname;
		protected XmlNode node;
		protected object result;

		public string AssemblyQualifiedName
		{
			get {return qname;}
		}

		public XmlNode Node
		{
			get {return node;}
		}

		public object Result
		{
			get {return result;}
			set {result=value;}
		}

		public InstantiateClassEventArgs(string qname, XmlNode node)
		{
			this.qname=qname;
			this.node=node;
		}
	}

	public class CustomPropertyEventArgs : EventArgs
	{
		protected object obj;
		protected string propertyName;
		protected string propertyValue;
		protected bool handled;

		public object Object
		{
			get {return obj;}
		}

		public string PropertyName
		{
			get {return propertyName;}
		}

		public string PropertyValue
		{
			get {return propertyValue;}
		}

		public bool Handled
		{
			get {return handled;}
			set {handled=value;}
		}

		public CustomPropertyEventArgs(object obj, string propertyName, string propertyValue)
		{
			this.obj=obj;
			this.propertyName=propertyName;
			this.propertyValue=propertyValue;
		}
	}
}

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
Architect Interacx
United States United States
Blog: https://marcclifton.wordpress.com/
Home Page: http://www.marcclifton.com
Research: http://www.higherorderprogramming.com/
GitHub: https://github.com/cliftonm

All my life I have been passionate about architecture / software design, as this is the cornerstone to a maintainable and extensible application. As such, I have enjoyed exploring some crazy ideas and discovering that they are not so crazy after all. I also love writing about my ideas and seeing the community response. As a consultant, I've enjoyed working in a wide range of industries such as aerospace, boatyard management, remote sensing, emergency services / data management, and casino operations. I've done a variety of pro-bono work non-profit organizations related to nature conservancy, drug recovery and women's health.

Comments and Discussions