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. 运行。结果如下:

     

  • 相关阅读:
    yun2win-iOS端IM SDK使用方法
    题解
    普通乘法,加法等时间复杂度计算
    noip2014 解方程(本博文转载于http://blog.csdn.net/popoqqq/article/details/40984859,略有删减)
    检查
    关于对拍 (来自老胡)
    2014 NOIP 赛前自我整理提醒。
    USACO 2014 JAN 滑雪录像
    Vue 双向绑定原理
    Vue 路由
  • 原文地址:https://www.cnblogs.com/ilovewindy/p/3706454.html
Copyright © 2011-2022 走看看