예제 #1
0
		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();
		}
예제 #2
0
 public void Execute()
 {
     nsNodeCreator.Add();
     nsNodeCreator.NamespaceTreeNode.EnsureChildrenFiltered();
     ownerList.Add(typeNode.TypeDef);
     nsNodeCreator.NamespaceTreeNode.AddToChildren(typeNode);
     typeNode.OnReadded();
 }