示例#1
0
 public void RaiseStartEvent()
 {
     StartHandler?.Invoke(this, new WorkItemEventArgs
     {
         Id         = Id,
         WorkflowId = WorkflowId
     });
 }
示例#2
0
 protected virtual void Start()
 {
     if (!_useStart)
     {
         _useStart = true;
         StartHandler?.Invoke();
         OnEnableAfterStart();
     }
 }
示例#3
0
        protected virtual void RaiseOnStart(object sender, object userArg)
        {
            StartHandler handler = OnStart;

            if (handler != null)
            {
                handler(this, userArg);
            }
        }
示例#4
0
        private IEnumerator <ccr.ITask> DoStart()
        {
            soap.Fault fault = null;

            // Subscribe to partners

            yield return(ccr.Arbiter.Choice(
                             _speechRecognizerPort.Subscribe(_speechRecognizerNotify,
                                                             typeof(Microsoft.Robotics.Technologies.Speech.SpeechRecognizer.Proxy.SpeechRecognized),
                                                             typeof(Microsoft.Robotics.Technologies.Speech.SpeechRecognizer.Proxy.SpeechRecognitionRejected)
                                                             ),
                             EmptyHandler,
                             delegate(soap.Fault f)
            {
                fault = f;
            }
                             ));

            if (fault != null)
            {
                LogError("Failed to subscribe to program.SpeechRecognizer.SpeechRecognizer", fault);
                StartFailed();
                yield break;
            }

            // Start the RunHandler, this represents the parts of the diagram that
            // are are not run in the context of an operation or notification.
            StartHandler start = new StartHandler(this, Environment.TaskQueue);

            SpawnIterator(start.RunHandler);
            // Wait until the RunHandler has completed.
            yield return(ccr.Arbiter.Receive(false, start.Complete, EmptyHandler));

            // Start operation handlers and insert into directory service.
            StartHandlers();

            // Add notifications to the main interleave
            base.MainPortInterleave.CombineWith(
                new ccr.Interleave(
                    new ccr.ExclusiveReceiverGroup(
                        ),
                    new ccr.ConcurrentReceiverGroup(
                        )
                    )
                );

            // Activate independent tasks
            Activate <ccr.ITask>(
                ccr.Arbiter.ReceiveWithIterator <Microsoft.Robotics.Technologies.Speech.SpeechRecognizer.Proxy.SpeechRecognized>(true, _speechRecognizerNotify, SpeechRecognizerSpeechRecognizedHandler),
                ccr.Arbiter.ReceiveWithIterator <Microsoft.Robotics.Technologies.Speech.SpeechRecognizer.Proxy.SpeechRecognitionRejected>(true, _speechRecognizerNotify, SpeechRecognizerSpeechRecognitionRejectedHandler)
                );

            yield break;
        }
示例#5
0
        public static int Main(string[] args)
        {
            var parserResult = Parser.Default.ParseArguments <ConfigureOptions, StartOptions>(args);

            var configHandler = new ConfigHandler();
            var startHandler  = new StartHandler();

            return(parserResult.MapResult(
                       (ConfigureOptions options) => configHandler.Handle(options),
                       (StartOptions options) => startHandler.Handle(options),
                       errs => 1));
        }
 public static void add(IGameControlProxy obj)
 {
     AwakeProxy += new AwakeHandler(obj.awake);
     StartProxy += new StartHandler(obj.start);
     FixUpdateProxy += new FixUpdateHandler(obj.fixedupdate);
     UpdateProxy += new UpdateHandler(obj.update);
     LateUpdateProxy += new LateUpdateHandler(obj.lateupdate);
     OnGUIProxy += new OnGUIHandler(obj.onGUI);
     changedTurnStateProxy += new changedTurnStateHandler(obj.changedTurnState);
     changedGameStateProxy += new changedGameStateHandler(obj.changedGameState);
     changedFieldModeProxy += new changedFiledModeHandler(obj.changedFieldMode);
 }
        public static int Process(Bootstrapper configuredBootstrapper, string[] args)
        {
            var configHandler = new ConfigHandler(configuredBootstrapper);
            var startHandler  = new StartHandler(configuredBootstrapper);
            var resetHandler  = new ResetHandler(configuredBootstrapper);

            var parserResult = Parser.Default.ParseArguments <ConfigureOptions, StartOptions, ResetOptions>(args);

            return(parserResult.MapResult(
                       (ConfigureOptions options) => configHandler.Handle(options),
                       (StartOptions options) => startHandler.Handle(options),
                       (ResetOptions options) => resetHandler.Handle(options),
                       errs => 1));
        }
        private IEnumerator <ccr.ITask> DoStart()
        {
            // Start the RunHandler, this represents the parts of the diagram that
            // are are not run in the context of an operation or notification.
            StartHandler start = new StartHandler(this, Environment.TaskQueue);

            SpawnIterator(start.RunHandler);
            // Wait until the RunHandler has completed.
            yield return(ccr.Arbiter.Receive(false, start.Complete, EmptyHandler));

            // Start operation handlers and insert into directory service.
            StartHandlers();

            yield break;
        }
        private void StartPlayAt(int barIndex, bool countIn)
        {
            axWindowsMediaPlayer1.URL = GetMIDIFile();
            axWindowsMediaPlayer1.Ctlcontrols.stop();
            SeeScore.PlayData.IPlayData pd = GetMIDIPlayData();
            int bar_ms = pd.durationUpToBar(barIndex);

            axWindowsMediaPlayer1.Ctlcontrols.currentPosition = (double)bar_ms / 1000.0F;
            DelayedStarter starter = new DelayedStarter(this, barIndex, countIn);

            testingDelay = true;
            mediaPlayerStartDelayTestStartTime = DateTime.Now;
            postDelayTestStartHandler          = starter.postDelayTestStartHandler;
            axWindowsMediaPlayer1.Ctlcontrols.play();
        }
