Ejemplo n.º 1
0
        public override bool Export(string filename, IPackage package)
        {
            try
            {
                Dictionary <ulong, STBLImporter.Lookup> nameLookup    = ReadTable("0x17", mEntry["Instance"], package, true);
                Dictionary <ulong, STBLImporter.Lookup> englishLookup = ReadTable("0x00", mEntry["Instance"], package, false);

                Dictionary <ulong, STBLImporter.Lookup> lookup = new Dictionary <ulong, STBLImporter.Lookup>(nameLookup);

                Dictionary <ulong, STBLImporter.Lookup> secondaryLookup = STBLImporter.ReadFile(filename);

                foreach (KeyValuePair <ulong, STBLImporter.Lookup> element in secondaryLookup)
                {
                    if (lookup.ContainsKey(element.Key))
                    {
                        continue;
                    }

                    lookup.Add(element.Key, element.Value);
                }

                using (StreamWriter file = new StreamWriter(filename, false, Encoding.Unicode))
                {
                    file.Write(ConvertToString(lookup, nameLookup, package));
                }

                return(true);
            }
            catch (Exception ex)
            {
                MainForm.IssueError(ex, "Export failed.");
                return(false);
            }
        }
Ejemplo n.º 2
0
        public void SetContents(string value, IPackage package)
        {
            STBLImporter import = GetImporter() as STBLImporter;

            import.ImportFromString(value, package);
        }