public void ShowExample() { Console.WriteLine("Задание 1. Пример 1:"); ShowDateTime showDateTimeLong = () => new CurrentDateTime("D"); showDateTimeLong().ShowFormatedDateTime(); ShowDateTime showDateTimeShort = () => new CurrentDateTime("d"); showDateTimeShort().ShowFormatedDateTime(); }
static void Main() { ShowDateTime workflow1 = new ShowDateTime(); WorkflowInvoker.Invoke(workflow1); DelegateInArgument<string> str = new DelegateInArgument<string>(); ShowDateTimeAsAction workflow2 = new ShowDateTimeAsAction() { CustomAction = new ActivityAction<string>() { Argument = str, Handler = new WriteLine() { Text = new InArgument<string>(str) } } }; WorkflowInvoker.Invoke(workflow2); Console.WriteLine("Hit <enter> to exit..."); Console.ReadLine(); }
static void Main() { ShowDateTime workflow1 = new ShowDateTime(); WorkflowInvoker.Invoke(workflow1); DelegateInArgument <string> str = new DelegateInArgument <string>(); ShowDateTimeAsAction workflow2 = new ShowDateTimeAsAction() { CustomAction = new ActivityAction <string>() { Argument = str, Handler = new WriteLine() { Text = new InArgument <string>(str) } } }; WorkflowInvoker.Invoke(workflow2); Console.WriteLine("Hit <enter> to exit..."); Console.ReadLine(); }