/// <summary> /// The event-handler that is invoked by the subscription that listens for updates /// on the <see cref="Thing"/> that is being represented by the view-model /// </summary> /// <param name="objectChange"> /// The payload of the event that is being handled /// </param> protected override void ObjectChangeEventHandler(ObjectChangedEvent objectChange) { base.ObjectChangeEventHandler(objectChange); this.UpdateRequirementGroupRows(); this.UpdateRequirementRows(); this.UpdateProperties(); }
/// <summary> /// The <see cref="ObjectChangedEvent"/> handler /// </summary> /// <param name="objectChange">The <see cref="ObjectChangedEvent"/></param> protected override void ObjectChangeEventHandler(ObjectChangedEvent objectChange) { base.ObjectChangeEventHandler(objectChange); this.UpdatePublications(); this.UpdateDomains(); this.UpdateProperties(); }
/// <summary> /// The <see cref="ObjectChangedEvent"/> handler for <see cref="Iteration"/> /// </summary> /// <param name="iterationEvent">The <see cref="ObjectChangedEvent"/></param> private void IterationChangeEventHandler(ObjectChangedEvent iterationEvent) { if (this.Session == null) { return; } if (iterationEvent.EventKind == EventKind.Added) { this.Iterations.Add(iterationEvent.ChangedThing as Iteration); } else if (iterationEvent.EventKind == EventKind.Removed) { var iteration = iterationEvent.ChangedThing as Iteration; var browser = this.openProductTree.SingleOrDefault(x => x.Thing.Container == iteration); if (browser != null) { this.PanelNavigationService.CloseInAddIn(browser); this.openProductTree.Remove(browser); } this.Iterations.RemoveAll(x => x == iteration); } }
/// <summary> /// The <see cref="ObjectChangedEvent"/> handler /// </summary> /// <param name="objectChange">The <see cref="ObjectChangedEvent"/></param> protected override void ObjectChangeEventHandler(ObjectChangedEvent objectChange) { base.ObjectChangeEventHandler(objectChange); this.UpdatePossibleFiniteStatesList(); this.UpdateActualFiniteStatesList(); this.UpdateProperties(); }
/// <summary> /// The event-handler that is invoked by the subscription that listens for updates /// on the <see cref="Thing"/> that is being represented by the view-model /// </summary> /// <param name="objectChange"> /// The payload of the event that is being handled /// </param> protected override void ObjectChangeEventHandler(ObjectChangedEvent objectChange) { base.ObjectChangeEventHandler(objectChange); this.CurrentModel = this.Thing.Name; this.UpdateParticipantCards(); }
/// <summary> /// The event-handler that is invoked by the subscription that listens for updates /// on the <see cref="Thing" /> that is being represented by the view-model /// </summary> /// <param name="objectChange"> /// The payload of the event that is being handled /// </param> protected override void ObjectChangeEventHandler(ObjectChangedEvent objectChange) { base.ObjectChangeEventHandler(objectChange); if (this.RelationshipConfiguration.SelectedRule != null) { this.Matrix.RefreshMatrix(this.RelationshipConfiguration.SelectedRule); } }
/// <summary> /// Handle the <see cref="ObjectChangedEvent"/> /// </summary> /// <param name="objectChange">The <see cref="ObjectChangedEvent"/></param> protected override void ObjectChangeEventHandler(ObjectChangedEvent objectChange) { base.ObjectChangeEventHandler(objectChange); if (this.BudgetConfig != null) { this.ComputeBudgets(); } }
/// <summary> /// The <see cref="ObjectChangedEvent"/> handler that is called upon the reception of a update message of the <see cref="SiteDirectory"/> represented /// </summary> /// <param name="objectChange">The <see cref="ObjectChangedEvent"/></param> protected override void ObjectChangeEventHandler(ObjectChangedEvent objectChange) { this.Caption = string.Format("{0}, iteration_{1}", PanelCaption, this.Thing.IterationSetup.IterationNumber); this.ToolTip = string.Format("{0}\n{1}\n{2}", ((EngineeringModel)this.Thing.Container).EngineeringModelSetup.Name, this.Thing.IDalUri, this.Session.ActivePerson.Name); base.ObjectChangeEventHandler(objectChange); this.UpdateBinaryRelationships(); this.UpdateMultiRelationships(); }
/// <summary> /// The <see cref="ObjectChangedEvent"/> handler for this <see cref="definition"/> /// </summary> /// <param name="defEvent">The <see cref="ObjectChangedEvent"/></param> private void OnDefinitionUpdate(ObjectChangedEvent defEvent) { if (defEvent.EventKind == EventKind.Removed) { this.definition = null; this.definitionSubscription.Dispose(); } this.SetDefinitionContent(); }
/// <summary> /// The <see cref="ObjectChangedEvent"/> handler for <see cref="Iteration"/> /// </summary> /// <param name="iterationEvent">The <see cref="ObjectChangedEvent"/></param> private void IterationChangeEventHandler(ObjectChangedEvent iterationEvent) { if (this.Session == null) { return; } if (iterationEvent.EventKind == EventKind.Added) { this.Iterations.Add(iterationEvent.ChangedThing as Iteration); } else if (iterationEvent.EventKind == EventKind.Removed) { var iteration = iterationEvent.ChangedThing as Iteration; this.Iterations.RemoveAll(x => x == iteration); } }
/// <summary> /// Check whether a rebuild is required /// </summary> /// <param name="e">The <see cref="ObjectChangedEvent" /></param> /// <remarks> /// Rebuilding is required when a row or column needs to be added or removed /// </remarks> private void CheckRebuildMatrix(ObjectChangedEvent e) { var thing = e.ChangedThing as DefinedThing; if (thing?.CacheKey.Iteration == null || thing.CacheKey.Iteration.Value != this.Thing.Iid) { return; } if (!this.SourceYConfiguration.SelectedClassKind.HasValue || !this.SourceXConfiguration.SelectedClassKind.HasValue || this.RelationshipConfiguration.SelectedRule == null) { return; } if (!this.IsClassKindValidForRebuild(thing.ClassKind, this.SourceYConfiguration.SelectedClassKind.Value) && !this.IsClassKindValidForRebuild(thing.ClassKind, this.SourceXConfiguration.SelectedClassKind.Value)) { return; } // thing is either ClassKind1 or ClassKind2 if (this.SourceYConfiguration.SelectedCategories.Count == 0 && this.SourceXConfiguration.SelectedCategories.Count == 0) { this.BuildRelationshipMatrix(); } else if (this.IsClassKindValidForRebuild(thing.ClassKind, this.SourceYConfiguration.SelectedClassKind.Value) && this.SourceYConfiguration.SelectedCategories.Count > 0 || this.IsClassKindValidForRebuild(thing.ClassKind, this.SourceXConfiguration.SelectedClassKind.Value) && this.SourceXConfiguration.SelectedCategories.Count > 0) { if (thing is ICategorizableThing categorizable && ( IsCategoryApplicableToConfiguration(categorizable, this.SourceYConfiguration) || IsCategoryApplicableToConfiguration(categorizable, this.SourceXConfiguration))) { this.BuildRelationshipMatrix(); } } }
/// <summary> /// The <see cref="ObjectChangedEvent"/> handler for <see cref="Iteration"/> /// </summary> /// <param name="iterationEvent">The <see cref="ObjectChangedEvent"/></param> private void IterationChangeEventHandler(ObjectChangedEvent iterationEvent) { if (this.Session == null) { return; } switch (iterationEvent.EventKind) { case EventKind.Added: this.Iterations.Add(iterationEvent.ChangedThing as Iteration); break; case EventKind.Removed: var iteration = iterationEvent.ChangedThing as Iteration; this.Iterations.RemoveAll(x => x == iteration); break; } }
/// <summary> /// The event-handler that is invoked by the subscription that listens for <see cref="Iteration"/>s added /// </summary> /// <param name="iterationEvent">the <see cref="ObjectChangedEvent"/></param> private void IterationEventHandler(ObjectChangedEvent iterationEvent) { if (iterationEvent.EventKind == EventKind.Added) { var iteration = (Iteration)iterationEvent.ChangedThing; var session = this.Sessions.SingleOrDefault(s => s.Assembler.Cache == iteration.Cache); if (session == null) { throw new InvalidOperationException("There is no ISession associated with an Iteration."); } this.Iterations.Add(iteration); } else if (iterationEvent.EventKind == EventKind.Removed) { var iteration = (Iteration)iterationEvent.ChangedThing; this.Iterations.Remove(iteration); } }
public void VerifyThatObjectChangeMessageIsProcessed() { this.name = this.name + "_update"; this.nativeName = this.nativeName + "_update"; this.languageCode = this.languageCode + "_update"; this.naturalLanguage.Name = this.name; this.naturalLanguage.NativeName = this.nativeName; this.naturalLanguage.LanguageCode = this.languageCode; // workaround to modify a read-only field var type = this.naturalLanguage.GetType(); type.GetProperty("RevisionNumber").SetValue(this.naturalLanguage, 50); var objectChangedEvent = new ObjectChangedEvent(this.naturalLanguage, EventKind.Updated); CDPMessageBus.Current.SendMessage(objectChangedEvent, this.naturalLanguage, null); Assert.AreEqual(this.name, this.viewModel.Name); }
/// <summary> /// The <see cref="ObjectChangedEvent"/> handler for <see cref="Iteration"/> /// </summary> /// <param name="iterationEvent">The <see cref="ObjectChangedEvent"/></param> private void IterationChangeEventHandler(ObjectChangedEvent iterationEvent) { if (this.Session == null) { return; } if (iterationEvent.EventKind == EventKind.Added) { this.Iterations.Add(iterationEvent.ChangedThing as Iteration); } else if (iterationEvent.EventKind == EventKind.Removed) { var iteration = iterationEvent.ChangedThing as Iteration; var browser = this.openElementDefinitionBrowser.SingleOrDefault(x => x.Thing == iteration); if (browser != null) { this.PanelNavigationService.Close(browser, false); this.openElementDefinitionBrowser.Remove(browser); } this.Iterations.RemoveAll(x => x == iteration); } }
/// <summary> /// Handles the <see cref="ObjectChangedEvent"/> /// </summary> /// <param name="objectChange">the event</param> protected override void ObjectChangeEventHandler(ObjectChangedEvent objectChange) { base.ObjectChangeEventHandler(objectChange); this.ComputeNaturalLanguageRows(); this.Caption = PanelCaption + ", " + this.Thing.Name; }
/// <summary> /// The event-handler that is invoked by the subscription that listens for updates /// on the <see cref="Thing"/> that is being represented by the view-model /// </summary> /// <param name="objectChange"> /// The payload of the event that is being handled /// </param> protected override void ObjectChangeEventHandler(ObjectChangedEvent objectChange) { base.ObjectChangeEventHandler(objectChange); this.parentFileStoreFileAndFolderHandler?.UpdateFolderRowPosition(this.Thing); }
/// <summary> /// Handles the <see cref="ObjectChangedEvent"/> /// </summary> /// <param name="objectChange">The <see cref="ObjectChangedEvent"/></param> protected override void ObjectChangeEventHandler(ObjectChangedEvent objectChange) { base.ObjectChangeEventHandler(objectChange); this.UpdateTooltip(); this.ModelCode = ((IModelCode)this.Thing).ModelCode(); }
/// <summary> /// The <see cref="ObjectChangedEvent"/> handler when the <see cref="SiteDirectory"/> is updated /// </summary> /// <param name="objectChange">The <see cref="ObjectChangedEvent"/></param> protected override void ObjectChangeEventHandler(ObjectChangedEvent objectChange) { base.ObjectChangeEventHandler(objectChange); this.UpdatePersonRows(); }
/// <summary> /// The <see cref="ObjectChangedEvent"/> event-handler /// </summary> /// <param name="objectChange">The <see cref="ObjectChangedEvent"/></param> protected override void ObjectChangeEventHandler(ObjectChangedEvent objectChange) { base.ObjectChangeEventHandler(objectChange); this.ComputeSiteRdlRows(); }
/// <summary> /// The event-handler that is invoked by the subscription that listens for updates /// on the <see cref="Thing"/> that is being represented by the view-model /// </summary> /// <param name="objectChange"> /// The payload of the event that is being handled /// </param> protected override void ObjectChangeEventHandler(ObjectChangedEvent objectChange) { base.ObjectChangeEventHandler(objectChange); this.CurrentOption = this.Thing.Name; }
/// <summary> /// The event-handler that is invoked by the subscription that listens for updates /// on the <see cref="Thing"/> that is being represented by the view-model /// </summary> /// <param name="objectChange"> /// The payload of the event that is being handled /// </param> protected virtual void ObjectChangeEventHandler(ObjectChangedEvent objectChange) { this.RevisionNumber = objectChange.ChangedThing.RevisionNumber; }
public static void RaiseObjectChangedEvent(object objectAdded, ChangeType type) // возможно заменить на 3 отдельные Added Deleted Updated, но надо будет много логики реализовывать на стороне подписчика { ObjectChangedEvent?.Invoke(null, new ObjectChangedEventArgs(objectAdded, type)); }
protected override void ObjectChangeEventHandler(ObjectChangedEvent objectChange) { base.ObjectChangeEventHandler(objectChange); this.UpdateColumnValues(); }
/// <summary> /// The <see cref="ObjectChangedEvent"/> handler called upon an update of the current thing /// </summary> /// <param name="objectChange">The <see cref="ObjectChangedEvent"/></param> protected override void ObjectChangeEventHandler(ObjectChangedEvent objectChange) { base.ObjectChangeEventHandler(objectChange); this.ComputeOrganizationRows(); }
/// <summary> /// The update event-handler for this <see cref="SiteDirectory"/> /// </summary> /// <param name="objectChange">The <see cref="ObjectChangedEvent"/></param> protected override void ObjectChangeEventHandler(ObjectChangedEvent objectChange) { base.ObjectChangeEventHandler(objectChange); this.PopulateParticipantRoles(); this.PopulatePersonRoles(); }
/// <summary> /// The <see cref="ObjectChangedEvent"/> event-handler /// </summary> /// <param name="objectChange">The <see cref="ObjectChangedEvent"/></param> protected override void ObjectChangeEventHandler(ObjectChangedEvent objectChange) { base.ObjectChangeEventHandler(objectChange); this.ComputeDomains(); }
/// <summary> /// The objectChange event handler /// </summary> /// <param name="objectChange">The <see cref="ObjectChangedEvent"/> containing the <see cref="EngineeringModel"/></param> protected override void ObjectChangeEventHandler(ObjectChangedEvent objectChange) { base.ObjectChangeEventHandler(objectChange); this.SetProperties(); }
/// <summary> /// The <see cref="ObjectChangedEvent"/> event-handler. /// </summary> /// <param name="objectChange">The <see cref="ObjectChangedEvent"/></param> protected override void ObjectChangeEventHandler(ObjectChangedEvent objectChange) { base.ObjectChangeEventHandler(objectChange); this.UpdateElementDefinition(); this.UpdateProperties(); }
/// <summary> /// The event-handler that is invoked by the subscription that listens for updates /// on the <see cref="Thing"/> that is being represented by the view-model /// </summary> /// <param name="objectChange"> /// The payload of the event that is being handled /// </param> protected override void ObjectChangeEventHandler(ObjectChangedEvent objectChange) { base.ObjectChangeEventHandler(objectChange); this.Name = this.Thing.ShortName; }