コード例 #1
0
 /// <summary>
 /// Hides WelcomeArrow if it is available
 /// </summary>
 private void KillArrow()
 {
     if (_arrow == null)
     {
         return;
     }
     _arrow.Close();
     _arrow = null;
 }
コード例 #2
0
        /// <summary>
        /// Handles event that occurs when ButtonStack instance was generated. This happens on startup,
        /// so is a part of initialization of MainWindow.
        /// Changes cursor and shows welcome arrow if required.
        /// </summary>
        void BtnStckInstanciated(object sender, EventArgs e)
        {
            Analytics.PostEvent(Analytics.Category.Runtime, "Start", null, 1);
            BtnStck.Instance.RunCalled += ShowRunDialog;
            b1.Cursor = System.Windows.Input.Cursors.Hand;
            if (!Settings.Default.FirstRunDone)
            {
                Settings.Default.FirstRunDone = true;
                Settings.Default.Save();

                _arrow = new WelcomeArrow();
                _arrow.Show();
                var p1 = PointToScreen(new Point(0, 0));//where the main button is actually located
                GetSetWndPosition(_arrow, new API.POINT {
                    X = (int)p1.X, Y = (int)p1.Y
                }, false);
                var p2           = new Point(_arrow.Left + _arrow.Width / 2, _arrow.Top + _arrow.Height / 2);
                var initialAngle = p1.X < p2.X ? 135 : 45;
                _arrow.Rotation = p1.Y < p2.Y ? -initialAngle : initialAngle;
            }
        }
コード例 #3
0
ファイル: MainWindow.xaml.cs プロジェクト: beavis28/power8
 /// <summary>
 /// Hides WelcomeArrow if it is available
 /// </summary>
 private void KillArrow()
 {
     if (_arrow == null)
         return;
     _arrow.Close();
     _arrow = null;
 }
コード例 #4
0
ファイル: MainWindow.xaml.cs プロジェクト: beavis28/power8
        /// <summary>
        /// Handles event that occurs when ButtonStack instance was generated. This happens on startup,
        /// so is a part of initialization of MainWindow. 
        /// Changes cursor and shows welcome arrow if required.
        /// </summary>
        void BtnStckInstanciated(object sender, EventArgs e)
        {
            Analytics.PostEvent(Analytics.Category.Runtime, "Start", null, 1);
            BtnStck.Instance.RunCalled += ShowRunDialog;
            b1.Cursor = System.Windows.Input.Cursors.Hand;
            if (!Settings.Default.FirstRunDone)
            {
                Settings.Default.FirstRunDone = true;
                Settings.Default.Save();

                _arrow = new WelcomeArrow();
                _arrow.Show();
                var p1 = PointToScreen(new Point(0, 0));//where the main button is actually located
                GetSetWndPosition(_arrow, new API.POINT { X = (int)p1.X, Y = (int)p1.Y }, false);
                var p2 = new Point(_arrow.Left + _arrow.Width / 2, _arrow.Top + _arrow.Height / 2);
                var initialAngle = p1.X < p2.X ? 135 : 45;
                _arrow.Rotation = p1.Y < p2.Y ? -initialAngle : initialAngle;
            }
        }