Exemple #1
0
        /// <summary>
        /// Unlock the window and make it return to normal.
        /// </summary>
        private void UnlockWindow()
        {
            isLocked = false;
            notifyIcon.ContextMenu.MenuItems[0].Text = "Lock";

            WindowUtility.SetWindowNormal(this, extendedStyle);

            clockWidget.Background       = new SolidColorBrush(Color.FromArgb(1, 255, 255, 255));
            this.PanelBorder.BorderBrush = new SolidColorBrush(Color.FromArgb(255, 255, 0, 0));
        }
Exemple #2
0
        /// <summary>
        /// Lock the window and make it transparent.
        /// </summary>
        private void LockWindow()
        {
            isLocked = true;
            notifyIcon.ContextMenu.MenuItems[0].Text = "Unlock";

            WindowUtility.SetWindowTransparent(this, extendedStyle);

            clockWidget.Background       = new SolidColorBrush(Color.FromArgb(0, 255, 255, 255));
            this.PanelBorder.BorderBrush = Brushes.Transparent;
        }
Exemple #3
0
        private void Widget_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (!isLocked && e.LeftButton == MouseButtonState.Pressed)
            {
                var element = sender as UIElement;

                WindowUtility.SendWindowToBack(this);

                moveFrom = e.GetPosition(element);
                Mouse.Capture(element);

                isMoving = true;
            }
        }
Exemple #4
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            extendedStyle = WindowUtility.GetExtendedStyle(this);

            isLocked = FileIO.LoadWindowLock();

            if (isLocked)
            {
                LockWindow();
            }
            else
            {
                UnlockWindow();
            }
        }
Exemple #5
0
        private void Menu_EditWidget(object sender, RoutedEventArgs e)
        {
            var item = sender as MenuItem;

            if (item != null)
            {
                var menu = item.Parent as ContextMenu;

                if (menu != null)
                {
                    var clock = menu.PlacementTarget as Clock;

                    if (clock != null)
                    {
                        new EditClock(this, clock).Show();
                    }
                }
            }

            WindowUtility.SendWindowToBack(this);
        }
Exemple #6
0
 private void Window_ContentRendered(object sender, EventArgs e)
 {
     WindowUtility.SendWindowToBack(this);
 }
Exemple #7
0
 private void Window_MouseDown(object sender, MouseButtonEventArgs e)
 {
     WindowUtility.SendWindowToBack(this);
 }