Click here to Skip to main content
15,885,278 members
Articles / Programming Languages / XML

Adaptive Console Framework - Build Your Console Application on the Fly

Rate me:
Please Sign up or sign in to vote.
3.00/5 (1 vote)
18 Sep 2008CDDL9 min read 31K   286   15  
Introduces the goal and use of the Adaptive Console Framework.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AcfEditor.Domain;
using SunnyChen.Common.Patterns.ExtendableMDI;
using System.Windows.Forms;

namespace acfeditor.Handlers
{
    internal sealed class ProjectNameChangedHandler : PropertyChangedHandlerBase
    {
        public override Type TargetType
        {
            get { return typeof(EditorProject); }
        }

        public override System.Reflection.PropertyInfo Property
        {
            get { return typeof(EditorProject).GetProperty("Name"); }
        }

        protected override void DoHandle(System.Windows.Forms.TreeNode treeNode, object target, object oldValue, object newValue, ref string sourceCode)
        {
            treeNode.Text = newValue.ToString();
            frmEditor formEditor = null;
            Control parent = treeNode.TreeView.Parent;
            while (parent != null)
            {
                if (parent is frmEditor)
                    break;
                parent = parent.Parent;
            }
            if (parent != null)
            {
                formEditor = (frmEditor)parent;
                formEditor.Text = newValue.ToString();
            }
            sourceCode = string.Empty;
        }
    }
}

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 Common Development and Distribution License (CDDL)


Written By
Architect Prosource Development
China China
I have more than 13 years' experience in software development and more than 5 years' working experience in software industry. I'm the National Certified System Analyst and now I'm the consultant of China System Analyst Institution. I also got the MCP/MCAD certificate on .NET technology in the year 2004.
I'm very interested in system architect and analysis, and also interested in .NET technologies. For my blog please refer to http://www.sunnychen.org.

Comments and Discussions