예제 #1
0
            public WorkFlowDataBinding()
            {
                IfElseActivity       ifelse_activity   = new IfElseActivity();
                IfElseBranchActivity branch1           = new IfElseBranchActivity();
                IfElseBranchActivity branch2           = new IfElseBranchActivity();
                CodeCondition        ifelse_condition1 = new CodeCondition();
                CodeActivity         code_branch1      = new CodeActivity();
                ourCodeActivity      code_branch2      = new ourCodeActivity();

                code_branch1.Name         = "Code1";
                code_branch2.Name         = "Code2";
                code_branch1.ExecuteCode += new EventHandler(ExecuteCode1);

                branch1.Activities.Add(code_branch1);
                branch2.Activities.Add(code_branch2);

                ifelse_condition1.Condition += new EventHandler <ConditionalEventArgs> (IfElseCondition1);
                branch1.Condition            = ifelse_condition1;

                ifelse_activity.Activities.Add(branch1);
                ifelse_activity.Activities.Add(branch2);

                ActivityBind activitybind1 = new ActivityBind();

                activitybind1.Name = "WorkFlowDataBinding";
                activitybind1.Path = "Address";

                //Console.WriteLine ("DependecyParent {0}", this.GetType ().FullName);
                code_branch2.SetBinding(ourCodeActivity.DataProperty, activitybind1);
                Activities.Add(ifelse_activity);
            }
예제 #2
0
        private void InitializeComponent()
        {
            CanModifyActivities = true;
            activity            = new ourCodeActivity();

            activity.Name         = "activity";
            activity.ExecuteCode += new EventHandler(activity_ExecuteCode);

            Activities.Add(activity);
            CanModifyActivities = false;
        }
예제 #3
0
        public void AddHandlerRemove()
        {
            EventHandler [] evs;
            EventHandler    ev  = new EventHandler(EvHandler);
            EventHandler    ev2 = new EventHandler(EvHandler);

            ourCodeActivity ca = new ourCodeActivity();

            evs = ca.ourGetInvocationList <EventHandler> (ourCodeActivity.ExecuteCodeEvent);
            Assert.AreEqual(0, evs.Length, "C1#1");

            ca.AddHandler(ourCodeActivity.ExecuteCodeEvent, ev);
            evs = ca.ourGetInvocationList <EventHandler> (ourCodeActivity.ExecuteCodeEvent);
            Assert.AreEqual(1, evs.Length, "C1#2");
            Assert.AreEqual(ev, evs[0], "C1#3");

            ca.AddHandler(ourCodeActivity.ExecuteCodeEvent, ev);
            evs = ca.ourGetInvocationList <EventHandler> (ourCodeActivity.ExecuteCodeEvent);
            Assert.AreEqual(2, evs.Length, "C1#4");
            Assert.AreEqual(ev, evs[0], "C1#5");
            Assert.AreEqual(ev2, evs[1], "C1#6");
        }
예제 #4
0
		private void InitializeComponent ()
		{

			CanModifyActivities = true;
			CodeCondition codecondition1 = new CodeCondition ();
			CodeCloseMailProgram2 = new ourCodeActivity ();
			DelayWaitForSentMail2 = new DelayActivity ();
			PrepareMail2 = new CodeActivity ();
			CodeCloseMailProgram1 = new CodeActivity ();
			DelayWaitForSentMail1 = new DelayActivity ();
			CodePrepareMail1 = new CodeActivity ();
			SeqSendMail2 = new SequenceActivity ();
			SeqSendMail1 = new SequenceActivity ();
			TerminateFinishNoNeedToReadMail = new TerminateActivity ();
			Parallel = new ParallelActivity ();
			IfElseBranchActivityNoNeed = new IfElseBranchActivity ();
			IfElseBranchActivityNeedToSendMail = new IfElseBranchActivity ();
			NeedToSendMail = new IfElseActivity ();

			CodeCloseMailProgram2.Name = "CodeCloseMailProgram2";
			CodeCloseMailProgram2.ExecuteCode += new EventHandler (CodeCloseMailProgram2_ExecuteCode);

			DelayWaitForSentMail2.Name = "DelayWaitForSentMail2";
			DelayWaitForSentMail2.TimeoutDuration = System.TimeSpan.Parse ("00:00:05");
			DelayWaitForSentMail2.InitializeTimeoutDuration += new EventHandler (DelayWaitForSentMail2_InitializeTimeoutDuration);

			PrepareMail2.Name = "PrepareMail2";
			PrepareMail2.ExecuteCode += new EventHandler (PrepareMail2_ExecuteCode);

			CodeCloseMailProgram1.Name = "CodeCloseMailProgram1";
			CodeCloseMailProgram1.ExecuteCode += new EventHandler (CodeCloseMailProgram_ExecuteCode);

			DelayWaitForSentMail1.Name = "DelayWaitForSentMail1";
			DelayWaitForSentMail1.TimeoutDuration = System.TimeSpan.Parse ("00:00:03");
			DelayWaitForSentMail1.InitializeTimeoutDuration += new EventHandler (DelayWaitForSentMail1_InitializeTimeoutDuration);

			CodePrepareMail1.Name = "CodePrepareMail1";
			CodePrepareMail1.ExecuteCode += new EventHandler (CodeActivity1_ExecuteCode);

			SeqSendMail2.Activities.Add (PrepareMail2);
			SeqSendMail2.Activities.Add (DelayWaitForSentMail2);
			SeqSendMail2.Activities.Add (CodeCloseMailProgram2);
			SeqSendMail2.Name = "SeqSendMail2";

			SeqSendMail1.Activities.Add (CodePrepareMail1);
			//SeqSendMail1.Activities.Add (DelayWaitForSentMail1);
			SeqSendMail1.Activities.Add (CodeCloseMailProgram1);
			SeqSendMail1.Name = "SeqSendMail1";

			TerminateFinishNoNeedToReadMail.Name = "TerminateFinishNoNeedToReadMail";

			Parallel.Activities.Add (SeqSendMail1);
			Parallel.Activities.Add (SeqSendMail2);
			Parallel.Name = "Parallel";

			IfElseBranchActivityNoNeed.Activities.Add (TerminateFinishNoNeedToReadMail);
			IfElseBranchActivityNoNeed.Name = "IfElseBranchActivityNoNeed";

			IfElseBranchActivityNeedToSendMail.Activities.Add (Parallel);
			codecondition1.Condition += new EventHandler <ConditionalEventArgs>(IfElseCondition);
			IfElseBranchActivityNeedToSendMail.Condition = codecondition1;
			IfElseBranchActivityNeedToSendMail.Name = "IfElseBranchActivityNeedToSendMail";

			NeedToSendMail.Activities.Add (IfElseBranchActivityNeedToSendMail);
			NeedToSendMail.Activities.Add (IfElseBranchActivityNoNeed);
			NeedToSendMail.Name = "NeedToSendMail";

			Activities.Add (NeedToSendMail);
			Name = "IfElseParalellWorkFlow";
			CanModifyActivities = false;

		}
