Пример #1
0
        static void Main(string[] args)
        {
            IExecute callWebService    = new CallWebService();
            IExecute changeVideoStatus = new ChangeVideoStatus();
            IExecute uploadVideo       = new UploadVideo();
            IExecute sendEmail         = new SendEmail();

            var activities = new List <IExecute>()
            {
                callWebService, changeVideoStatus, uploadVideo, sendEmail
            };

            var activityEngine = new Engine();

            activityEngine.Run(activities);
        }
Пример #2
0
        static void Main(string[] args)
        {
            var vidToCloud   = new UploadVidToCloud();
            var callWeb      = new CallWebService();
            var sendEmail    = new SendEmail();
            var changeStatus = new ChangeStatus();

            var work = new Workflow();

            work.Add(vidToCloud);
            work.Add(callWeb);
            work.Add(sendEmail);
            work.Add(changeStatus);

            var doActivities = new WorkFlowEngine();

            doActivities.Run(work);
        }
Пример #3
0
        public static void Main(string[] args)
        {
            var workFlow = new WorkFlow();

            workFlow.Add(new VideoUploader());
            var callWebService = new CallWebService();

            workFlow.Add(callWebService);
            workFlow.Add(new SendEmail());
            workFlow.Add(new ChangeStatus());

            var engine = new WorkFlowEngine();

            engine.Run(workFlow);

            Console.WriteLine();

            workFlow.Remove(callWebService);

            engine.Run(workFlow);
        }