Esempio n. 1
0
        protected override void Execute(NativeActivityContext context)
        {
            try
            {
                this._context = ContextName.Get(context);

                Dictionary <string, string> aArguments = new Dictionary <string, string>();

                aArguments["Retries"] = "5";

                aContext = new ContextServer(contextType.NamedPipe, this._context, aArguments, this.Debug);
                aContext.CreateServer();

                if (Body != null)
                {
                    //scheduling the execution of the child activities
                    // and passing the value of the delegate argument
                    context.ScheduleAction(Body, aContext, OnCompleted, OnFaulted);
                }
            }
            catch (Exception e)
            {
                CleanupContext();
                throw;
            }
        }
Esempio n. 2
0
        protected ContextServer SetUpContextServer()
        {
            var aDictionary = new Dictionary <string, string>();

            aDictionary["Retries"] = Test_Retries.ToString();

            ContextServer aContext;

            aContext = new ContextServer(Test_ContextType, Test_ContextName, aDictionary, true);
            aContext.CreateServer();
            return(aContext);
        }
Esempio n. 3
0
 /// <summary>
 /// 初始化会注册到控制中心
 /// </summary>
 public MonoContext()
 {
     //注册
     ContextServer.OnRegister(this.GetType(), this);
     Init();
 }
Esempio n. 4
0
 /// <summary>
 /// Awake同步创建
 /// </summary>
 public virtual void Awake()
 {
     ContextServer.Init();
 }