public override object Clone() { var result = new StartEvent(); FeedCatchEvent(result); return(result); }
protected internal override BaseElement ConvertXMLToElement(XMLStreamReader xtr, BpmnModel model) { string formKey = xtr.GetAttributeValue(BpmnXMLConstants.ACTIVITI_EXTENSIONS_NAMESPACE, BpmnXMLConstants.ATTRIBUTE_FORM_FORMKEY); StartEvent startEvent = null; if (!string.IsNullOrWhiteSpace(formKey) && model.StartEventFormTypes != null && model.StartEventFormTypes.Contains(formKey)) { startEvent = new AlfrescoStartEvent(); } if (startEvent == null) { startEvent = new StartEvent(); } BpmnXMLUtil.AddXMLLocation(startEvent, xtr); startEvent.Initiator = xtr.GetAttributeValue(BpmnXMLConstants.ACTIVITI_EXTENSIONS_NAMESPACE, BpmnXMLConstants.ATTRIBUTE_EVENT_START_INITIATOR); bool interrupting = true; string interruptingAttribute = xtr.GetAttributeValue(BpmnXMLConstants.ATTRIBUTE_EVENT_START_INTERRUPTING); if (BpmnXMLConstants.ATTRIBUTE_VALUE_FALSE.Equals(interruptingAttribute, StringComparison.OrdinalIgnoreCase)) { interrupting = false; } startEvent.Interrupting = interrupting; startEvent.FormKey = formKey; ParseChildElements(XMLElementName, startEvent, model, xtr); return(startEvent); }
public override void ProcessRunningDirectiveResult(DirectiveData data, CommunicationEventArgs comEventArgs) { var ret = data as RockerDirectiveData; if (CurrentStatus == DeviceStatusEnum.Startting) { //从tryStart变为running(真的开始) if (ret?.Speed > 0) { CurrentStatus = DeviceStatusEnum.Running; comEventArgs.DeviceStatus = DeviceStatusEnum.Running; StartEvent.TrySetResult(new DeviceIOResult(true)); OnCommunicationChange(comEventArgs); StartRunningLoop(); } else { comEventArgs.DeviceStatus = CurrentStatus; StartRunningLoop(); } } else if (CurrentStatus == DeviceStatusEnum.Running) { comEventArgs.DeviceStatus = DeviceStatusEnum.Running; StartRunningLoop(); } else { comEventArgs.DeviceStatus = DeviceStatusEnum.Error; } }
/// <summary> /// Starts this instance. /// </summary> public void Start( ) { try { if (_isStarted) { return; } _isStarted = true; if (_stateMap.Transitions.Count > 0) { ActiveStates = _stateMap.GetInitialStates( ); } if (StartEvent != null) { StartEvent.Execute(StateContainer, _stateMap); } foreach (IState state in ActiveStates) { if (state.Enter != null) { state.Enter.CallOnEach(x => x.Execute(StateContainer, _stateMap)); } } } catch (Exception ex) { throw new StateMachineException(ex.Message); } }
private void Awake() { if (engine == null) { engine = new Engine(); initEngine(engine); } if (seeEvent == null) { seeEvent = new GameEvent(); seeEvent.AddListener(obstacle => { engine.SetValue("obstacle", obstacle) .Execute(onSee); }); } if (onEvent == null) { onEvent = new GameEvent(); onEvent.AddListener(obstacle => { engine.SetValue("obstacle", obstacle) .Execute(onNear); }); } if (startEvent == null) { startEvent = new StartEvent(); startEvent.AddListener(() => { engine.Execute(onStart); }); } }
static StartEvent CreateStartEvent(XElement xElement) { var startEvent = new StartEvent(); startEvent.Id = GetProcessId(xElement); return(startEvent); }
void Start() { if (ToCam == null) { ToCam = Camera.main; } onPress += (go, state) => { Open = state; if (state) { StartV2 = GetV2(Input.mousePosition); StartEvent.Invoke(); } else { if (!Out) { EndEvent.Invoke(); } else { Father.onPress(Father.gameObject, false); } Out = false; } }; }
public CustomTimer(System.Threading.TimerCallback callback, object state, int dueTime, int period, DisposeEvent _eventDispose, StartEvent _eventStart) { onDispose += _eventDispose; onStart += _eventStart; timer = new System.Threading.Timer(callback, state, dueTime, period); }
static StartEvent CreateStartEvent(XElement xElement) { var startEvent = new StartEvent(); FillCommonProcessElementAttributes(startEvent, xElement); return(startEvent); }
public MidiEvent Read(MidiReader reader, ReadingSettings settings, byte currentStatusByte) { SystemRealTimeEvent systemRealTimeEvent = null; switch (currentStatusByte) { case EventStatusBytes.SystemRealTime.ActiveSensing: systemRealTimeEvent = new ActiveSensingEvent(); break; case EventStatusBytes.SystemRealTime.Continue: systemRealTimeEvent = new ContinueEvent(); break; case EventStatusBytes.SystemRealTime.Reset: systemRealTimeEvent = new ResetEvent(); break; case EventStatusBytes.SystemRealTime.Start: systemRealTimeEvent = new StartEvent(); break; case EventStatusBytes.SystemRealTime.Stop: systemRealTimeEvent = new StopEvent(); break; case EventStatusBytes.SystemRealTime.TimingClock: systemRealTimeEvent = new TimingClockEvent(); break; } systemRealTimeEvent.Read(reader, settings, MidiEvent.UnknownContentSize); return(systemRealTimeEvent); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Before public void createModel() public virtual void createModel() { testBpmnModelInstance = Bpmn.createEmptyModel(); Definitions definitions = testBpmnModelInstance.newInstance(typeof(Definitions)); testBpmnModelInstance.Definitions = definitions; message = testBpmnModelInstance.newInstance(typeof(Message)); message.Id = "message-id"; definitions.RootElements.Add(message); Process process = testBpmnModelInstance.newInstance(typeof(Process)); process.Id = "process-id"; definitions.RootElements.Add(process); startEvent = testBpmnModelInstance.newInstance(typeof(StartEvent)); startEvent.Id = "start-event-id"; process.FlowElements.Add(startEvent); messageEventDefinition = testBpmnModelInstance.newInstance(typeof(MessageEventDefinition)); messageEventDefinition.Id = "msg-def-id"; messageEventDefinition.Message = message; startEvent.EventDefinitions.Add(messageEventDefinition); startEvent.EventDefinitionRefs.Add(messageEventDefinition); }
/// <summary> /// 准备 /// </summary> /// <param name="clientPeer"></param> private void ready(ClientPeer clientPeer) { SingleExcute.Instance.Excute(() => { if (!accountCache.IsOnline(clientPeer)) { return; } int accid = accountCache.GetId(clientPeer); if (!userModelCache.IsExistUserModel(accid)) { return; } int uid = userModelCache.GetModelByAccid(accid).Id; RoomModel roomModel = roomCache.GetRoomModelByUid(uid); roomModel.Ready(uid); roomModel.Brocast(uid, clientPeer, OpCode.MATCH, MatchCode.READY_BRO); //判断是否所有玩家都已经准备 if (roomModel.IsAllReady()) { //向客户端发送开始游戏的响应 roomModel.Brocast(null, null, OpCode.MATCH, MatchCode.START_BRO); StartEvent.Invoke(roomModel.GetAllReadyUserIdInRoom()); } }); }
void onStart(StartEvent e) { Event <PlaySoundEvent> .Broadcast(new PlaySoundEvent(m_startClip)); m_startMessage.SetActive(true); DOVirtual.DelayedCall(m_startMessageTime, () => m_startMessage.SetActive(false)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test @BpmnModelResource public void shouldFindReferenceWithNamespace() public virtual void shouldFindReferenceWithNamespace() { MessageEventDefinition messageEventDefinition = bpmnModelInstance.getModelElementById("message-event-definition"); Message message = bpmnModelInstance.getModelElementById("message-id"); assertThat(messageEventDefinition.Message).NotNull; assertThat(messageEventDefinition.Message).isEqualTo(message); message.Id = "changed-message"; assertThat(messageEventDefinition.Message).NotNull; assertThat(messageEventDefinition.Message).isEqualTo(message); message.setAttributeValue("id", "again-changed-message", true); assertThat(messageEventDefinition.Message).NotNull; assertThat(messageEventDefinition.Message).isEqualTo(message); StartEvent startEvent = bpmnModelInstance.getModelElementById("start-event"); ICollection <EventDefinition> eventDefinitionRefs = startEvent.EventDefinitionRefs; assertThat(eventDefinitionRefs).NotEmpty; assertThat(eventDefinitionRefs).contains(messageEventDefinition); messageEventDefinition.Id = "changed-message-event"; assertThat(eventDefinitionRefs).NotEmpty; assertThat(eventDefinitionRefs).contains(messageEventDefinition); messageEventDefinition.setAttributeValue("id", "again-changed-message-event", true); assertThat(eventDefinitionRefs).NotEmpty; assertThat(eventDefinitionRefs).contains(messageEventDefinition); message.removeAttribute("id"); assertThat(messageEventDefinition.Message).Null; messageEventDefinition.removeAttribute("id"); assertThat(eventDefinitionRefs).doesNotContain(messageEventDefinition); assertThat(eventDefinitionRefs).Empty; }
protected internal override bool WriteExtensionChildElements(BaseElement element, bool didWriteExtensionStartElement, XMLStreamWriter xtw) { StartEvent startEvent = (StartEvent)element; didWriteExtensionStartElement = WriteFormProperties(startEvent, didWriteExtensionStartElement, xtw); return(didWriteExtensionStartElement); }
public override BaseFlowNode Build() { var result = new StartEvent(); FeedCatchEvt(result); return(result); }
private void Start() { StartEvent.Invoke(); if (SolvedPuzzle.value) { IfSolvedPuzzle.Invoke(); } }
public void Initialize(StartEvent startEvent, RankEvent rankEvent, OptionEvent optionEvent) { Initialize(); this._startEvent = startEvent; this._rankEvent = rankEvent; this._optionEvent = optionEvent; }
public SequenceFlow(JToken process, StartEvent startEvent, EndEvent endEvent, ExpressionContext context) { _process = process; _startEvent = startEvent; _endEvent = endEvent; _context = context; _currentFlowId = _startEvent.Outgoing; }
public virtual StartEvent CreateStartEvent() { var startEvent = new StartEvent(); //startEvent.Tag = new StartEventActivityBehavior(); return(startEvent); }
public bool Validate(BPMNTrail trail) { this.trail = trail; StartEvent se = trail.GetFirstStartEvent(); RunStates(se, graph); return(results.TrueForAll(x => x.Equals(true))); }
public virtual StartEventBuilder startEvent(string id) { StartEvent start = createChild(typeof(StartEvent), id); BpmnShape bpmnShape = createBpmnShape(start); Coordinates = bpmnShape; return(start.builder()); }
public void Start() { StartEvent?.Invoke(this.Cosmonauts); timer.Interval = 20; timer.AutoReset = true; timer.Elapsed += new System.Timers.ElapsedEventHandler(Tick); timer.Start(); }
private void Update() { Transform eventTranform = transform.FindChild("Event"); if (eventTranform != null) { startEvent = eventTranform.GetChild(0).FindChild("StartEvent").GetComponent <StartEvent>(); } }
private void StartEvent_event1(object sender, StartEvent e) { list = e.list; Dispatcher.Invoke(() => { gMakinaDurumWord.Content = list[0].ToString(); }); }
void onStartEvent(StartEvent e) { m_started = true; onLateStart(); if (enabled) { onEnable(); } }
public void StartGame(string nickname) { _player = nickname; if (_resetOnNewGame) { _score.Value = 0; } StartEvent?.Invoke(); }
public void Continue() { if (IsRunning) { return; } _isRunning = true; StartEvent?.Invoke(this, EventArgs.Empty); }
private void FindEvents() { StartEvent se = trail.GetFirstStartEvent(); bpmnElements.Add(se.id); foreach (List <string> trace in traces) { trail.GetStartEvent(se.id).outgoing.ForEach(x => FindEvent(x, trace)); } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldAddParentChildElementInCorrectOrder() public virtual void shouldAddParentChildElementInCorrectOrder() { // create empty model BpmnModelInstance bpmnModelInstance = Bpmn.createEmptyModel(); // add definitions to model Definitions definitions = bpmnModelInstance.newInstance(typeof(Definitions)); definitions.TargetNamespace = "Examples"; bpmnModelInstance.Definitions = definitions; // add process Process process = bpmnModelInstance.newInstance(typeof(Process)); process.Id = "messageEventDefinition"; definitions.RootElements.Add(process); // add start event StartEvent startEvent = bpmnModelInstance.newInstance(typeof(StartEvent)); startEvent.Id = "theStart"; process.FlowElements.Add(startEvent); // create and add message Message message = bpmnModelInstance.newInstance(typeof(Message)); message.Id = "start-message-id"; definitions.RootElements.Add(message); // add message event definition to start event MessageEventDefinition startEventMessageEventDefinition = bpmnModelInstance.newInstance(typeof(MessageEventDefinition)); startEventMessageEventDefinition.Message = message; startEvent.EventDefinitions.Add(startEventMessageEventDefinition); // add property after message event definition Property property = bpmnModelInstance.newInstance(typeof(Property)); startEvent.Properties.Add(property); // finally add an extensions element ExtensionElements extensionElements = bpmnModelInstance.newInstance(typeof(ExtensionElements)); process.ExtensionElements = extensionElements; // validate model try { Bpmn.validateModel(bpmnModelInstance); } catch (ModelValidationException) { Assert.fail(); } }
/// <summary> /// 启动,完成后引发StartEvent /// </summary> /// <param name="port">服务端口</param> public virtual void Start(int port) { var task = new Task(async() => { string result = await CreateMQTTServer(port); Console.Title = $"0.0.0.0:{port}"; StartEvent?.Invoke(result); }); task.Start(); }
private void Update() { if (!Input.GetKey(KeyCode.Space) || !enableStart) { return; } startText.gameObject.SetActive(false); enableStart = false; StartEvent?.Invoke(); StartCoroutine(RunStartWait()); }
public void EventPublisherPublishes() { using (var scope = BeginScope()) { var start = new StartEvent(); var stop = new StopEvent(); var pub = scope.Resolve<IEventPublisher>(); pub.Publish(start); pub.Publish(stop); var handler = scope.Resolve<InfrastructureEventHandler>(); Assert.Equal(2, handler.Events.Count); Assert.Equal(start, handler.Events[0]); Assert.Equal(stop, handler.Events[1]); } }
public async Task AsyncEventPublisherPublishes() { using (var scope = BeginScope()) { var start = new StartEvent(); var stop = new StopEvent(); var pub = scope.Resolve<IEventPublisher>(); var handler = scope.Resolve<InfrastructureEventHandler>(); var asyncHandler = scope.Resolve<InfrastructureAsyncEventHandler>(); Assert.Equal(0, handler.Events.Count); Assert.Equal(0, asyncHandler.Events.Count); await pub.PublishAsync(start); await pub.PublishAsync(stop); Assert.Equal(2, handler.Events.Count); Assert.Equal(start, handler.Events[0]); Assert.Equal(stop, handler.Events[1]); Assert.Equal(2, asyncHandler.Events.Count); Assert.Equal(start, asyncHandler.Events[0]); Assert.Equal(stop, asyncHandler.Events[1]); } }
protected virtual void OnStarted(StartEvent msg) { if (msg.SourceUri!=null) { this.SourceUri = msg.SourceUri; StartConnection(msg.SourceUri); } else { Stop(StopReason.NoHost); } }
private void SetStartState(object sender, EventArgs e) { // Assume disabled by default bool startState = false; string sourceAccount = (string)SourceStorageAccount.SelectedItem; string destAccount = (string)DestStorageAccount.SelectedItem; string sourceBlobFilename = SourceBlobFilename.Text; string destBlobFilename = DestBlobFilename.Text; string sourceLocalFilename = SourceLocalFilename.Text; string destLocalFilename = DestLocalFilename.Text; if (SourceTableEndpoint.Checked && DestTableEndpoint.Checked) { // Endpoint to endpoint backup if (IsValidStorageAccount(sourceAccount) && IsValidStorageAccount(destAccount)) { if (sourceAccount != destAccount) { startState = true; startEvent = delegate() { if (this.ConfirmRestore(destAccount)) { backupClient.StartEndpointToEndpointBackup( settings.GetConnectionString(sourceAccount), settings.GetConnectionString(destAccount)); } }; } } } else if (SourceTableEndpoint.Checked && DestBlobFile.Checked) { // Endpoint to blob backup if (IsValidStorageAccount(sourceAccount) && IsValidBlob(destBlobFilename) && IsValidStorageAccount(destAccount)) { startState = true; startEvent = delegate() { backupClient.StartEndpointToBlobBackup( settings.GetConnectionString(sourceAccount), settings.GetConnectionString(destAccount), GetContainerName(destBlobFilename), GetBlobName(destBlobFilename)); }; } } else if (SourceTableEndpoint.Checked && DestLocalFile.Checked) { // Endpoint to file backup if (IsValidStorageAccount(sourceAccount) && IsValidBackupPath(destLocalFilename)) { startState = true; startEvent = delegate() { backupClient.StartEndpointToFileBackup( settings.GetConnectionString(sourceAccount), destLocalFilename); }; } } else if (SourceBlobFile.Checked && DestTableEndpoint.Checked) { // Blob to endpoint backup if (IsValidStorageAccount(sourceAccount) && IsValidBlob(sourceBlobFilename) && IsValidStorageAccount(destAccount)) { startState = true; startEvent = delegate() { if (this.ConfirmRestore(destAccount)) { backupClient.StartBlobToEndpointBackup( settings.GetConnectionString(sourceAccount), settings.GetConnectionString(destAccount), GetContainerName(sourceBlobFilename), GetBlobName(sourceBlobFilename)); } }; } } else if (SourceBlobFile.Checked && DestBlobFile.Checked) { // Blob to blob backup if (IsValidStorageAccount(sourceAccount) && IsValidBlob(sourceBlobFilename) && IsValidStorageAccount(destAccount) && IsValidBlob(destBlobFilename)) { string sourceContainer = GetContainerName(sourceBlobFilename); string destContainer = GetContainerName(destBlobFilename); string sourceFilename = GetBlobName(sourceBlobFilename); string destFilename = GetBlobName(destBlobFilename); if ((sourceContainer != destContainer) && (sourceFilename != destFilename)) { startState = true; startEvent = delegate() { backupClient.StartBlobToBlobBackup( settings.GetConnectionString(sourceAccount), settings.GetConnectionString(destAccount), sourceContainer, sourceFilename, destContainer, destFilename); }; } } } else if (SourceBlobFile.Checked && DestLocalFile.Checked) { // Blob to file backup if (IsValidStorageAccount(sourceAccount) && IsValidBlob(sourceBlobFilename) && IsValidBackupPath(destLocalFilename)) { startState = true; startEvent = delegate() { backupClient.StartBlobToFileBackup( settings.GetConnectionString(sourceAccount), GetContainerName(sourceBlobFilename), GetBlobName(sourceBlobFilename), destLocalFilename); }; } } else if (SourceLocalFile.Checked && DestTableEndpoint.Checked) { // File to endpoint backup if (IsValidBackupFile(sourceLocalFilename) && IsValidStorageAccount(destAccount)) { startState = true; startEvent = delegate() { if (this.ConfirmRestore(destAccount)) { backupClient.StartFileToEndpointBackup( sourceLocalFilename, settings.GetConnectionString(destAccount)); } }; } } else if (SourceLocalFile.Checked && DestBlobFile.Checked) { // File to blob backup if (IsValidBackupFile(sourceLocalFilename) && IsValidBlob(destBlobFilename) && IsValidStorageAccount(destAccount)) { startState = true; startEvent = delegate() { backupClient.StartFileToBlobBackup( sourceLocalFilename, settings.GetConnectionString((string)destAccount), GetContainerName(destBlobFilename), GetBlobName(destBlobFilename)); }; } } else if (SourceLocalFile.Checked && DestLocalFile.Checked) { // File to file backup if (IsValidBackupFile(sourceLocalFilename) && IsValidBackupFile(destLocalFilename)) { if (sourceLocalFilename != destLocalFilename) { startState = true; startEvent = delegate() { backupClient.StartFileToFileBackup( sourceLocalFilename, destLocalFilename); }; } } } StartButton.Enabled = startState; if (StartButton.Enabled) { StartButton.Focus(); } }