//private: void ThreadProc() { try { bool done = DoWork(); State = JobState_t.Finished; if (done) { Succeeded?.Invoke(this); } else { Canceled?.Invoke(this); } } catch (Exception ex) { State = JobState_t.Finished; Aborted?.Invoke(this, ex); } Aborted = null; Canceled = Succeeded = null; }
protected override void Execute(CodeActivityContext executionContext) { #region Boilerplate IWorkflowContext context = executionContext.GetExtension <IWorkflowContext>(); IOrganizationServiceFactory serviceFactory = executionContext.GetExtension <IOrganizationServiceFactory>(); IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId); var tracing = executionContext.GetExtension <ITracingService>(); #endregion var entityIdString = EntityId.Get(executionContext); Guid entityId = Guid.Empty; if (!Guid.TryParse(entityIdString, out entityId)) { Succeeded.Set(executionContext, false); ErrorMessage.Set(executionContext, $"Guid {entityIdString} is not a valid GUID."); return; } var teamName = TeamName.Get(executionContext); using (var ctx = new XrmServiceContext(service)) { var team = (from t in ctx.CreateQuery <Team>() where t.Name == teamName select t).FirstOrDefault(); if (team == null) { Succeeded.Set(executionContext, false); ErrorMessage.Set(executionContext, $"Team {teamName} not found."); return; } var logicalName = EntityName.Get(executionContext); var reference = (from r in ctx.CreateQuery(logicalName) where (Guid)r[$"{logicalName}id"] == entityId select r).FirstOrDefault(); if (reference == null) { Succeeded.Set(executionContext, false); ErrorMessage.Set(executionContext, $"Entity Reference with logical name {logicalName} and id {entityIdString} wasn't found."); return; } //Assign otherwise var assignRequest = new AssignRequest() { Assignee = team.ToEntityReference(), Target = reference.ToEntityReference() }; service.Execute(assignRequest); } Succeeded.Set(executionContext, true); }
private void executeLogInCommand() { _user = Broker.Instance.LogInSuccessful(_firstName, _password); if (_user != null) { Succeeded?.Invoke(this, new UserEventArgs(_user)); ResetToDefault(); } }
public override int GetHashCode() { unchecked { var hashCode = EqualityComparer <TValue> .Default.GetHashCode(Value); hashCode = (hashCode * 397) ^ (ErrorMessage != null ? StringComparer.InvariantCulture.GetHashCode(ErrorMessage) : 0); hashCode = (hashCode * 397) ^ Succeeded.GetHashCode(); return(hashCode); } }
public override string ToString() { return("PageNumber: " + PageNumber.ToString() + "\n" + "PageSize: " + PageSize.ToString() + "\n" + "TotalPages: " + TotalPages.ToString() + "\n" + "TotalRecords: " + TotalRecords.ToString() + "\n" + "NextPage: " + NextPage.ToString() + "\n" + "PreviousPage: " + PreviousPage.ToString() + "\n" + "Data: " + Data + "\n" + "Succeeded: " + Succeeded.ToString() + "\n" + "Errors: " + Errors.ToString() + "\n"); }
private void OnSucceeded(string paymentId) { if (paymentId == null) { OnFailed(new ArgumentNullException(nameof(paymentId))); return; } new CardManager().Clear(order.CustomerKey); SetPreviousSettings(); Succeeded?.Invoke(paymentId); }
private void pass_KeyUp(object sender, KeyEventArgs e) { if (e.Key.Equals(Key.Enter)) { if (pass.Password.Equals("neuronaware")) { pass.Password = null; Succeeded?.Invoke(sender, e); } else { Cancelled?.Invoke(sender, e); pass.Password = null; MessageBox.Show("비밀번호가 일치하지 않습니다."); } } }
//private: void ThreadProc() { try { DoWork(); State = JobState_t.Finished; Succeeded?.Invoke(this); } catch (Exception ex) { State = JobState_t.Finished; Aborted?.Invoke(this, ex); } Aborted = null; Succeeded = null; }
public override int GetHashCode() { int hash = 1; if (Succeeded != false) { hash ^= Succeeded.GetHashCode(); } if (node_ != null) { hash ^= Node.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
//private: void ThreadProc() { State = State_t.Running; try { DoWork(); State = State_t.Finished; Succeeded?.Invoke(this); } catch (ThreadAbortException) { Thread.ResetAbort(); State = State_t.Finished; Canceled?.Invoke(this); } catch (Exception ex) { State = State_t.Finished; Aborted?.Invoke(this, ex); } }
private void executeGoBackCommand() { ResetToDefault(); Succeeded?.Invoke(this, new EventArgs()); }
private void executeGoBackCommand() { Succeeded?.Invoke(this, new EventArgs()); }
private void executeGoBackCommand() { Succeeded?.Invoke(this, new EventArgs()); ResetToDefault(); Material = null; }
private void executeRequestCorpusCommand() { _result = HomeViewModelResultType.RequestCorpus; Succeeded?.Invoke(this, new EventArgs()); }
protected void OnSucceeded() { Succeeded?.Invoke(this, EventArgs.Empty); Completed?.Invoke(this, EventArgs.Empty); }
private void OnSucceeded() { Unsubscribe(); Succeeded?.Invoke(); }
internal void OnSucceeded() => Succeeded?.Invoke(this, this);
public override void OnAuthenticationSucceeded(BiometricPrompt.AuthenticationResult result) { base.OnAuthenticationSucceeded(result); Succeeded?.Invoke(this, result); }
public void Inspect_127_0_0_1_Works() { var where = "http://127.0.0.1"; var(_, Succeeded, _) = Inspect(where); Succeeded.Should().BeTrue(); }