예제 #5
0
        private void InitializeComponent()
        {
            CanModifyActivities = true;
            CodeCondition codecondition1 = new CodeCondition();

            CodeCloseMailProgram2           = new ourCodeActivity();
            DelayWaitForSentMail2           = new DelayActivity();
            PrepareMail2                    = new CodeActivity();
            CodeCloseMailProgram1           = new CodeActivity();
            DelayWaitForSentMail1           = new DelayActivity();
            CodePrepareMail1                = new CodeActivity();
            SeqSendMail2                    = new SequenceActivity();
            SeqSendMail1                    = new SequenceActivity();
            TerminateFinishNoNeedToReadMail = new TerminateActivity();
            Parallel = new ParallelActivity();
            IfElseBranchActivityNoNeed         = new IfElseBranchActivity();
            IfElseBranchActivityNeedToSendMail = new IfElseBranchActivity();
            NeedToSendMail = new IfElseActivity();

            CodeCloseMailProgram2.Name         = "CodeCloseMailProgram2";
            CodeCloseMailProgram2.ExecuteCode += new EventHandler(CodeCloseMailProgram2_ExecuteCode);

            DelayWaitForSentMail2.Name                       = "DelayWaitForSentMail2";
            DelayWaitForSentMail2.TimeoutDuration            = System.TimeSpan.Parse("00:00:05");
            DelayWaitForSentMail2.InitializeTimeoutDuration += new EventHandler(DelayWaitForSentMail2_InitializeTimeoutDuration);

            PrepareMail2.Name         = "PrepareMail2";
            PrepareMail2.ExecuteCode += new EventHandler(PrepareMail2_ExecuteCode);

            CodeCloseMailProgram1.Name         = "CodeCloseMailProgram1";
            CodeCloseMailProgram1.ExecuteCode += new EventHandler(CodeCloseMailProgram_ExecuteCode);

            DelayWaitForSentMail1.Name                       = "DelayWaitForSentMail1";
            DelayWaitForSentMail1.TimeoutDuration            = System.TimeSpan.Parse("00:00:03");
            DelayWaitForSentMail1.InitializeTimeoutDuration += new EventHandler(DelayWaitForSentMail1_InitializeTimeoutDuration);

            CodePrepareMail1.Name         = "CodePrepareMail1";
            CodePrepareMail1.ExecuteCode += new EventHandler(CodeActivity1_ExecuteCode);

            SeqSendMail2.Activities.Add(PrepareMail2);
            SeqSendMail2.Activities.Add(DelayWaitForSentMail2);
            SeqSendMail2.Activities.Add(CodeCloseMailProgram2);
            SeqSendMail2.Name = "SeqSendMail2";

            SeqSendMail1.Activities.Add(CodePrepareMail1);
            //SeqSendMail1.Activities.Add (DelayWaitForSentMail1);
            SeqSendMail1.Activities.Add(CodeCloseMailProgram1);
            SeqSendMail1.Name = "SeqSendMail1";

            TerminateFinishNoNeedToReadMail.Name = "TerminateFinishNoNeedToReadMail";

            Parallel.Activities.Add(SeqSendMail1);
            Parallel.Activities.Add(SeqSendMail2);
            Parallel.Name = "Parallel";

            IfElseBranchActivityNoNeed.Activities.Add(TerminateFinishNoNeedToReadMail);
            IfElseBranchActivityNoNeed.Name = "IfElseBranchActivityNoNeed";

            IfElseBranchActivityNeedToSendMail.Activities.Add(Parallel);
            codecondition1.Condition += new EventHandler <ConditionalEventArgs>(IfElseCondition);
            IfElseBranchActivityNeedToSendMail.Condition = codecondition1;
            IfElseBranchActivityNeedToSendMail.Name      = "IfElseBranchActivityNeedToSendMail";

            NeedToSendMail.Activities.Add(IfElseBranchActivityNeedToSendMail);
            NeedToSendMail.Activities.Add(IfElseBranchActivityNoNeed);
            NeedToSendMail.Name = "NeedToSendMail";

            Activities.Add(NeedToSendMail);
            Name = "IfElseParalellWorkFlow";
            CanModifyActivities = false;
        }
예제 #6
0
		private void InitializeComponent ()
		{
			CanModifyActivities = true;
			activity = new ourCodeActivity ();

			activity.Name = "activity";
			activity.ExecuteCode += new EventHandler (activity_ExecuteCode);

			Activities.Add (activity);
			CanModifyActivities = false;
		}