예제 #1
0
        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);
            }
        }
예제 #2
0
        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);
        }
예제 #3
0
        private void ImportSingle(string filename, string title)
        {
            if (this.CurrentPackage == null)
            {
                this.FileNew();
            }

            if (packageExtensions.Contains(filename.FileExtension()))
            {
                ImportBatch  ib = new ImportBatch(new[] { filename }, S4PIDemoFE.ImportBatch.Mode.package);
                DialogResult dr = ib.ShowDialog();
                if (dr != DialogResult.OK)
                {
                    return;
                }

                this.ImportPackagesCommon(new[] { filename },
                                          title,
                                          ib.Replace ? DuplicateHandling.Replace : DuplicateHandling.Reject,
                                          ib.Compress,
                                          ib.UseNames);
            }
            else
            {
                ResourceDetails ir = new ResourceDetails(true, true)
                {
                    Filename = filename
                };
                DialogResult dr = ir.ShowDialog();
                if (dr != DialogResult.OK)
                {
                    return;
                }

                this.ImportFile(ir.Filename,
                                ir,
                                ir.UseName,
                                ir.AllowRename,
                                ir.Compress,
                                ir.Replace ? DuplicateHandling.Replace : DuplicateHandling.Reject,
                                true);
            }
        }
예제 #4
0
        private void ImportSingle(MyDataFormat data)
        {
            ResourceDetails ir = new ResourceDetails(true, true)
            {
                Filename = data.tgin
            };
            DialogResult dr = ir.ShowDialog();

            if (dr != DialogResult.OK)
            {
                return;
            }

            data.tgin = ir;
            this.ImportStream(data,
                              ir.UseName,
                              ir.AllowRename,
                              ir.Compress,
                              ir.Replace ? DuplicateHandling.Replace : DuplicateHandling.Reject,
                              true);
        }
예제 #5
0
        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);
        }
예제 #6
0
        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 ? 0x5A42 : 0);

            if (ir.UseName && ir.ResourceName != null && ir.ResourceName.Length > 0)
                browserWidget1.ResourceName(ir.Instance, ir.ResourceName, true, ir.AllowRename);

            IsPackageDirty = true;
        }
예제 #7
0
        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);
        }
예제 #8
0
        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);
            }
        }