Example #1
0
        IDsDocument?TryRuntimeAssemblyResolvers(IAssembly assembly, ModuleDef?sourceModule)
        {
            foreach (var lz in runtimeAsmResolvers)
            {
                var result = lz.Value.Resolve(assembly, sourceModule);
                if (!result.IsDefault)
                {
                    if (!string2.IsNullOrEmpty(result.Filename))
                    {
                        var file = documentService.Find(FilenameKey.CreateFullPath(result.Filename), checkTempCache: true);
                        if (file is not null)
                        {
                            return(file);
                        }
                    }

                    if (result.GetFileData is not null)
                    {
                        return(documentService.TryGetOrCreateInternal(DsDocumentInfo.CreateInMemory(result.GetFileData, result.Filename), true, true));
                    }
                    if (!string2.IsNullOrEmpty(result.Filename))
                    {
                        return(documentService.TryGetOrCreateInternal(DsDocumentInfo.CreateDocument(result.Filename), true, true));
                    }

                    Debug.Fail("Shouldn't be reached");
                    return(null);
                }
            }

            return(null);
        }
Example #2
0
 IDsDocument TryFindFromDir2(string filename) => documentService.Find(FilenameKey.CreateFullPath(filename), checkTempCache: true);