Пример #1
0
        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);
        }
Пример #4
0
        // 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();
        }
Пример #5
0
 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();
 }
Пример #6
0
 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;
     }
 }
Пример #7
0
        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);
            }
        }
Пример #8
0
        // 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;
        }
Пример #9
0
        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;
                }
            }
        }
Пример #10
0
 public Substring()
 {
     InitializeComponent();
     WindowPositioner.CenterWindowOnScreen(this);
 }
Пример #11
0
 public Fibonacci()
 {
     InitializeComponent();
     WindowPositioner.CenterWindowOnScreen(this);
 }
Пример #12
0
 public LongestWordAnswer()
 {
     InitializeComponent();
     WindowPositioner.CenterWindowOnScreen(this);
 }
Пример #13
0
 public FirstAndLast()
 {
     InitializeComponent();
     WindowPositioner.CenterWindowOnScreen(this);
 }
Пример #14
0
 public Person()
 {
     InitializeComponent();
     WindowPositioner.CenterWindowOnScreen(this);
 }
Пример #15
0
 public ForestExplore(Combatant hero)
 {
     InitializeComponent();
     WindowPositioner.CenterWindowOnScreen(this);
     ShowHeroImage();
 }
Пример #16
0
 public HappyBirthdayAnswer()
 {
     InitializeComponent();
     WindowPositioner.CenterWindowOnScreen(this);
 }
Пример #17
0
 public ExploreWindow(Combatant hero)
 {
     InitializeComponent();
     WindowPositioner.CenterWindowOnScreen(this);
     zoneSelector.Items.Add("Forest");
 }
 public ConstructorAnswer()
 {
     InitializeComponent();
     WindowPositioner.CenterWindowOnScreen(this);
 }
Пример #19
0
 public CountEvens()
 {
     InitializeComponent();
     WindowPositioner.CenterWindowOnScreen(this);
 }
Пример #20
0
 public Absolutes()
 {
     InitializeComponent();
     WindowPositioner.CenterWindowOnScreen(this);
 }
Пример #21
0
 public ReverseArray()
 {
     InitializeComponent();
     WindowPositioner.CenterWindowOnScreen(this);
 }
Пример #22
0
 public ChangeNameAnswer()
 {
     InitializeComponent();
     WindowPositioner.CenterWindowOnScreen(this);
 }
Пример #23
0
 public CapitalizeEachWordAnswer()
 {
     InitializeComponent();
     WindowPositioner.CenterWindowOnScreen(this);
 }
Пример #24
0
 public FizzBuzzAnswer()
 {
     InitializeComponent();
     WindowPositioner.CenterWindowOnScreen(this);
 }