Esempio n. 1
0
 /// <inheritdoc/>
 protected override void OnPropertyChanged(string propName)
 {
     base.OnPropertyChanged(propName);
     if (propName == nameof(Filename))
     {
         documentInfo = DsDocumentInfo.CreateDocument(Filename);
     }
 }
Esempio n. 2
0
		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;
		}
Esempio n. 3
0
		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;
		}
Esempio n. 4
0
		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;
		}
Esempio n. 6
0
        /// <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);
        }
Esempio n. 7
0
		public void Add(DsDocumentInfo file) => files.Add(file);
Esempio n. 8
0
 /// <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);
Esempio n. 9
0
 /// <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);
Esempio n. 10
0
 /// <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;
		}
Esempio n. 13
0
		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);
		}