示例#10
0
        private void SetUpTree(string root)
        {
            if (!Directory.Exists(root))
            {
                throw new DirectoryNotFoundException(root);
            }

            var rootDirInfo = new DirectoryInfo(root);

            StartHandler?.Invoke(this, EventArgs.Empty);
            _searchIsStopped = false;
            VisitFolder(rootDirInfo, null);
            _searchIsStopped = true;
            EndHandler?.Invoke(this, EventArgs.Empty);
        }
示例#11
0
        static void Main(string[] args)
        {
            StartHandler            del      = Start;
            Action <String, String> timeOver = TimeOver;

            ICutDownNotifier[] classes = new ICutDownNotifier[] { new Class1("Чтение задания", del, timeOver),
                                                                  new Class2("Выполнение задания", del, timeOver),
                                                                  new Class3("Проверка задания перед отправкой", del, timeOver) };

            foreach (var cl in classes)
            {
                cl.Init();
                cl.Run();
            }

            Console.ReadKey();
        }
示例#12
0
 public LevelController(
     MonoBehaviour coroutineRunner,
     LevelControls levelControls,
     EventBus gameEventBus,
     StartHandler startHandler,
     PauseHandler pauseHandler,
     DeathHandler deathHandler,
     ResetHandler resetHandler,
     FinishHandler finishHandler)
 {
     _coroutineRunner = coroutineRunner;
     _levelControls   = levelControls;
     _gameEventBus    = gameEventBus;
     _startHandler    = startHandler;
     _pauseHandler    = pauseHandler;
     _deathHandler    = deathHandler;
     _resetHandler    = resetHandler;
     _finishHandler   = finishHandler;
 }
示例#13
0
        public virtual void HandleMessage(TelegramBotClient api, Message message, object state)
        {
            if (message.Type == MessageType.TextMessage)
            {
                var text = message.Text.Trim();
                if (text == "/start")
                {
                    StartHandler.HandleMessage(this, api, message, state);
                    return;
                }
                else if (text == "/help")
                {
                    HelpHandler.HandleMessage(this, api, message, state);
                    return;
                }
            }

            var handler = CurrentHandler;
            var next    = handler.HandleMessage(this, api, message, state);

            CurrentHandler = next;
        }
示例#14
0
        protected override ChainOfResponsibilityHandler <HandlerParameter, Input.IFormInput> InitChain()
        {
            var result = new StartHandler();
            var next   = result.SetNext(new CustomInputHandler()).SetNext(new ListHandler());

            foreach (var handler in WaitedToSetNext)
            {
                next = next.SetNext(handler);
            }
            next.SetNext(new DataSourceHandler())
            .SetNext(new BoolHandler())
            .SetNext(new IntegerHandler())
            .SetNext(new NumericHandler())
            .SetNext(new DateHandler())
            .SetNext(new TimeHandler())
            .SetNext(new DateTimeHandler())
            .SetNext(new EnumHandler())
            .SetNext(new PasswordHandler())
            .SetNext(new MultilineTextHandler())
            .SetNext(new FinalHandler());

            return(result);
        }
