Beispiel #1
0
 private void UpdateTGIN()
 {
     if (internalchg) return;
     details = new TGIN();
     details.ResType = cbType.Value;
     details.ResGroup = ResourceGroup;
     details.ResInstance = Instance;
     details.ResName = ResourceName;
 }
Beispiel #2
0
 private void FillPanel()
 {
     internalchg = true;
     try
     {
         details = this.tbFilename.Text;
         cbType.Value = details.ResType;
         tbGroup.Text = "0x" + details.ResGroup.ToString("X8");
         tbInstance.Text = "0x" + details.ResInstance.ToString("X16");
         tbName.Text = details.ResName;
         btnOK.Enabled = btnOKCanEnable;
     }
     finally { internalchg = false; }
 }
Beispiel #3
0
        bool importFile(string filename, TGIN tgin, bool useName, bool rename, bool compress, DuplicateHandling dups, bool select)
        {
            IResourceKey rk = (TGIBlock)tgin;
            string resName = tgin.ResName;
            bool nmOK = true;
            MemoryStream ms = new MemoryStream();
            BinaryWriter w = new BinaryWriter(ms);
            BinaryReader r = new BinaryReader(new FileStream(filename, FileMode.Open, FileAccess.Read));
            w.Write(r.ReadBytes((int)r.BaseStream.Length));
            r.Close();
            w.Flush();

            if (useName && resName != null && resName.Length > 0)
                nmOK = browserWidget1.ResourceName(rk.Instance, resName, true, rename);

            IResourceIndexEntry rie = NewResource(rk, ms, dups, compress);
            if (rie != null) browserWidget1.Add(rie, select);
            return nmOK;
        }