private void tsmi_DisableSelected_Click(object sender, EventArgs e) { ModsSelector tag = (ModsSelector)this.selectorContextMenu.Tag; tag.DisableSelectedRows(); tag.ClearSelection(); }
private void tsmi_ApplyToSelected_Click(object sender, EventArgs e) { ModsSelector tag = (ModsSelector)this.selectorContextMenu.Tag; tag.SetModOnSelectedRows((ModPack)this.cbxSetMod.SelectedItem); tag.ClearSelection(); }
private void btnSetMod_Click(object sender, EventArgs e) { ModsSelector currentSelector = this.GetCurrentSelector(); if (this.cbxSetMod.SelectedIndex == 0) { currentSelector.DisableAll(); return; } currentSelector.SetModOnAllRows(this.GetSelectedPack()); }
public FrModsManager() { this.InitializeComponent(); ModsSelector[] modsSelectorArray = new ModsSelector[] { this.genSelector, this.bgmSelector, this.vidSelector }; this._modsSelectors = modsSelectorArray; this.bgmTabPage.ToolTipText = gPatcher.Localization.Text.Window_ManagerForm_TabPagesToolTips_Bgm; this.vidTabPage.ToolTipText = gPatcher.Localization.Text.Window_ManagerForm_TabPagesToolTips_Vid; this.cbxSetMod.DataSource = GlobalData.ModPacksManager; ComboBox comboBox = this.cbxSetMod; string str = "Name"; string str1 = str; this.cbxSetMod.ValueMember = str; comboBox.DisplayMember = str1; this.CancelChanges(); }
private void Save() { GlobalData.PresetsManager.Clear(); ModsSelector[] modsSelectorArray = this._modsSelectors; for (int i = 0; i < (int)modsSelectorArray.Length; i++) { ModsSelector modsSelector = modsSelectorArray[i]; GlobalData.PresetsManager.AddRange <Preset>(modsSelector.GetPreset()); } try { GlobalData.PresetsManager.Save(); } catch (Exception exception) { MsgBox.Error(gPatcher.Localization.Text.Error_SavingUserMods, exception); } }
private void InitializeComponent() { this.components = new System.ComponentModel.Container(); ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(FrModsManager)); this.btnMenuContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components); this.tsmiNew = new ToolStripMenuItem(); this.tsmiImportFolder = new ToolStripMenuItem(); this.tsmiImportZip = new ToolStripMenuItem(); this.toolStripSeparator1 = new ToolStripSeparator(); this.tsmiEditOngPatcher = new ToolStripMenuItem(); this.tsmiEditOnExplorer = new ToolStripMenuItem(); this.tsmiSeparator = new ToolStripSeparator(); this.tsmiExport = new ToolStripMenuItem(); this.tsmiDelete = new ToolStripMenuItem(); this.selectorContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components); this.tsmiApplyToSelected = new ToolStripMenuItem(); this.tsmiDisableSelected = new ToolStripMenuItem(); this.tabImageList = new ImageList(this.components); this.toolTip = new ToolTip(this.components); this.bgmTabPage = new TabPage(); this.bgmSelector = new ModsSelector(); this.vidTabPage = new TabPage(); this.vidSelector = new ModsSelector(); this.menuInferior = new MenuInferior(); this.tbxSearch = new ImageTextBox(); this.btnSetMod = new Button(); this.tabControl = new Dotnetrix.Controls.TabControl(); this.genTabPage = new TabPage(); this.genSelector = new ModsSelector(); this.cbxSetMod = new ComboBox(); this.btnMenu = new DropDownButton(); this.btnMenuContextMenu.SuspendLayout(); this.selectorContextMenu.SuspendLayout(); this.bgmTabPage.SuspendLayout(); this.vidTabPage.SuspendLayout(); this.tabControl.SuspendLayout(); this.genTabPage.SuspendLayout(); base.SuspendLayout(); ToolStripItemCollection items = this.btnMenuContextMenu.Items; ToolStripItem[] toolStripItemArray = new ToolStripItem[] { this.tsmiNew, this.tsmiImportFolder, this.tsmiImportZip, this.toolStripSeparator1, this.tsmiEditOngPatcher, this.tsmiEditOnExplorer, this.tsmiSeparator, this.tsmiExport, this.tsmiDelete }; items.AddRange(toolStripItemArray); this.btnMenuContextMenu.Name = "contextMenu"; componentResourceManager.ApplyResources(this.btnMenuContextMenu, "btnMenuContextMenu"); this.tsmiNew.Image = Images16px.PackNew; this.tsmiNew.Name = "tsmiNew"; componentResourceManager.ApplyResources(this.tsmiNew, "tsmiNew"); this.tsmiNew.Click += new EventHandler(this.tsmi_NewPackage_Click); this.tsmiImportFolder.Image = Images16px.Folder; this.tsmiImportFolder.Name = "tsmiImportFolder"; componentResourceManager.ApplyResources(this.tsmiImportFolder, "tsmiImportFolder"); this.tsmiImportFolder.Click += new EventHandler(this.tsmi_ImportFolder_Click); this.tsmiImportZip.Name = "tsmiImportZip"; componentResourceManager.ApplyResources(this.tsmiImportZip, "tsmiImportZip"); this.tsmiImportZip.Click += new EventHandler(this.tsmi_ImportZip_Click); this.toolStripSeparator1.Name = "toolStripSeparator1"; componentResourceManager.ApplyResources(this.toolStripSeparator1, "toolStripSeparator1"); this.tsmiEditOngPatcher.Image = Images16px.gPatcher; this.tsmiEditOngPatcher.Name = "tsmiEditOngPatcher"; componentResourceManager.ApplyResources(this.tsmiEditOngPatcher, "tsmiEditOngPatcher"); this.tsmiEditOngPatcher.Click += new EventHandler(this.tsmi_EditOn_gPatcher_Click); this.tsmiEditOnExplorer.Image = Images16px.Explorer; this.tsmiEditOnExplorer.Name = "tsmiEditOnExplorer"; componentResourceManager.ApplyResources(this.tsmiEditOnExplorer, "tsmiEditOnExplorer"); this.tsmiEditOnExplorer.Click += new EventHandler(this.tsmi_EditOn_WExplorer_Click); this.tsmiSeparator.Name = "tsmiSeparator"; componentResourceManager.ApplyResources(this.tsmiSeparator, "tsmiSeparator"); this.tsmiExport.Image = Images16px.ZIP; this.tsmiExport.Name = "tsmiExport"; componentResourceManager.ApplyResources(this.tsmiExport, "tsmiExport"); this.tsmiExport.Click += new EventHandler(this.btnExportToZip_Click); this.tsmiDelete.Image = Images16px.Cross; this.tsmiDelete.Name = "tsmiDelete"; componentResourceManager.ApplyResources(this.tsmiDelete, "tsmiDelete"); this.tsmiDelete.Click += new EventHandler(this.tsmi_Delete_Click); ToolStripItemCollection toolStripItemCollections = this.selectorContextMenu.Items; ToolStripItem[] toolStripItemArray1 = new ToolStripItem[] { this.tsmiApplyToSelected, this.tsmiDisableSelected }; toolStripItemCollections.AddRange(toolStripItemArray1); this.selectorContextMenu.Name = "contextMenuStrip1"; componentResourceManager.ApplyResources(this.selectorContextMenu, "selectorContextMenu"); this.selectorContextMenu.Opening += new CancelEventHandler(this.selectorContextMenu_Opening); this.tsmiApplyToSelected.Image = Images16px.Tick; this.tsmiApplyToSelected.Name = "tsmiApplyToSelected"; componentResourceManager.ApplyResources(this.tsmiApplyToSelected, "tsmiApplyToSelected"); this.tsmiApplyToSelected.Click += new EventHandler(this.tsmi_ApplyToSelected_Click); this.tsmiDisableSelected.Image = Images16px.Cancel; this.tsmiDisableSelected.Name = "tsmiDisableSelected"; componentResourceManager.ApplyResources(this.tsmiDisableSelected, "tsmiDisableSelected"); this.tsmiDisableSelected.Click += new EventHandler(this.tsmi_DisableSelected_Click); this.tabImageList.ImageStream = (ImageListStreamer)componentResourceManager.GetObject("tabImageList.ImageStream"); this.tabImageList.TransparentColor = Color.Transparent; this.tabImageList.Images.SetKeyName(0, "Mods_General.png"); this.tabImageList.Images.SetKeyName(1, "Mods_Music.png"); this.tabImageList.Images.SetKeyName(2, "Mods_Video.png"); this.bgmTabPage.Controls.Add(this.bgmSelector); componentResourceManager.ApplyResources(this.bgmTabPage, "bgmTabPage"); this.bgmTabPage.Name = "bgmTabPage"; this.bgmTabPage.UseVisualStyleBackColor = true; componentResourceManager.ApplyResources(this.bgmSelector, "bgmSelector"); this.bgmSelector.ModType = ModTypes.BGM; this.bgmSelector.Name = "bgmSelector"; this.bgmSelector.CellValueChanged += new DataGridViewCellEventHandler(this.EnableApplyButton); this.bgmSelector.MouseUp += new MouseEventHandler(this.ModsSelector_MouseUp); this.vidTabPage.Controls.Add(this.vidSelector); componentResourceManager.ApplyResources(this.vidTabPage, "vidTabPage"); this.vidTabPage.Name = "vidTabPage"; this.vidTabPage.UseVisualStyleBackColor = true; componentResourceManager.ApplyResources(this.vidSelector, "vidSelector"); this.vidSelector.ModType = ModTypes.Video; this.vidSelector.Name = "vidSelector"; this.vidSelector.CellValueChanged += new DataGridViewCellEventHandler(this.EnableApplyButton); this.vidSelector.MouseUp += new MouseEventHandler(this.ModsSelector_MouseUp); componentResourceManager.ApplyResources(this.menuInferior, "menuInferior"); this.menuInferior.Name = "menuInferior"; this.menuInferior.ButtonOkClick += new EventHandler(this.btn_OK_Click); this.menuInferior.ButtonCancelClick += new EventHandler(this.btn_Cancel_Click); this.menuInferior.ButtonApplyClick += new EventHandler(this.btn_Apply_Click); componentResourceManager.ApplyResources(this.tbxSearch, "tbxSearch"); this.tbxSearch.BackColor = SystemColors.Window; this.tbxSearch.Image = Images16px.Search; this.tbxSearch.Name = "tbxSearch"; this.tbxSearch.TextBoxTextChanged += new EventHandler(this.tbx_Search_TextChanged); componentResourceManager.ApplyResources(this.btnSetMod, "btnSetMod"); this.btnSetMod.Image = Images16px.Tick; this.btnSetMod.Name = "btnSetMod"; this.btnSetMod.UseVisualStyleBackColor = true; this.btnSetMod.Click += new EventHandler(this.btnSetMod_Click); this.btnSetMod.MouseUp += new MouseEventHandler(this.btn_SetMod_MouseUp); componentResourceManager.ApplyResources(this.tabControl, "tabControl"); this.tabControl.Controls.Add(this.genTabPage); this.tabControl.Controls.Add(this.bgmTabPage); this.tabControl.Controls.Add(this.vidTabPage); this.tabControl.ImageList = this.tabImageList; this.tabControl.Name = "tabControl"; this.tabControl.SelectedIndex = 0; this.tabControl.SizeMode = TabSizeMode.Fixed; this.tabControl.SelectedIndexChanged += new EventHandler(this.tabControl_SelectedIndexChanged); this.genTabPage.Controls.Add(this.genSelector); componentResourceManager.ApplyResources(this.genTabPage, "genTabPage"); this.genTabPage.Name = "genTabPage"; this.genTabPage.UseVisualStyleBackColor = true; componentResourceManager.ApplyResources(this.genSelector, "genSelector"); this.genSelector.ModType = ModTypes.General; this.genSelector.Name = "genSelector"; this.genSelector.CellValueChanged += new DataGridViewCellEventHandler(this.EnableApplyButton); this.genSelector.MouseUp += new MouseEventHandler(this.ModsSelector_MouseUp); componentResourceManager.ApplyResources(this.cbxSetMod, "cbxSetMod"); this.cbxSetMod.DropDownStyle = ComboBoxStyle.DropDownList; this.cbxSetMod.FormattingEnabled = true; this.cbxSetMod.Name = "cbxSetMod"; this.cbxSetMod.SelectedIndexChanged += new EventHandler(this.cbx_SetMod_SelectedIndexChanged); componentResourceManager.ApplyResources(this.btnMenu, "btnMenu"); this.btnMenu.Image = Images16px.Menu; this.btnMenu.Menu = this.btnMenuContextMenu; this.btnMenu.Name = "btnMenu"; this.btnMenu.UseVisualStyleBackColor = true; base.AutoBackgroundImage = BackgroundImages.Elesis; componentResourceManager.ApplyResources(this, "$this"); base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; base.Controls.Add(this.btnMenu); base.Controls.Add(this.menuInferior); base.Controls.Add(this.tbxSearch); base.Controls.Add(this.btnSetMod); base.Controls.Add(this.tabControl); base.Controls.Add(this.cbxSetMod); this.DoubleBuffered = true; base.KeyPreview = true; base.Name = "FrModsManager"; base.PersistState = true; base.FormClosing += new FormClosingEventHandler(this.Configuration_FormClosing); base.BackgroundImageChanged += new EventHandler(this.Configuration_BackgroundImageChanged); base.VisibleChanged += new EventHandler(this.ManagerForm_VisibleChanged); base.KeyDown += new KeyEventHandler(this.ManagerForm_KeyDown); this.btnMenuContextMenu.ResumeLayout(false); this.selectorContextMenu.ResumeLayout(false); this.bgmTabPage.ResumeLayout(false); this.vidTabPage.ResumeLayout(false); this.tabControl.ResumeLayout(false); this.genTabPage.ResumeLayout(false); base.ResumeLayout(false); base.PerformLayout(); }