Click here to Skip to main content
15,881,882 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;

namespace MyXaml.Core
{
    /// <summary>
    /// A helper class to manage a component container for IContainer objects. The .NET
    /// Container implementation does not support a writeable collection, therefore we have
    /// to provide this helper class.
    /// </summary>
    public class MxComponentContainer : MyXaml.IMyXaml, System.ComponentModel.ISupportInitialize
    {
        #region Variables

        // For MyXaml.IMyXaml interface
        private string m_Name;
        private object m_Tag;

        protected System.ComponentModel.Container container;
        protected System.Collections.ArrayList components;

        #endregion

        #region Constructors

        /// <summary>
        /// Constructor.
        /// </summary>
        public MxComponentContainer()
        {
            container = new System.ComponentModel.Container();
            components = new System.Collections.ArrayList();
        }

        #endregion

        #region Properties

        /// <summary>
        /// The underlying Container instance.
        /// </summary>
        public System.ComponentModel.Container Container
        {
            get { return container; }
        }

        /// <summary>
        /// A collection of IComponent instances. This array is cleared after EndInit().
        /// </summary>
        public System.Collections.ArrayList Components
        {
            get { return components; }
        }

        #endregion

        #region System.ComponentModel.ISupportInitialize Members

        public virtual void BeginInit()
        {
        }

        /// <summary>
        /// Populates the Container instance with the IComponent instances in the Components array.
        /// </summary>
        public virtual void EndInit()
        {
            foreach (System.ComponentModel.IComponent obj in components)
            {
                container.Add(obj);
            }
            // clear the array so it can be ref'd later on and additional items added.
            components.Clear();
        }

        #endregion

        #region MyXaml.IMyXaml Members

        #region Properties

        /// <summary>
        /// The name of this instance. Necessary for MyXaml
        /// </summary>
        public string Name
        {
            get { return m_Name; }
            set { m_Name = value; }
        }

        /// <summary>
        /// The tag of this instance. Necessary for MyXaml
        /// </summary>
        public object Tag
        {
            get { return m_Tag; }
            set { m_Tag = value; }
        }

        #endregion

        #endregion
    }
}

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