コード例 #1
0
 private void debugmenu_resetconfigButton_Click(object sender, RoutedEventArgs e)
 {
     ResetSettingsWindow wnd = new ResetSettingsWindow(true);
     wnd.Owner = this; wnd.ShowDialog();
 }
コード例 #2
0
        private void window_Loaded(object sender, RoutedEventArgs e)
        {
            // Reset configuration
            if (Keyboard.IsKeyDown(Key.LeftCtrl))
                if (Keyboard.IsKeyDown(Key.LeftShift))
                {
                    ResetSettingsWindow wnd = new ResetSettingsWindow(true);
                    wnd.Owner = this; webcamimagePage.Visibility = Visibility.Collapsed; wnd.Show();
                    wnd.Closed += (s, ev) => { SwitchToPage(0); }; // in the case of canceling the window
                }

            #region :)
            if (DateTime.Now.Month == 10 && DateTime.Now.Day == 12)
            {
                if (Properties.Settings.Default.birthday_notice == false)
                {
                    webcamimagePage.Visibility = Visibility.Collapsed;
                    TextMessageDialog("Let's sing Happy birthday!",
                        "Today's the birthday of Felix, the creator of Webcam Viewer.\nHappy birthday, myself! :D");
                    SetTitlebarColor(Color.FromRgb(0, 103, 179)); // blue's my favorite
                    SwitchToPage(0);

                    Properties.Settings.Default.birthday_notice = true; Properties.Settings.Default.Save(); // notify only once
                }
            }
            else
            {
                Properties.Settings.Default.birthday_notice = false; Properties.Settings.Default.Save();
            }
            #endregion

            GetUserCameras();

            GetUserSettings();

            if (SystemParameters.PrimaryScreenWidth == 800 && SystemParameters.PrimaryScreenHeight == 600)
            {
                this.Width = 640;
                this.Height = 560;
            }

            if (SystemParameters.PrimaryScreenWidth <= 640 && SystemParameters.PrimaryScreenHeight <= 480)
            {
                TextMessageDialog("Low screen resolution", "Your resolution is lower than the minimum requirement 800x600.\nPlease increase your resolution for the best experience.", true);
                this.Width = 320;
                this.Height = 320;
            }

            SetAeroBorder();

            CenterWindowOnScreen();

            int countOfInfoButtonInformations = 0;

            // disable stuff
            if (READONLY_MODE)
            {
                webcamPage_savePanel.Visibility = Visibility.Collapsed;
                webcamPage_menu_infoandactionsGrid.Height -= 37;

                infoButton.Visibility = Visibility.Visible;
            }
            if (DISABLE_ARCHIVEORG)
            {
                webcamPage_saveimageonarchiveButton.Visibility = Visibility.Collapsed;
                webcamPage_saveallButton.Visibility = Visibility.Collapsed;

                infoButton.Visibility = Visibility.Visible;
            }
            if (DISABLE_LOCALSAVE)
            {
                webcamPage_saveimageButton.Visibility = Visibility.Collapsed;
                webcamPage_saveallButton.Visibility = Visibility.Collapsed;

                infoButton.Visibility = Visibility.Visible;
            }
            if (DISABLE_WEBCAMEDITOR)
            {
                settingsPage_MainPage_WebcamEditorButton.Visibility = Visibility.Collapsed;

                infoButton.Visibility = Visibility.Visible;
            }

            if (READONLY_MODE || DISABLE_ARCHIVEORG || DISABLE_LOCALSAVE || DISABLE_WEBCAMEDITOR)
            {
                countOfInfoButtonInformations++;
            }

            // Default configuration file heartbeat
            if (Properties.Settings.Default.defaultconfig_heartbeat)
            {
                if (Configuration.DefaultConfig_Heartbeat())
                {
                    HEARTBEAT_CONFIGCHANGED = true;
                    infoButton.Visibility = Visibility.Visible;

                    countOfInfoButtonInformations++;
                }
                else
                {
                    HEARTBEAT_CONFIGCHANGED = false;
                    infoButton.Visibility = Visibility.Collapsed;

                    countOfInfoButtonInformations--;
                }
            }

            // infoButton Tooltip
            if (countOfInfoButtonInformations > 0)
            {
                infoButton.ToolTip = String.Format("You have {0} notifications...", countOfInfoButtonInformations);
            }
            else
            {
                infoButton.ToolTip = null;
            }


            if (UI_SETTINGSPAGE_THEME == 1)
            {
                this.Resources["res_SettingsPageBackground"] = new SolidColorBrush(Color.FromRgb(45, 45, 45));
                this.Resources["res_SettingsPageTextForeground"] = new SolidColorBrush(Colors.White);
                this.Resources["res_SettingsPageTextForeground_Secondary"] = new SolidColorBrush(Colors.LightGray);
            }


        }
コード例 #3
0
        private void settingsPage_WebcamEditorPage_ActionBar_resetconfigurationButton_Click(object sender, RoutedEventArgs e)
        {
            ResetSettingsWindow dialog = new ResetSettingsWindow();

            settingsPage_dimGrid.Opacity = 0;
            settingsPage_dimGrid.Visibility = Visibility.Visible;
            DoubleAnimation dimanim = new DoubleAnimation(1.0, new TimeSpan(0, 0, 0, 0, 500));
            settingsPage_dimGrid.BeginAnimation(Grid.OpacityProperty, dimanim);

            dialog.Owner = this; dialog.ShowDialog();

            DoubleAnimation dimanim_out = new DoubleAnimation(0, new TimeSpan(0, 0, 0, 0, 500));
            settingsPage_dimGrid.BeginAnimation(Grid.OpacityProperty, dimanim_out);
            DispatcherTimer dimanim_out_timer = new DispatcherTimer();
            dimanim_out_timer.Interval = new TimeSpan(0, 0, 0, 0, 500);
            dimanim_out_timer.Tick += (s, ev) => { dimanim_out_timer.Stop(); settingsPage_dimGrid.Visibility = Visibility.Collapsed; };
            dimanim_out_timer.Start();
        }