示例#1
0
        public ICollection ReadResources()
        {
            ArrayList arrayList = new ArrayList();

            for (;;)
            {
                this.read_padding();
                int num = this.read_int32();
                if (num == -1)
                {
                    break;
                }
                this.read_int32();
                NameOrId type = this.read_ordinal();
                NameOrId name = this.read_ordinal();
                this.read_padding();
                this.read_int32();
                this.read_int16();
                int language = this.read_int16();
                this.read_int32();
                this.read_int32();
                if (num != 0)
                {
                    byte[] array = new byte[num];
                    this.res_file.Read(array, 0, num);
                    arrayList.Add(new Win32EncodedResource(type, name, language, array));
                }
            }
            return(arrayList);
        }
示例#2
0
        public ICollection ReadResources()
        {
            ArrayList resources = new ArrayList();

            /*
             * We can't use a BinaryReader since we have to keep track of the
             * stream position for padding.
             */

            while (true)
            {
                read_padding();

                int data_size = read_int32();

                if (data_size == -1)
                {
                    /* EOF */
                    break;
                }

                //int header_size =
                read_int32();
                NameOrId type = read_ordinal();
                NameOrId name = read_ordinal();

                read_padding();

                //int data_version =
                read_int32();
                //int memory_flags =
                read_int16();
                int language_id = read_int16();
                //int version =
                read_int32();
                //int characteristics =
                read_int32();

                if (data_size == 0)
                {
                    /* Empty resource entry */
                    continue;
                }

                byte[] data = new byte [data_size];
                res_file.Read(data, 0, data_size);

                resources.Add(new Win32EncodedResource(type, name, language_id, data));
            }

            return(resources);
        }
 internal Win32EncodedResource(NameOrId type, NameOrId name, int language, byte[] data) : base(type, name, language)
 {
     this.data = data;
 }
示例#4
0
 internal Win32Resource(Win32ResourceType type, int name, int language)
 {
     this.type     = new NameOrId((int)type);
     this.name     = new NameOrId(name);
     this.language = language;
 }
示例#5
0
 internal Win32Resource(NameOrId type, NameOrId name, int language)
 {
     this.type     = type;
     this.name     = name;
     this.language = language;
 }
示例#6
0
	internal Win32EncodedResource (NameOrId type, NameOrId name, int language, byte[] data) : base (type, name, language) {
		this.data = data;
	}
示例#7
0
	internal Win32Resource (Win32ResourceType type, int name, int language) {
		this.type = new NameOrId ((int)type);
		this.name = new NameOrId (name);
		this.language = language;
	}
示例#8
0
	internal Win32Resource (NameOrId type, NameOrId name, int language) {
		this.type = type;
		this.name = name;
		this.language = language;
	}