public static void ShowItemDetailsDialog(Form owner, PlatformPrefix consoleType, CategoriesData categories, ModItemData modItem) { XtraForm detailsDialog = new(); switch (consoleType) { case PlatformPrefix.PS3: if (modItem.GetCategoryType(categories) == CategoryType.Game) { detailsDialog = new GameModDialog { ModItem = modItem }; } else if (modItem.GetCategoryType(categories) == CategoryType.Homebrew) { detailsDialog = new HomebrewDialog { ModItem = modItem }; } else if (modItem.GetCategoryType(categories) == CategoryType.Resource) { detailsDialog = new ResourceDialog { ModItem = modItem }; } break; case PlatformPrefix.XBOX: detailsDialog = new PluginDialog { ModItem = modItem }; break; default: break; } XtraForm overlayForm = new(); overlayForm.StartPosition = FormStartPosition.Manual; overlayForm.FormBorderStyle = FormBorderStyle.None; overlayForm.Opacity = .50d; overlayForm.BackColor = Color.Black; overlayForm.Size = owner.Size; overlayForm.Location = owner.Location; overlayForm.ShowInTaskbar = false; overlayForm.Show(owner); detailsDialog.Owner = owner; detailsDialog.ShowDialog(); //Get rid of the overlay form overlayForm.Dispose(); }
public bool RequestOptions(IPluginForm optionForm) { PluginFormInfo info = _pluginFormLoader.FormToInfo(optionForm); var pluginDialog = new PluginDialog { DataContext = info, Owner = Application.Current.MainWindow, }; var result = pluginDialog.ShowDialog() == true; _pluginFormLoader.InfoToForm(info); return(result); }
private void Edit(int rowIndex) { var plugin = plugins[rowIndex]; using (var dialog = new PluginDialog(plugin)) { dialog.VerticalOffset = 0; if (dialog.ShowDialog(this) == DialogResult.OK) { var edited = dialog.Plugin; plugin.Name = edited.Name; plugin.OriginalName = edited.OriginalName; plugin.Command = edited.Command; plugin.Arguments = edited.Arguments; plugin.CreateNewPage = edited.CreateNewPage; plugin.AsChildPage = edited.AsChildPage; plugin.PageName = edited.PageName; plugins.ResetItem(rowIndex); } } }