private bool CanRepositionEvent(int startIndex, ComponentChangedEventArgs e) { bool flag = false; bool flag2 = false; bool flag3 = false; for (int i = startIndex + 1; i < this._events.Count; i++) { AddRemoveUndoEvent event2 = this._events[i] as AddRemoveUndoEvent; RenameUndoEvent event3 = this._events[i] as RenameUndoEvent; ChangeUndoEvent event4 = this._events[i] as ChangeUndoEvent; if ((event2 != null) && !event2.NextUndoAdds) { flag = true; } else if ((event4 != null) && ChangeEventsSymmetric(event4.ComponentChangingEventArgs, e)) { flag3 = true; } else if (event3 != null) { flag2 = true; } } return((flag && !flag2) && !flag3); }
public virtual void ComponentRemoving(ComponentEventArgs e) { if ((e.Component.Site == null) || !(e.Component.Site is INestedContainer)) { if (this._removeEvents == null) { this._removeEvents = new ArrayList(); } try { AddRemoveUndoEvent event2 = new AddRemoveUndoEvent(this._engine, e.Component, false); this.AddEvent(event2); this._removeEvents.Add(event2); } catch (TargetInvocationException) { } } }
public virtual void ComponentRemoved(ComponentEventArgs e) { if ((this._events != null) && (e != null)) { ChangeUndoEvent event2 = null; int index = -1; for (int i = this._events.Count - 1; i >= 0; i--) { AddRemoveUndoEvent event3 = this._events[i] as AddRemoveUndoEvent; if (event2 == null) { event2 = this._events[i] as ChangeUndoEvent; index = i; } if ((event3 != null) && (event3.OpenComponent == e.Component)) { event3.Commit(this._engine); if ((i == (this._events.Count - 1)) || (event2 == null)) { break; } bool flag = true; for (int j = i + 1; j < index; j++) { if (!(this._events[j] is ChangeUndoEvent)) { flag = false; break; } } if (!flag) { break; } this._events.RemoveAt(i); this._events.Insert(index, event3); return; } } } }
public virtual void ComponentRemoving(ComponentEventArgs e) { if ((e.Component.Site == null) || !(e.Component.Site is INestedContainer)) { if (this._removeEvents == null) { this._removeEvents = new ArrayList(); } try { AddRemoveUndoEvent event2 = new AddRemoveUndoEvent(this._engine, e.Component, false); this.AddEvent(event2); this._removeEvents.Add(event2); } catch (TargetInvocationException) { } } }