Example #1
0
        private void btnLibraryNew_ItemClick(object sender, ItemClickEventArgs e)
        {
            GC.Collect();
            OFD = new OpenFileDialog();
            OFD.ShowDialog();
            if (OFD.FileName == string.Empty || OFD.FileName == null)
            {
                return;
            }

            using (Library.TfmLibrary libraryForm = new Library.TfmLibrary(OFD.FileName, Common.OpenType.New, Common.LibraryType.CSharpLibraryV2))
            {
                libraryForm.MdiParent    = this;
                libraryForm.FormClosing += MDIChild_FormClosing;
                libraryForm.Show();
                GC.Collect();
            }
            //  Library.TfmLibrary libraryForm = new Library.TfmLibrary(OFD.FileName, Common.OpenType.New);
        }
Example #2
0
        private void btnLibraryOpen_ItemClick(object sender, ItemClickEventArgs e)
        {
            GC.Collect();
            if (OFD.ShowDialog() == DialogResult.OK)
            {
                for (int i = 0; i < OFD.FileNames.Length; i++)
                {
                    Common.LibraryType LibraryType;
                    switch (Path.GetExtension(OFD.FileNames[i]).ToLower())
                    {
                    case ".wtl":
                        LibraryType = Common.LibraryType.WTLLibrary;
                        break;

                    case ".lib":
                        LibraryType = Common.LibraryType.CSharpLibraryV2;
                        break;

                    case ".wis":
                    case ".pak":
                    case ".dat":
                    case ".data":
                        MessageBox.Show("Cannot yet open WIS, PAK, DAT, or Data files.");
                        return;

                    default:
                        LibraryType = Common.LibraryType.WeMadeLibrary;
                        break;
                    }

                    Library.TfmLibrary libraryForm = new Library.TfmLibrary(OFD.FileNames[i], Common.OpenType.Open, LibraryType);
                    libraryForm.MdiParent = this;
                    libraryForm.Show();
                }
            }
        }