/// <summary> /// Creates a new instance of <see cref="OpenOptionsDialogCommand"/> /// </summary> /// <param name="optionsDialogFactory">Factory to get an instance of an <see cref="OptionDialog"/>.</param> /// <param name="dialogHostFactory">Factory to get an instance of an <see cref="DialogHostBase"/>.</param> public OpenOptionsDialogCommand( Func <OptionDialog> optionsDialogFactory, Func <DialogHostBase> dialogHostFactory) { _optionsDialog = optionsDialogFactory(); _dialogHost = dialogHostFactory(); }
public CommandResult ShowOptionDialog() { OptionDialog dlg = new OptionDialog(); GCUtil.ShowModalDialog(_frame, dlg); return(CommandResult.Success); }
public static CommandResult OpenOptionDialog(ICommandTarget target) { IPoderosaMainWindow window = CommandTargetUtil.AsWindow(target); OptionDialog dlg = new OptionDialog(); if (dlg.ShowDialog(window.AsForm()) == DialogResult.OK) { return(CommandResult.Succeeded); } else { return(CommandResult.Cancelled); } }
private void OpenOptionDialog() { OptionDialog dialog = new OptionDialog { Owner = Application.Current.MainWindow, DataContext = OptionsViewModel }; bool?dialogResult = dialog.ShowDialog(); if (dialogResult.HasValue && dialogResult.Value) { OptionsViewModel.Save(CurrentProfile.Header); } else { OptionsViewModel.CancelDialog(CurrentProfile.Header); } }
protected override void Dispose(bool disposing) { if (disposing) { Scene = null; User = null; MoveTime = 0; AttackTime = 0; NextRunTime = 0; CanMove = false; CanRun = false; MapControl = null; MainDialog = null; ChatDialog = null; ChatControl = null; InventoryDialog = null; CharacterDialog = null; StorageDialog = null; BeltDialog = null; MiniMapDialog = null; InspectDialog = null; OptionDialog = null; MenuDialog = null; NPCDialog = null; QuestDetailDialog = null; QuestListDialog = null; QuestLogDialog = null; QuestTrackingDialog = null; GameShopDialog = null; MentorDialog = null; RelationshipDialog = null; CharacterDuraPanel = null; DuraStatusPanel = null; HoverItem = null; SelectedCell = null; PickedUpGold = false; UseItemTime = 0; PickUpTime = 0; InspectTime = 0; DisposeItemLabel(); AMode = 0; PMode = 0; Lights = 0; NPCTime = 0; NPCID = 0; DefaultNPCID = 0; for (int i = 0; i < OutputLines.Length; i++) if (OutputLines[i] != null && OutputLines[i].IsDisposed) OutputLines[i].Dispose(); OutputMessages.Clear(); OutputMessages = null; } base.Dispose(disposing); }
public GameScene() { MapControl.AutoRun = false; MapControl.AutoHit = false; Slaying = false; Thrusting = false; HalfMoon = false; CrossHalfMoon = false; DoubleSlash = false; TwinDrakeBlade = false; FlamingSword = false; GroupDialog.GroupList.Clear(); Scene = this; BackColour = Color.Transparent; MoveTime = CMain.Time; KeyDown += GameScene_KeyDown; MainDialog = new MainDialog { Parent = this }; ChatDialog = new ChatDialog { Parent = this }; ChatControl = new ChatControlBar { Parent = this }; InventoryDialog = new InventoryDialog { Parent = this }; CharacterDialog = new CharacterDialog { Parent = this, Visible = false }; BeltDialog = new BeltDialog { Parent = this }; StorageDialog = new StorageDialog { Parent = this, Visible = false }; MiniMapDialog = new MiniMapDialog { Parent = this }; InspectDialog = new InspectDialog { Parent = this, Visible = false }; OptionDialog = new OptionDialog { Parent = this, Visible = false }; MenuDialog = new MenuDialog { Parent = this, Visible = false }; NPCDialog = new NPCDialog { Parent = this, Visible = false }; NPCGoodsDialog = new NPCGoodsDialog { Parent = this, Visible = false }; NPCDropDialog = new NPCDropDialog { Parent = this, Visible = false }; NPCAwakeDialog = new NPCAwakeDialog { Parent = this, Visible = false }; HelpDialog = new HelpDialog { Parent = this, Visible = false }; MountDialog = new MountDialog { Parent = this, Visible = false }; FishingDialog = new FishingDialog { Parent = this, Visible = false }; FishingStatusDialog = new FishingStatusDialog { Parent = this, Visible = false }; GroupDialog = new GroupDialog { Parent = this, Visible = false }; GuildDialog = new GuildDialog { Parent = this, Visible = false }; GuildBuffDialog = new GuildBuffDialog { Parent = this, Visible = false }; BigMapDialog = new BigMapDialog { Parent = this, Visible = false }; TrustMerchantDialog = new TrustMerchantDialog { Parent = this, Visible = false }; CharacterDuraPanel = new CharacterDuraPanel { Parent = this, Visible = false }; DuraStatusPanel = new DuraStatusDialog { Parent = this, Visible = true }; TradeDialog = new TradeDialog { Parent = this, Visible = false }; GuestTradeDialog = new GuestTradeDialog { Parent = this, Visible = false }; SkillBarDialog = new SkillBarDialog { Parent = this, Visible = false }; ChatOptionDialog = new ChatOptionDialog { Parent = this, Visible = false }; ChatNoticeDialog = new ChatNoticeDialog { Parent = this, Visible = false }; QuestListDialog = new QuestListDialog { Parent = this, Visible = false }; QuestDetailDialog = new QuestDetailDialog {Parent = this, Visible = false}; QuestTrackingDialog = new QuestTrackingDialog { Parent = this, Visible = false }; QuestLogDialog = new QuestDiaryDialog {Parent = this, Visible = false}; RankingDialog = new RankingDialog { Parent = this, Visible = false }; MailListDialog = new MailListDialog { Parent = this, Visible = false }; MailComposeLetterDialog = new MailComposeLetterDialog { Parent = this, Visible = false }; MailComposeParcelDialog = new MailComposeParcelDialog { Parent = this, Visible = false }; MailReadLetterDialog = new MailReadLetterDialog { Parent = this, Visible = false }; MailReadParcelDialog = new MailReadParcelDialog { Parent = this, Visible = false }; IntelligentCreatureDialog = new IntelligentCreatureDialog { Parent = this, Visible = false };//IntelligentCreature IntelligentCreatureOptionsDialog = new IntelligentCreatureOptionsDialog { Parent = this, Visible = false };//IntelligentCreature IntelligentCreatureOptionsGradeDialog = new IntelligentCreatureOptionsGradeDialog { Parent = this, Visible = false };//IntelligentCreature RefineDialog = new RefineDialog { Parent = this, Visible = false }; RelationshipDialog = new RelationshipDialog { Parent = this, Visible = false }; FriendDialog = new FriendDialog { Parent = this, Visible = false }; MemoDialog = new MemoDialog { Parent = this, Visible = false }; MentorDialog = new MentorDialog { Parent = this, Visible = false }; GameShopDialog = new GameShopDialog { Parent = this, Visible = false }; //not added yet KeyboardLayoutDialog = new KeyboardLayoutDialog { Parent = this, Visible = false }; for (int i = 0; i < OutputLines.Length; i++) OutputLines[i] = new MirLabel { AutoSize = true, BackColour = Color.Transparent, Font = new Font(Settings.FontName, 10F), ForeColour = Color.LimeGreen, Location = new Point(20, 25 + i * 13), OutLine = true, }; }
private void optionsToolStripMenuItem_Click(object sender, EventArgs e) { OptionDialog options = new OptionDialog(); options.ShowDialog(); }
private void panelControl1_DoubleClick(object sender, EventArgs e) { OptionDialog d = new OptionDialog(TemplateGroup.Default); d.ShowModalDialog(); }
/// <summary> /// Removes backlink to any linked <see cref="OptionDialog"/> /// </summary> public void DetachFromDialog() { _dialog = null; }
/// <summary> /// Creates backlink to the given <see cref="OptionDialog"/> /// </summary> /// <param name="dialog">Dialog to attach this option to</param> public void AttachToDialog(OptionDialog dialog) { _dialog = dialog; }