void Load(FileDef obj) { if (obj == null) return; Add(obj.Flags); Add(obj.Name); Add(obj.HashValue); Add(obj.CustomAttributes); }
private static ModuleDef FindModule(ModuleDef module, FileDef file) { if (module == null || file == null) { return(null); } if (UTF8String.CaseInsensitiveEquals(module.Name, file.Name)) { return(module); } var asm = module.Assembly; if (asm == null) { return(null); } return(asm.FindModule(file.Name)); }
public ResourceOptions(Resource resource) { this.ResourceType = resource.ResourceType; this.Name = resource.Name ?? UTF8String.Empty; this.Attributes = resource.Attributes; switch (resource.ResourceType) { case ResourceType.Embedded: break; case ResourceType.AssemblyLinked: this.Assembly = ((AssemblyLinkedResource)resource).Assembly; break; case ResourceType.Linked: this.File = ((LinkedResource)resource).File; break; default: throw new InvalidOperationException(); } }
/// <summary> /// Constructor /// </summary> /// <param name="name">Name of resource</param> /// <param name="file">The file</param> /// <param name="flags">Resource flags</param> public LinkedResource(UTF8String name, FileDef file, ManifestResourceAttributes flags) : base(name, flags) { this.file = file; }
static ModuleDef FindModule(ModuleDef module, FileDef file) { if (module == null || file == null) return null; if (UTF8String.CaseInsensitiveEquals(module.Name, file.Name)) return module; var asm = module.Assembly; if (asm == null) return null; return asm.FindModule(file.Name); }