void importSingle(string filename, string title) { if (CurrentPackage == null) { fileNew(); } if (new List <string>(asPkgExts).Contains(filename.Substring(filename.LastIndexOf('.')))) { ImportBatch ib = new ImportBatch(new string[] { filename, }, ImportBatch.Mode.package); DialogResult dr = ib.ShowDialog(); if (dr != DialogResult.OK) { return; } importPackagesCommon(new string[] { filename, }, title, ib.Replace ? DuplicateHandling.replace : DuplicateHandling.reject, ib.Compress, ib.UseNames); } else { ResourceDetails ir = new ResourceDetails(/*20120820 CurrentPackage.Find(x => x.ResourceType == 0x0166038C) != null/**/ true, true); ir.Filename = filename; DialogResult dr = ir.ShowDialog(); if (dr != DialogResult.OK) { return; } importFile(ir.Filename, ir, ir.UseName, ir.AllowRename, ir.Compress, ir.Replace ? DuplicateHandling.replace : DuplicateHandling.reject, true); } }
void importSingle(myDataFormat data) { ResourceDetails ir = new ResourceDetails(/*20120820 CurrentPackage.Find(x => x.ResourceType == 0x0166038C) != null/**/ true, true); ir.Filename = data.tgin; DialogResult dr = ir.ShowDialog(); if (dr != DialogResult.OK) { return; } data.tgin = ir; importStream(data, ir.UseName, ir.AllowRename, ir.Compress, ir.Replace ? DuplicateHandling.replace : DuplicateHandling.reject, true); }
private void resourceAdd() { ResourceDetails ir = new ResourceDetails(/*20120820 CurrentPackage.Find(x => x.ResourceType == 0x0166038C) != null/**/true, false); DialogResult dr = ir.ShowDialog(); if (dr != DialogResult.OK) return; IResourceIndexEntry rie = NewResource(ir, null, ir.Replace ? DuplicateHandling.replace : DuplicateHandling.reject, ir.Compress); if (rie == null) return; browserWidget1.Add(rie); package.ReplaceResource(rie, resource);//Ensure there's an actual resource in the package if (ir.UseName && ir.ResourceName != null && ir.ResourceName.Length > 0) browserWidget1.ResourceName(ir.Instance, ir.ResourceName, true, ir.AllowRename); }
private void resourceDetails() { if (browserWidget1.SelectedResource == null) return; ResourceDetails ir = new ResourceDetails(resourceName != null && resourceName.Length > 0, false, browserWidget1.SelectedResource); ir.Compress = browserWidget1.SelectedResource.Compressed != 0; if (ir.UseName) ir.ResourceName = resourceName; DialogResult dr = ir.ShowDialog(); if (dr != DialogResult.OK) return; browserWidget1.ResourceKey = ir; browserWidget1.SelectedResource.Compressed = (ushort)(ir.Compress ? 0xffff : 0); if (ir.UseName && ir.ResourceName != null && ir.ResourceName.Length > 0) browserWidget1.ResourceName(ir.Instance, ir.ResourceName, true, ir.AllowRename); IsPackageDirty = true; }
void importSingle(myDataFormat data) { ResourceDetails ir = new ResourceDetails(/*20120820 CurrentPackage.Find(x => x.ResourceType == 0x0166038C) != null/**/true, true); ir.Filename = data.tgin; DialogResult dr = ir.ShowDialog(); if (dr != DialogResult.OK) return; data.tgin = ir; importStream(data, ir.UseName, ir.AllowRename, ir.Compress, ir.Replace ? DuplicateHandling.replace : DuplicateHandling.reject, true); }
void importSingle(string filename, string title) { if (CurrentPackage == null) fileNew(); if (new List<string>(asPkgExts).Contains(filename.Substring(filename.LastIndexOf('.')))) { ImportBatch ib = new ImportBatch(new string[] { filename, }, ImportBatch.Mode.package); DialogResult dr = ib.ShowDialog(); if (dr != DialogResult.OK) return; importPackagesCommon(new string[] { filename, }, title, ib.Replace ? DuplicateHandling.replace : DuplicateHandling.reject, ib.Compress, ib.UseNames); } else { ResourceDetails ir = new ResourceDetails(/*20120820 CurrentPackage.Find(x => x.ResourceType == 0x0166038C) != null/**/true, true); ir.Filename = filename; DialogResult dr = ir.ShowDialog(); if (dr != DialogResult.OK) return; importFile(ir.Filename, ir, ir.UseName, ir.AllowRename, ir.Compress, ir.Replace ? DuplicateHandling.replace : DuplicateHandling.reject, true); } }