/// <inheritdoc/> protected override void OnPropertyChanged(string propName) { base.OnPropertyChanged(propName); if (propName == nameof(Filename)) { documentInfo = DsDocumentInfo.CreateDocument(Filename); } }
string GetDescription(DsDocumentInfo info) { if (info.Type == DocumentConstants.DOCUMENTTYPE_REFASM) { int index = info.Name.LastIndexOf(DocumentConstants.REFERENCE_ASSEMBLY_SEPARATOR); if (index >= 0) return info.Name.Substring(0, index); } return info.Name; }
public IDsDocumentNameKey CreateKey(IDsDocumentService documentService, DsDocumentInfo documentInfo) { if (documentInfo.Type == MyDsDocument.THE_GUID) return new FilenameKey(documentInfo.Name); // Must match the key in MyDsDocument.Key // Also check for normal files if (documentInfo.Type == DocumentConstants.DOCUMENTTYPE_FILE && IsSupportedFile(documentInfo.Name)) return new FilenameKey(documentInfo.Name); // Must match the key in MyDsDocument.Key return null; }
public IDsDocument Create(IDsDocumentService documentService, DsDocumentInfo documentInfo) { if (documentInfo.Type == MyDsDocument.THE_GUID) return MyDsDocument.TryCreate(documentInfo.Name); // Also check for normal files if (documentInfo.Type == DocumentConstants.DOCUMENTTYPE_FILE && IsSupportedFile(documentInfo.Name)) return MyDsDocument.TryCreate(documentInfo.Name); return null; }
static string GetFilename(DsDocumentInfo documentInfo) { if (documentInfo.Type == DocumentConstants.DOCUMENTTYPE_FILE) return documentInfo.Name; if (documentInfo.Type == DocumentConstants.DOCUMENTTYPE_GAC) return GetGacFilename(documentInfo.Name); if (documentInfo.Type == DocumentConstants.DOCUMENTTYPE_REFASM) return GetRefFileFilename(documentInfo.Name); return null; }
/// <inheritdoc/> protected override List <IDsDocument> CreateChildren() { var asm = AssemblyDef; var list = new List <IDsDocument>(asm == null ? 1 : asm.Modules.Count); if (isAsmNode && asm != null) { bool foundThis = false; foreach (var module in asm.Modules) { if (ModuleDef == module) { Debug.Assert(!foundThis); foundThis = true; } list.Add(new DsDotNetDocument(DsDocumentInfo.CreateDocument(module.Location), module, loadedSymbols, false)); } Debug.Assert(foundThis); } return(list); }
public void Add(DsDocumentInfo file) => files.Add(file);
/// <summary> /// Creates a module /// </summary> /// <param name="documentInfo">Document info</param> /// <param name="module">Module</param> /// <param name="loadSyms">true to load symbols</param> /// <returns></returns> public static DsDotNetDocument CreateModule(DsDocumentInfo documentInfo, ModuleDef module, bool loadSyms) => new DsDotNetDocument(documentInfo, module, loadSyms, false);
/// <summary> /// Creates an assembly /// </summary> /// <param name="documentInfo">Document info</param> /// <param name="module">Module</param> /// <param name="loadSyms">true to load symbols</param> /// <returns></returns> public static DsDotNetDocument CreateAssembly(DsDocumentInfo documentInfo, ModuleDef module, bool loadSyms) => new DsDotNetDocument(documentInfo, module, loadSyms, true);
/// <summary> /// Constructor /// </summary> /// <param name="documentInfo">Document info</param> /// <param name="module">Module</param> /// <param name="loadSyms">true to load symbols</param> /// <param name="isAsmNode">true if it's an assembly node, false if it's a module node</param> protected DsDotNetDocument(DsDocumentInfo documentInfo, ModuleDef module, bool loadSyms, bool isAsmNode) : base(module, loadSyms) { this.documentInfo = documentInfo; this.isAsmNode = isAsmNode; }
public IDsDocumentNameKey CreateKey(IDsDocumentService documentService, DsDocumentInfo documentInfo) { var filename = GetFilename(documentInfo); if (filename != null) return new FilenameKey(filename); return null; }
public IDsDocument Create(IDsDocumentService documentService, DsDocumentInfo documentInfo) { var filename = GetFilename(documentInfo); if (filename != null) return documentService.CreateDocument(documentInfo, filename); return null; }
public DocumentToLoad(DsDocumentInfo info, bool isAutoLoaded = false) { Info = info; IsAutoLoaded = isAutoLoaded; }
public static void Save(ISettingsSection section, DsDocumentInfo info) { section.Attribute(DOCUMENTINFO_NAME_ATTR, info.Name); if (info.Type != DocumentConstants.DOCUMENTTYPE_FILE) section.Attribute(DOCUMENTINFO_TYPE_ATTR, info.Type); }