Represents a field in the TreeView.
상속: ILSpyTreeNode, IMemberTreeNode
예제 #1
0
 internal static ImageInfo GetImageInfo(MethodDef method, BackgroundType bgType)
 {
     return(FieldTreeNode.GetImageInfo(GetMemberIcon(method), bgType));
 }
예제 #2
0
 CreateFieldDefCommand(TypeTreeNode ownerNode, FieldDefOptions options)
 {
     this.ownerNode = ownerNode;
     this.fieldNode = new FieldTreeNode(options.CreateFieldDef(ownerNode.TypeDefinition.Module));
 }
예제 #3
0
 public static ImageSource GetIcon(MethodDef method, BackgroundType bgType)
 {
     return(FieldTreeNode.GetIcon(GetMemberIcon(method), bgType));
 }
예제 #4
0
            public void Restore(FieldTreeNode[] nodes)
            {
                Debug.Assert(infos != null);
                if (infos == null)
                    throw new InvalidOperationException();
                Debug.Assert(infos.Length == nodes.Length);
                if (infos.Length != nodes.Length)
                    throw new InvalidOperationException();

                for (int i = infos.Length - 1; i >= 0; i--) {
                    var node = nodes[i];
                    var info = infos[i];
                    info.OwnerType.Fields.Insert(info.FieldIndex, node.FieldDefinition);
                }

                infos = null;
            }
예제 #5
0
        FieldDefSettingsCommand(FieldTreeNode fieldNode, FieldDefOptions options)
        {
            this.fieldNode = fieldNode;
            this.newOptions = options;
            this.origOptions = new FieldDefOptions(fieldNode.FieldDefinition);

            this.origParentNode = (ILSpyTreeNode)fieldNode.Parent;
            this.origParentChildIndex = this.origParentNode.Children.IndexOf(fieldNode);
            Debug.Assert(this.origParentChildIndex >= 0);
            if (this.origParentChildIndex < 0)
                throw new InvalidOperationException();

            this.nameChanged = origOptions.Name != newOptions.Name;
            if (this.nameChanged)
                this.memberRefInfos = RefFinder.FindMemberRefsToThisModule(ILSpyTreeNode.GetModule(fieldNode)).Where(a => RefFinder.FieldEqualityComparerInstance.Equals(a, fieldNode.FieldDefinition)).Select(a => new MemberRefInfo(a)).ToArray();
        }
예제 #6
0
 DeleteFieldDefCommand(FieldTreeNode[] fieldNodes)
 {
     this.nodes = new DeletableNodes<FieldTreeNode>(fieldNodes);
 }
예제 #7
0
            public void Delete(FieldTreeNode[] nodes)
            {
                Debug.Assert(infos == null);
                if (infos != null)
                    throw new InvalidOperationException();

                infos = new ModelInfo[nodes.Length];

                for (int i = 0; i < infos.Length; i++) {
                    var node = nodes[i];

                    var info = new ModelInfo(node.FieldDefinition);
                    infos[i] = info;
                    info.OwnerType.Fields.RemoveAt(info.FieldIndex);
                }
            }
예제 #8
0
		public static ImageSource GetIcon(PropertyDef property, BackgroundType bgType) {
			return FieldTreeNode.GetIcon(GetMemberIcon(property), bgType);
		}
예제 #9
0
		internal static ImageInfo GetImageInfo(PropertyDef property, BackgroundType bgType) {
			return FieldTreeNode.GetImageInfo(GetMemberIcon(property), bgType);
		}
예제 #10
0
 internal static ImageInfo GetImageInfo(EventDef eventDef, BackgroundType bgType)
 {
     return(FieldTreeNode.GetImageInfo(GetMemberIcon(eventDef), bgType));
 }
예제 #11
0
 public static ImageSource GetIcon(EventDef eventDef, BackgroundType bgType)
 {
     return(FieldTreeNode.GetIcon(GetMemberIcon(eventDef), bgType));
 }
예제 #12
0
        FieldDefSettingsCommand(FieldTreeNode fieldNode, FieldDefOptions options)
        {
            this.fieldNode = fieldNode;
            this.newOptions = options;
            this.origOptions = new FieldDefOptions(fieldNode.FieldDefinition);

            this.origParentNode = (ILSpyTreeNode)fieldNode.Parent;
            this.origParentChildIndex = this.origParentNode.Children.IndexOf(fieldNode);
            Debug.Assert(this.origParentChildIndex >= 0);
            if (this.origParentChildIndex < 0)
                throw new InvalidOperationException();

            this.nameChanged = origOptions.Name != newOptions.Name;
        }