private void AILayer_KaijuManagement_TamedKaijusCollectionChanged(object sender, CollectionChangeEventArgs e) { if (e.Action == CollectionChangeAction.Add && this.IsActive()) { Kaiju kaiju = e.Element as Kaiju; if (kaiju != null && this.MajorEmpire.TamedKaijus.Contains(kaiju) && kaiju.OnArmyMode()) { AICommander aicommander = this.aiCommanders.Find((AICommander match) => match.ForceArmyGUID == kaiju.KaijuArmy.GUID); if (aicommander == null) { this.AddCommander(new AICommander_KaijuSupport { ForceArmyGUID = kaiju.KaijuArmy.GUID, Empire = base.AIEntity.Empire, AIPlayer = base.AIEntity.AIPlayer }); return; } aicommander.Initialize(); aicommander.Load(); aicommander.CreateMission(); } } }
/// <summary> /// Handles the Comments.Changed event. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="CollectionChangeEventArgs{Comment}"/> instance containing the event data.</param> private void Comments_Changed(object sender, CollectionChangeEventArgs <Comment> e) { if (InvokeRequired) { Invoke(new CollectionChangeEventHandler <Comment>(Comments_Changed), sender, e); } else { if (e.Action == CollectionChangeActionType.RemoveItem) { Control control = (Control)FindCommentControl(e.OldValue); if (control != null) { commentsLayoutPanel.Controls.Remove(control); ((CommentControl)control).Comment = null; ((CommentControl)control).Dispose(); } } else if (e.Action == CollectionChangeActionType.InsertItem) { AddCommentControl(e.NewValue); } } }
protected virtual void ObjectStateManager_ObjectStateManagerChanged(object sender, CollectionChangeEventArgs e) { var contextAdapter = (IObjectContextAdapter)this; if (e.Action != CollectionChangeAction.Add) { return; } var entry = contextAdapter.ObjectContext.ObjectStateManager.GetObjectStateEntry(e.Element); switch (entry.State) { case EntityState.Added: CheckAndSetId(entry.Entity); CheckAndSetMustHaveTenantIdProperty(entry.Entity); SetCreationAuditProperties(entry.Entity, GetAuditUserId()); break; //case EntityState.Deleted: //It's not going here at all // SetDeletionAuditProperties(entry.Entity, GetAuditUserId()); // break; } }
void VMCollectionChanged(object sender, CollectionChangeEventArgs e) { Program.AssertOnEventThread(); VM vm = (VM)e.Element; switch (e.Action) { case CollectionChangeAction.Add: vm.PropertyChanged -= vm_PropertyChanged; vm.PropertyChanged += vm_PropertyChanged; break; case CollectionChangeAction.Remove: vm.PropertyChanged -= vm_PropertyChanged; break; } Program.Invoke(this, () => { // Find row for VM ListViewItem item = FindItemFromVM(vm); if (item != null) { listViewVMs.BeginUpdate(); try { UpdateVmRow(item); } finally { listViewVMs.EndUpdate(); } } }); }
void MenuItemsCollectionChanged(object sender, CollectionChangeEventArgs e) { int height = this.menuItems.Count * 32; this.Height = height; DXControl ctl = (DXControl)e.Element; if (e.Action == CollectionChangeAction.Add) { int width = CalcItemWidth(ctl.Text); if (width > this.Width) { this.Width = width; } ctl.Location = new Point(0, this.Height - 32); ctl.Size = new Size(this.Width, 32); ctl.Parent = this; this.Controls.Add(ctl); } else { this.Controls.Remove(ctl); } }
private void OnCollectionChanged(object sender, CollectionChangeEventArgs e) { var itm = (TabControlItem)e.Element; if (e.Action == CollectionChangeAction.Add) { this.Controls.Add(itm); this.OnTabControlItemChanged(new TabControlItemChangedEventArgs(itm, TabControlItemChangeTypes.Added)); } else if (e.Action == CollectionChangeAction.Remove) { this.Controls.Remove(itm); this.OnTabControlItemChanged( new TabControlItemChangedEventArgs(itm, TabControlItemChangeTypes.Removed)); } else { this.OnTabControlItemChanged( new TabControlItemChangedEventArgs(itm, TabControlItemChangeTypes.Changed)); } this.UpdateLayout(); this.Invalidate(); }
void SR_CollectionChanged(object sender, CollectionChangeEventArgs e) { Program.Invoke(this, refresh); }
private void OnScrollHorizontalViewChanged(object sender, CollectionChangeEventArgs e) { RaiseAutomationPropertyChangedEvent(); }
void XenConnections_CollectionChanged(object sender, CollectionChangeEventArgs e) { Program.BeginInvoke(this, getAllCurrentConnections); }
private void XenConnections_CollectionChanged(object sender, CollectionChangeEventArgs e) { Program.BeginInvoke(Program.MainWindow, buildList); }
internal void OnColumnPropertyChanged(CollectionChangeEventArgs ccevent) { _table.UpdatePropertyDescriptorCollectionCache(); ColumnPropertyChanged?.Invoke(this, ccevent); }
private void OnColumnHeaderItemsEvent(object sender, CollectionChangeEventArgs args) { RaiseAutomationPropertyChangedEvent(); }
private void Columns_CollectionChanged(object sender, CollectionChangeEventArgs e) { switch (e.Action) { case CollectionChangeAction.Add: { if (e.Element is InternalDataColumn dataColumn && dataColumn.IsInternalAction == false) { if (dataColumn.IsKey == true) { dataColumn.Table.AddKey(dataColumn); } if (dataColumn.CremaType != null) { dataColumn.CremaType.AddReference(dataColumn); } dataColumn.InternalIndex = this.columnList.Count; this.columnList.Add(dataColumn); if (this.OmitSignatureDate == false) { dataColumn.InternalCreationInfo = this.SignatureDate; dataColumn.InternalModificationInfo = this.SignatureDate; } } } break; case CollectionChangeAction.Remove: { if (e.Element is InternalDataColumn dataColumn && dataColumn.IsInternalAction == false) { if (dataColumn.CremaType != null) { dataColumn.CremaType.RemoveReference(dataColumn); } this.columnList.Remove(dataColumn); if (this.OmitSignatureDate == false) { dataColumn.InternalCreationInfo = SignatureDate.Empty; dataColumn.InternalModificationInfo = SignatureDate.Empty; } dataColumn.InternalIndex = -1; for (var i = 0; i < this.columnList.Count; i++) { this.columnList[i].InternalIndex = i; } } } break; case CollectionChangeAction.Refresh: { this.columnList.Clear(); foreach (var item in this.Columns) { if (item is InternalDataColumn dataColumn) { this.columnList.Add(dataColumn); } } for (var i = 0; i < this.columnList.Count; i++) { this.columnList[i].InternalIndex = i; } } break; } }
private void Relations_CollectionChanged(object sender, CollectionChangeEventArgs e) { _changesCounter++; }
private void ParentChartPlotter_CollectionChanged(object sender, CollectionChangeEventArgs e) { stackPanel.Children.Clear(); PopulateLegend(); }
public void OnClear(object sender, CollectionChangeEventArgs e) { ClearEvent?.Invoke(sender, e); }
public void OnRemove(object sender, CollectionChangeEventArgs e) { RemoveEvent?.Invoke(sender, e); }
public void OnInsert(object sender, CollectionChangeEventArgs e) { InsertEvent?.Invoke(sender, e); }
private void CollectionChanged(object sender, CollectionChangeEventArgs e) { Program.Invoke(this, PopulateComboBox); }
private void Columns_CollectionChanged(object sender, CollectionChangeEventArgs e) { UpdateColumnNames(); }
private void Constraints_CollectionChanged(object sender, CollectionChangeEventArgs e) { }
public void OnPop(object sender, CollectionChangeEventArgs e) { PopEvent?.Invoke(sender, e); }
private void DepartmentOfEducation_VaultItemsCollectionChange(object sender, CollectionChangeEventArgs e) { base.NeedRefresh = true; }
private void Columns_CollectionChanged1(object sender, CollectionChangeEventArgs e) { _eventOccurred = true; }
/// <summary> /// Raises the <see cref='System.Data.ConstraintCollection.CollectionChanged'/> event. /// </summary> private void OnCollectionChanged(CollectionChangeEventArgs ccevent) { _onCollectionChanged?.Invoke(this, ccevent); }
private void OnCollectionChanging(CollectionChangeEventArgs ccevent) { CollectionChanging?.Invoke(this, ccevent); }
private void Columns_CollectionChanged(object sender, CollectionChangeEventArgs e) { _counter++; _change_element = e.Element; }
void SR_CollectionChanged(object sender, CollectionChangeEventArgs e) { Program.Invoke(this, BuildList); }
protected virtual void OnToolBoxCategoryCollectionChanged(Object sender, CollectionChangeEventArgs e) { }
private void Host_CollectionChanged(object sender, CollectionChangeEventArgs e) { buildList(); }