Esempio n. 1
0
        public EditorForm()
        {
            InitializeComponent();

            this.Visible = false;

            AppState.LastQbReplacePath = string.Empty;
            AppState.LastQbExtractPath = string.Empty;

            _formats = new Dictionary<string, PakFormatType>();
            _formats.Add("Wii (ngc)", PakFormatType.Wii);
            _formats.Add("PS2 (ps2)", PakFormatType.PS2);
            _formats.Add("XBox (xen)", PakFormatType.XBox);
            _formats.Add("XBox (xbx)", PakFormatType.XBox_XBX);
            _formats.Add("PC (xen)", PakFormatType.PC);
            _formats.Add("PC (wpc)", PakFormatType.PC_WPC);

            foreach (string s in _formats.Keys)
                cboFormatType.Items.Add(s);

            _info = null;
            this.FormClosing += new FormClosingEventHandler(EditorForm_FormClosing);

            _lvwPakColumnSorter = new ListViewColumnSorter();
            this.lstPakContents.ListViewItemSorter = _lvwPakColumnSorter;
            _lvwPakColumnSorter.SortColumn = 0;
            _lvwPakColumnSorter.Order = SortOrder.Ascending;

            _lvwSearchColumnSorter = new ListViewColumnSorter();
            this.lstSearchResults.ListViewItemSorter = _lvwSearchColumnSorter;
            _lvwSearchColumnSorter.SortColumn = 0;
            _lvwSearchColumnSorter.Order = SortOrder.Ascending;

            tabs.SelectedTab = tabPak;

            Assembly ass = Assembly.GetExecutingAssembly();
            object[] attributes = ass.GetCustomAttributes(true);
            string assName = string.Empty;
            string assDescription = string.Empty;
            string assCompany = string.Empty;
            Version assVersion = ass.GetName().Version;

            foreach (object attribute in attributes)
            {
                if (attribute is AssemblyDescriptionAttribute)
                    assDescription = (((AssemblyDescriptionAttribute)attribute).Description);
                else if (attribute is AssemblyTitleAttribute)
                    assName = (((AssemblyTitleAttribute)attribute).Title);
                else if (attribute is AssemblyCompanyAttribute)
                    assCompany = (((AssemblyCompanyAttribute)attribute).Company);
            }
            this.Text = string.Format("{0} ({1})     v{2}.{3}     by {4}", assName, assDescription, assVersion.Major.ToString(), assVersion.Minor.ToString(), assCompany);

            cboFormatType.SelectedIndex = 0;

            loadConfiguration();
            this.Visible = true;
        }
Esempio n. 2
0
        private void EditorForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            saveConfiguration();

            if (_info != null)
            {
                _info.FormClosed -= new FormClosedEventHandler(_info_FormClosed);
                _info.Close();
                _info = null;
            }
        }
Esempio n. 3
0
 private void btnInfo_Click(object sender, EventArgs e)
 {
     if (_info == null)
     {
         _info = new InfoForm();
         _info.FormClosed += new FormClosedEventHandler(_info_FormClosed);
     }
     _info.Show();
     _info.BringToFront();
 }
Esempio n. 4
0
 private void _info_FormClosed(object sender, FormClosedEventArgs e)
 {
     _info = null;
 }