Click here to Skip to main content
15,892,809 members
Articles / Programming Languages / C#

A tool for making C# decorators/proxies

Rate me:
Please Sign up or sign in to vote.
4.94/5 (27 votes)
6 Dec 2008CPOL4 min read 60.7K   486   82  
Describes a small VS add-in for making decorators from existing code.
using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Collections;
using System.Drawing;
using System.Reflection;
using System.Workflow.ComponentModel.Compiler;
using System.Workflow.ComponentModel.Serialization;
using System.Workflow.ComponentModel;
using System.Workflow.ComponentModel.Design;
using System.Workflow.Runtime;
using System.Workflow.Activities;
using System.Workflow.Activities.Rules;

namespace Pfactor.Workflow
{
	partial class BuildDecorator
	{
		#region�Fields�(9)�


    #endregion�Fields



    #region Designer generated code

    /// <summary> 
		/// Required method for Designer support - do not modify 
		/// the contents of this method with the code editor.
		/// </summary>
        [System.Diagnostics.DebuggerNonUserCode]
		private void InitializeComponent()
		{
      this.CanModifyActivities = true;
      this.makePropsActivity = new System.Workflow.Activities.CodeActivity();
      this.makeContainedItemsActivity = new System.Workflow.Activities.CodeActivity();
      this.sequenceActivity2 = new System.Workflow.Activities.SequenceActivity();
      this.sequenceActivity1 = new System.Workflow.Activities.SequenceActivity();
      this.cancellationHandlerActivity1 = new System.Workflow.ComponentModel.CancellationHandlerActivity();
      this.faultHandlersActivity1 = new System.Workflow.ComponentModel.FaultHandlersActivity();
      this.makeMethodsActivity = new System.Workflow.Activities.CodeActivity();
      this.userWantsFluencyActivity = new System.Workflow.Activities.CodeActivity();
      this.lookForFluencyActivity = new System.Workflow.Activities.CodeActivity();
      this.parallelActivity1 = new System.Workflow.Activities.ParallelActivity();
      // 
      // makePropsActivity
      // 
      this.makePropsActivity.Name = "makePropsActivity";
      this.makePropsActivity.ExecuteCode += new System.EventHandler(this.makeProps);
      // 
      // makeContainedItemsActivity
      // 
      this.makeContainedItemsActivity.Name = "makeContainedItemsActivity";
      this.makeContainedItemsActivity.ExecuteCode += new System.EventHandler(this.makeContainedItems);
      // 
      // sequenceActivity2
      // 
      this.sequenceActivity2.Activities.Add(this.makePropsActivity);
      this.sequenceActivity2.Name = "sequenceActivity2";
      // 
      // sequenceActivity1
      // 
      this.sequenceActivity1.Activities.Add(this.makeContainedItemsActivity);
      this.sequenceActivity1.Name = "sequenceActivity1";
      // 
      // cancellationHandlerActivity1
      // 
      this.cancellationHandlerActivity1.Name = "cancellationHandlerActivity1";
      // 
      // faultHandlersActivity1
      // 
      this.faultHandlersActivity1.Name = "faultHandlersActivity1";
      // 
      // makeMethodsActivity
      // 
      this.makeMethodsActivity.Name = "makeMethodsActivity";
      this.makeMethodsActivity.ExecuteCode += new System.EventHandler(this.makeMethods);
      // 
      // userWantsFluencyActivity
      // 
      this.userWantsFluencyActivity.Name = "userWantsFluencyActivity";
      this.userWantsFluencyActivity.ExecuteCode += new System.EventHandler(this.userWantsFluency);
      // 
      // lookForFluencyActivity
      // 
      this.lookForFluencyActivity.Name = "lookForFluencyActivity";
      this.lookForFluencyActivity.ExecuteCode += new System.EventHandler(this.lookForFluency);
      // 
      // parallelActivity1
      // 
      this.parallelActivity1.Activities.Add(this.sequenceActivity1);
      this.parallelActivity1.Activities.Add(this.sequenceActivity2);
      this.parallelActivity1.Name = "parallelActivity1";
      // 
      // BuildDecorator
      // 
      this.Activities.Add(this.parallelActivity1);
      this.Activities.Add(this.lookForFluencyActivity);
      this.Activities.Add(this.userWantsFluencyActivity);
      this.Activities.Add(this.makeMethodsActivity);
      this.Activities.Add(this.faultHandlersActivity1);
      this.Activities.Add(this.cancellationHandlerActivity1);
      this.Name = "BuildDecorator";
      this.CanModifyActivities = false;

		}

		#endregion

        private SequenceActivity sequenceActivity2;
        private SequenceActivity sequenceActivity1;
        private ParallelActivity parallelActivity1;
        private CodeActivity userWantsFluencyActivity;
        private CancellationHandlerActivity cancellationHandlerActivity1;
        private FaultHandlersActivity faultHandlersActivity1;
        private CodeActivity makeContainedItemsActivity;
        private CodeActivity makeMethodsActivity;
        private CodeActivity makePropsActivity;
        private CodeActivity lookForFluencyActivity;










  }
}

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
Founder ActiveMesa
United Kingdom United Kingdom
I work primarily with the .NET technology stack, and specialize in accelerated code production via code generation (static or dynamic), aspect-oriented programming, MDA, domain-specific languages and anything else that gets products out the door faster. My languages of choice are C# and C++, though I'm open to suggestions.

Comments and Discussions