public void Execute() { if (nsNodeCreator != null) { typeNode.OnBeforeRemoved(); bool b = origParentChildIndex < origParentNode.Children.Count && origParentNode.Children[origParentChildIndex] == typeNode; Debug.Assert(b); if (!b) throw new InvalidOperationException(); origParentNode.Children.RemoveAt(origParentChildIndex); newOptions.CopyTo(typeNode.TypeDefinition, module); nsNodeCreator.Add(); nsNodeCreator.NamespaceTreeNode.AddToChildren(typeNode); typeNode.OnReadded(); } else if (nameChanged) { typeNode.OnBeforeRemoved(); bool b = origParentChildIndex < origParentNode.Children.Count && origParentNode.Children[origParentChildIndex] == typeNode; Debug.Assert(b); if (!b) throw new InvalidOperationException(); origParentNode.Children.RemoveAt(origParentChildIndex); newOptions.CopyTo(typeNode.TypeDefinition, module); origParentNode.AddToChildren(typeNode); typeNode.OnReadded(); } else newOptions.CopyTo(typeNode.TypeDefinition, module); typeNode.RaiseUIPropsChanged(); typeNode.InvalidateInterfacesNode(); }
public void Undo() { nestedType.OnBeforeRemoved(); bool b = ownerType.Children.Remove(nestedType) && ownerType.TypeDefinition.NestedTypes.Remove(nestedType.TypeDefinition); Debug.Assert(b); if (!b) throw new InvalidOperationException(); }
public void Undo() { typeNode.OnBeforeRemoved(); bool b = nsNodeCreator.NamespaceTreeNode.Children.Remove(typeNode) && ownerList.Remove(typeNode.TypeDefinition); Debug.Assert(b); if (!b) throw new InvalidOperationException(); nsNodeCreator.Remove(); }