示例#15
0
        /// <summary>
        /// запуск всех методов
        /// </summary>
        /// <param name="packet"></param>
        public void Parce()
        {
            HandlerNew handler;

            try
            {
                List <byte> list         = new List <byte>();
                List <byte> unknown2Byte = new List <byte>();

                for (int i = 0; i < packet.Length; i++)
                {
                    list.Add(packet[i]);
                }
                bool unkown3bytes;

                if (CheckIntegrity(list))
                {
                    if ((GetSize(list) > 2))
                    {
                        if (GetUnkownByte(list))         // первые 4 байта неизвестные данные
                        {
                            string imei = GetIMEI(list); // серийный номер

                            if (list.Count > 2)
                            {
                                unkown3bytes = GetUnkown3Byte(list);

                                DateTime time_stamp = GetDataTime(list); //неизвестный данные (3 байта) после серийного номера

                                float ai0 = GetAI(list, 0);              //канал AI0
                                float ai1 = GetAI(list, 1);              //канал AI1
                                float ai2 = GetAI(list, 2);              //канал AI2
                                float ai3 = GetAI(list, 3);              //канал AI3
                                float ai4 = GetAI(list, 4);              //канал AI4
                                float ai5 = GetAI(list, 5);              //канал AI5

                                float di_0 = GetDI(list, 0);
                                float di_1 = GetDI(list, 1);
                                float di_2 = GetDI(list, 2);
                                float di_3 = GetDI(list, 3);
                                float di_4 = GetDI(list, 4);
                                float di_5 = GetDI(list, 5);
                                float di_6 = GetDI(list, 6);
                                float di_7 = GetDI(list, 7);

                                byte[] f5_0 = GetUnkownDataFive(list, 0);
                                byte[] f5_1 = GetUnkownDataFive(list, 1);
                                byte[] f5_2 = GetUnkownDataFive(list, 2);
                                byte[] f5_3 = GetUnkownDataFive(list, 3);

                                float temperature = GetTemperature(list);
                                float humidity    = GetWetness(list);

                                byte[] f10_0 = GetUnkownData10(list, 0);
                                byte[] f11_0 = GetUnkownData10(list, 1);
                                byte[] crc   = GetCRC(list);

                                Console.ForegroundColor = ConsoleColor.Cyan;
                                Console.WriteLine($"\t{time_stamp.ToString("[dd.MM.yyyy hh:mm:ss]")} - [{imei}]");

                                handler = new HandlerNew(imei, time_stamp, f5_0, f5_1, f5_2, f5_3, temperature, humidity,
                                                         ai0, ai1, ai2, ai3, ai4, ai5,
                                                         di_0, di_1, di_2, di_3, di_4, di_5, di_6, di_7);

                                StartHandler start  = handler.SaveDataInDb;
                                Thread       thread = new Thread(new ThreadStart(start))
                                {
                                    IsBackground = true
                                };
                                thread.Start();
                            }
                            else
                            {
                                Console.ForegroundColor = ConsoleColor.Cyan;
                                Console.WriteLine($"\t{new string(' ', 22)}[{imei}]");

                                for (int i = 0; i < list.Count; i++)
                                {
                                    unknown2Byte.Add(list[i]);
                                }
                            }
                        }
                    }
                    else
                    {
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
 //public static List<IGameControlProxy> addlist = new List<IGameControlProxy>(8);
 //public static List<IGameControlProxy> list = new List<IGameControlProxy>(8);
 void Awake()
 {
     AwakeProxy += new AwakeHandler(Dummy);
     StartProxy += new StartHandler(Dummy);
     FixUpdateProxy += new FixUpdateHandler(Dummy);
     UpdateProxy += new UpdateHandler(Dummy);
     LateUpdateProxy += new LateUpdateHandler(Dummy);
     OnGUIProxy += new OnGUIHandler(Dummy);
     changedTurnStateProxy += new changedTurnStateHandler(Dummy);
     changedGameStateProxy += new changedGameStateHandler(Dummy);
     changedFieldModeProxy += new changedFiledModeHandler(Dummy);
     if (gameController==null) gameController =  new GameController();
     AwakeProxy();
     //GameController.gameStateChange(GameController.GameState.PRELOAD);
     GameObject.DontDestroyOnLoad(this);
     Instance = this;
 }
示例#17
0
 public Class2(String name, StartHandler callback, Action <String, String> timeOver)
 {
     timer         = new Timer(name);
     del           = callback;
     this.timeOver = timeOver;
 }
示例#18
0
 /// <summary>
 ///     Call this when your application starts.
 ///     This will initiate a call to Leanplum's servers to get the values
 ///     of the variables used in your app.
 /// </summary>
 public static void Start(string userId, IDictionary <string, object> attributes,
                          StartHandler startResponseAction)
 {
     LeanplumFactory.SDK.Start(userId, attributes, startResponseAction);
 }
示例#19
0
 /// <summary>
 ///     Call this when your application starts.
 ///     This will initiate a call to Leanplum's servers to get the values
 ///     of the variables used in your app.
 /// </summary>
 public static void Start(string userId, StartHandler callback)
 {
     LeanplumFactory.SDK.Start(userId, null, callback);
 }
示例#20
0
 /// <summary>
 ///     Call this when your application starts.
 ///     This will initiate a call to Leanplum's servers to get the values
 ///     of the variables used in your app.
 /// </summary>
 public static void Start(StartHandler callback)
 {
     LeanplumFactory.SDK.Start(null, null, callback);
 }
示例#21
0
 public void Start(string prefix, StartHandler handler)
 {
     CallLevelDbBlockchainStart(NativeObject, prefix, handler);
 }
示例#22
0
 protected static extern void CallLevelDbBlockchainStart(IntPtr blockchain, string prefix, StartHandler handler);