Пример #1
0
		public void Undo()
		{
			if (nsNodeCreator != null) {
				typeNode.OnBeforeRemoved();
				bool b = nsNodeCreator.NamespaceTreeNode.Children.Remove(typeNode);
				Debug.Assert(b);
				if (!b)
					throw new InvalidOperationException();
				nsNodeCreator.Remove();

				origOptions.CopyTo(typeNode.TypeDefinition, module);
				origParentNode.Children.Insert(origParentChildIndex, typeNode);
				typeNode.OnReadded();
			}
			else if (nameChanged) {
				typeNode.OnBeforeRemoved();
				bool b = origParentNode.Children.Remove(typeNode);
				Debug.Assert(b);
				if (!b)
					throw new InvalidOperationException();

				origOptions.CopyTo(typeNode.TypeDefinition, module);
				origParentNode.Children.Insert(origParentChildIndex, typeNode);
				typeNode.OnReadded();
			}
			else
				origOptions.CopyTo(typeNode.TypeDefinition, module);
			typeNode.RaiseUIPropsChanged();
			typeNode.InvalidateInterfacesNode();
		}
Пример #2
0
		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();
		}
Пример #3
0
        public void Undo()
        {
            if (nsNodeCreator != null)
            {
                typeNode.OnBeforeRemoved();
                bool b = nsNodeCreator.NamespaceTreeNode.Children.Remove(typeNode);
                Debug.Assert(b);
                if (!b)
                {
                    throw new InvalidOperationException();
                }
                nsNodeCreator.Remove();

                origOptions.CopyTo(typeNode.TypeDef, module);
                origParentNode.Children.Insert(origParentChildIndex, typeNode);
                typeNode.OnReadded();
            }
            else if (nameChanged)
            {
                typeNode.OnBeforeRemoved();
                bool b = origParentNode.Children.Remove(typeNode);
                Debug.Assert(b);
                if (!b)
                {
                    throw new InvalidOperationException();
                }

                origOptions.CopyTo(typeNode.TypeDef, module);
                origParentNode.Children.Insert(origParentChildIndex, typeNode);
                typeNode.OnReadded();
            }
            else
            {
                origOptions.CopyTo(typeNode.TypeDef, module);
            }
            if (typeRefInfos != null)
            {
                foreach (var info in typeRefInfos)
                {
                    info.TypeRef.Namespace = info.OrigNamespace;
                    info.TypeRef.Name      = info.OrigName;
                }
            }
            typeNode.RaiseUIPropsChanged();
            typeNode.InvalidateInterfacesNode();
        }