Esempio n. 1
0
        public void Execute()
        {
            if (nameChanged)
            {
                bool b = origParentChildIndex < origParentNode.Children.Count && origParentNode.Children[origParentChildIndex] == fieldNode;
                Debug.Assert(b);
                if (!b)
                {
                    throw new InvalidOperationException();
                }
                origParentNode.Children.RemoveAt(origParentChildIndex);
                newOptions.CopyTo(fieldNode.FieldDefinition);

                origParentNode.AddToChildren(fieldNode);
            }
            else
            {
                newOptions.CopyTo(fieldNode.FieldDefinition);
            }
            if (memberRefInfos != null)
            {
                foreach (var info in memberRefInfos)
                {
                    info.MemberRef.Name = fieldNode.FieldDefinition.Name;
                }
            }
            fieldNode.RaiseUIPropsChanged();
        }
Esempio n. 2
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();
		}
Esempio n. 3
0
        public void Execute()
        {
            UTF8String newNamespace = newName;

            if (existingNsNode != null)
            {
                Debug.Assert(origChildren.Length == nsNode.Children.Count);
                foreach (var typeNode in origChildren)
                {
                    typeNode.OnBeforeRemoved();
                }
                nsNode.Children.Clear();
                foreach (var typeNode in origChildren)
                {
                    typeNode.TypeDef.Namespace = newNamespace;
                    existingNsNode.AddToChildren(typeNode);
                    typeNode.OnReadded();
                }
            }
            else
            {
                nsNode.OnBeforeRemoved();
                bool b = origParentChildIndex < origParentNode.Children.Count && origParentNode.Children[origParentChildIndex] == nsNode;
                Debug.Assert(b);
                if (!b)
                {
                    throw new InvalidOperationException();
                }
                origParentNode.Children.RemoveAt(origParentChildIndex);
                nsNode.Name = newName;

                foreach (var typeNode in origChildren)
                {
                    typeNode.TypeDef.Namespace = newNamespace;
                }

                origParentNode.AddToChildren(nsNode);
                nsNode.OnReadded();
            }

            foreach (var info in typeRefInfos)
            {
                info.TypeRef.Namespace = newNamespace;
            }
        }
Esempio n. 4
0
        public void Execute()
        {
            if (nameChanged)
            {
                bool b = origParentChildIndex < origParentNode.Children.Count && origParentNode.Children[origParentChildIndex] == eventNode;
                Debug.Assert(b);
                if (!b)
                {
                    throw new InvalidOperationException();
                }
                origParentNode.Children.RemoveAt(origParentChildIndex);
                newOptions.CopyTo(eventNode.EventDef);

                origParentNode.AddToChildren(eventNode);
            }
            else
            {
                newOptions.CopyTo(eventNode.EventDef);
            }
            eventNode.RaiseUIPropsChanged();
        }