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;
        }