public CombatWindow() { InitializeComponent(); WindowPositioner.CenterWindowOnScreen(this); ShowHeroImage(); ShowEnemyimage(); foreach (var kvp in StoredCombatants.Hero.Inventory) { ItemBox.Items.Add(kvp.Key.PadRight(10) + "Qty: " + kvp.Value); } foreach (var kvp in StoredCombatants.Hero.Skills) { SkillBox.Items.Add(kvp.Key); } UpdateHPAndMP(); hero_HP_Bar.Maximum = StoredCombatants.Hero.MaxHP; hero_HP_Bar.Minimum = 0; hero_HP_Bar.Value = StoredCombatants.Hero.HP; hero_MP_Bar.Maximum = StoredCombatants.Hero.MaxMP; hero_MP_Bar.Minimum = 0; hero_MP_Bar.Value = StoredCombatants.Hero.MP; enemy_HP_Bar.Maximum = StoredCombatants.Enemy.MaxHP; enemy_HP_Bar.Minimum = 0; enemy_HP_Bar.Value = StoredCombatants.Enemy.HP; enemy_MP_Bar.Maximum = StoredCombatants.Enemy.MaxMP; enemy_MP_Bar.Minimum = 0; enemy_MP_Bar.Value = StoredCombatants.Enemy.MP; }
// Not using "Instance" since this Singleton is more of an action public static void CreateAndShow() { if (_settingsWindow == null || _settingsWindow.IsLoaded == false) { _settingsWindow = new SettingsWindow(); } _settingsWindow.Show(); _settingsWindow.Activate(); WindowPositioner.MoveToMouse(_settingsWindow); }
public static void CreateAndShow() { if (_aboutWindow == null || _aboutWindow.IsLoaded == false) { _aboutWindow = new AboutWindow(); } _aboutWindow.Show(); _aboutWindow.Activate(); WindowPositioner.MoveToMouse(_aboutWindow); }
// Not using "Instance" since this Singleton is more of an action public static void CreateAndShow() { if (_instance == null || _instance.IsLoaded == false) { _instance = new JoinMeetingDialog(); } _instance.Show(); _instance.Activate(); WindowPositioner.MoveToMouse(_instance, leftOffset: 50, topOffset: 50); _instance.GetPinsFromClipboard(); }
public void EditBlock(NavBlock block) { this.Block = block; if (block.Content is TextBlock) { this.Title = ((TextBlock)block.Content).Text + " - Properties"; } else { this.Title = block.Content.ToString() + " - Properties"; } this.ShapePopupColorEdit.Color = block.BackgroundColor; this.TextPopupColorEdit.Color = block.ForegroundColor; WindowPositioner.ShowCenteredToMouse(this); //this.ShowDialog(); }
public CharacterMenu(Combatant hero) { InitializeComponent(); WindowPositioner.CenterWindowOnScreen(this); HP_Bar.Maximum = hero.MaxHP; MP_Bar.Maximum = hero.MaxMP; HP_Bar.Minimum = 0; MP_Bar.Minimum = 0; HP_Bar.Value = hero.HP; MP_Bar.Value = hero.MP; PrintHero(hero); ShowHeroImage(hero); StoredCombatants.Hero = hero; if (CharacterMethods.CharacterCreated == false) { CharacterMethods.InitializeInventoryAndSpells(StoredCombatants.Hero); CharacterMethods.CharacterCreated = true; } }
private bool HandlePreview() { try { // dock screensaver for preview var parentWindowHandle = new IntPtr(((PreviewArgs)startupArgs).ParentWindowHandle); WindowPositioner.DockAsChild(this, parentWindowHandle); return(true); } catch { MessageBox.Show(this, Localization.PreviewMessage, Localization.PreviewCaption, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); return(false); } }
// Not using "Instance" since this Singleton is more of an action public static void CreateAndShow(ChimeMeetingMenuItem meetingStartingNow) { if (_meetingNotificationWindow == null || _meetingNotificationWindow.IsLoaded == false) { _meetingNotificationWindow = new MeetingNotificationWindow(); } _meetingNotificationWindow.CurrentMeetings = (ChimeMeetingMenuItems)(App.TrayIcon.DataContext); _meetingNotificationWindow.ResetAutoHideTimer(); _meetingNotificationWindow.DefaultMeeting = meetingStartingNow; // refresh DataContext since we just set default meeting _meetingNotificationWindow.DataContext = _meetingNotificationWindow; WindowPositioner.MoveToMouse(_meetingNotificationWindow); _meetingNotificationWindow.Show(); _meetingNotificationWindow.Topmost = true; }
private void OnMouseRightClick(object sender, MouseEventArgs e) { this.Timer.Stop(); if (sender is TreeViewItem) { Object tag = ((TreeViewItem)sender).Header; if (tag is Domain.Attribute) { ModelFilterDialog dialog = new ModelFilterDialog(); dialog.Display((Domain.Attribute)tag); dialog.SearchTextBox.Focus(); WindowPositioner.ShowCenteredToMouse(dialog); AttributeValue value = dialog.Selection; if (value != null && Click != null) { Click(value); } e.Handled = true; } } }
public Substring() { InitializeComponent(); WindowPositioner.CenterWindowOnScreen(this); }
public Fibonacci() { InitializeComponent(); WindowPositioner.CenterWindowOnScreen(this); }
public LongestWordAnswer() { InitializeComponent(); WindowPositioner.CenterWindowOnScreen(this); }
public FirstAndLast() { InitializeComponent(); WindowPositioner.CenterWindowOnScreen(this); }
public Person() { InitializeComponent(); WindowPositioner.CenterWindowOnScreen(this); }
public ForestExplore(Combatant hero) { InitializeComponent(); WindowPositioner.CenterWindowOnScreen(this); ShowHeroImage(); }
public HappyBirthdayAnswer() { InitializeComponent(); WindowPositioner.CenterWindowOnScreen(this); }
public ExploreWindow(Combatant hero) { InitializeComponent(); WindowPositioner.CenterWindowOnScreen(this); zoneSelector.Items.Add("Forest"); }
public ConstructorAnswer() { InitializeComponent(); WindowPositioner.CenterWindowOnScreen(this); }
public CountEvens() { InitializeComponent(); WindowPositioner.CenterWindowOnScreen(this); }
public Absolutes() { InitializeComponent(); WindowPositioner.CenterWindowOnScreen(this); }
public ReverseArray() { InitializeComponent(); WindowPositioner.CenterWindowOnScreen(this); }
public ChangeNameAnswer() { InitializeComponent(); WindowPositioner.CenterWindowOnScreen(this); }
public CapitalizeEachWordAnswer() { InitializeComponent(); WindowPositioner.CenterWindowOnScreen(this); }
public FizzBuzzAnswer() { InitializeComponent(); WindowPositioner.CenterWindowOnScreen(this); }