示例#1
0
 void Load(FileDef obj)
 {
     if (obj == null)
         return;
     Add(obj.Flags);
     Add(obj.Name);
     Add(obj.HashValue);
     Add(obj.CustomAttributes);
 }
示例#2
0
        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));
        }
示例#3
0
		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();
			}
		}
示例#4
0
 /// <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;
 }
示例#5
0
		/// <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;
		}
示例#6
0
 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);
 }