zoukankan      html  css  js  c++  java
  • 《WF in 24 Hours》读书笔记

    创建第一个Workflow项目

    1. 创建Workflow项目 – 选择Workflow Console Application

    2. 添加CodeActivity

    3. 打开CodeActivity,添加一行代码到Execute方法中

     1     public sealed class CodeActivity1 : CodeActivity
     2     {
     3         // Define an activity input argument of type string
     4         public InArgument<string> Text { get; set; }
     5 
     6         // If your activity returns a value, derive from CodeActivity<TResult>
     7         // and return the value from the Execute method.
     8         protected override void Execute(CodeActivityContext context)
     9         {
    10             Console.WriteLine("The time is {0}", DateTime.Now.ToLongTimeString());
    11         }
    12     }

    4. 编译,然后打开Workflow1.xaml文件,在工具栏中应该能看到新生成的CodeActivity1。

    5. 依次拖动如下控件到xaml设计器上。Sequence -> CodeActivity1 -> Delay -> CodeActivity1。最终结果如下:

    6. 修改Delay控件属性,将Duration改为10秒。

    7. 修改Program.cs,添加读取字符代码用来暂停程序运行。

     1     class Program
     2     {
     3         static void Main(string[] args)
     4         {
     5             Activity workflow1 = new Workflow1();
     6             WorkflowInvoker.Invoke(workflow1);
     7 
     8             // Pause the display
     9             Console.WriteLine("Press enter to continue.");
    10             Console.Read();
    11         }
    12     }

    8. 运行。结果如下:

     

  • 相关阅读:
    OC中的字典
    OC中的那些String
    虚拟机资源共享
    虚拟机空间使用心得
    PEST和SWOT分析法
    Axure 的四种预览模式
    竞品分析:抖音VS快手
    第二章:行业与市场分析六步法
    第一章:互联网产品从0到1全流程解密(9-11)
    第一章:互联网产品从0到1全流程解密(5-8)
  • 原文地址:https://www.cnblogs.com/ilovewindy/p/3706454.html
Copyright © 2011-2022 走看看