CreateNestedTypeDefCommand(TypeTreeNode ownerType, TypeDefOptions options) { this.ownerType = ownerType; var modNode = ILSpyTreeNode.GetNode<AssemblyTreeNode>(ownerType); Debug.Assert(modNode != null); if (modNode == null) throw new InvalidOperationException(); this.nestedType = new TypeTreeNode(options.CreateTypeDef(modNode.LoadedAssembly.ModuleDefinition), modNode.Parent as AssemblyTreeNode ?? modNode); }
CreateTypeDefCommand(IList<TypeDef> ownerList, ILSpyTreeNode ownerNode, TypeDefOptions options) { this.ownerList = ownerList; var modNode = ILSpyTreeNode.GetNode<AssemblyTreeNode>(ownerNode); Debug.Assert(modNode != null); if (modNode == null) throw new InvalidOperationException(); this.nsNodeCreator = new NamespaceTreeNodeCreator(options.Namespace, modNode); this.typeNode = new TypeTreeNode(options.CreateTypeDef(modNode.LoadedAssembly.ModuleDefinition), modNode.Parent as AssemblyTreeNode ?? modNode); }