示例#1
0
        private void Save()
        {
            //Startup
            Aoba.Settings.RunAtStart = (RunOnStartup.IsChecked == null) ? false : (bool)RunOnStartup.IsChecked;
            //After Load
            Aoba.Settings.CopyLink = (CopyLink.IsChecked == null) ? false : (bool)CopyLink.IsChecked;
            Aoba.Settings.OpenLink = (OpenLink.IsChecked == null) ? false : (bool)OpenLink.IsChecked;
            //Toasts
            Aoba.Settings.ShowToasts   = (ToastAll.IsChecked == null) ? false : (bool)ToastAll.IsChecked;
            Aoba.Settings.ToastCapture = (ToastCapture.IsChecked == null) ? false : (bool)ToastCapture.IsChecked;
            Aoba.Settings.ToastSucess  = (ToastSuccess.IsChecked == null) ? false : (bool)ToastSuccess.IsChecked;
            Aoba.Settings.ToastFailed  = (ToastFailed.IsChecked == null) ? false : (bool)ToastFailed.IsChecked;
            //Sounds
            Aoba.Settings.PlaySounds   = (SoundAll.IsChecked == null) ? false : (bool)SoundAll.IsChecked;
            Aoba.Settings.SoundCapure  = (SoundCapture.IsChecked == null) ? false : (bool)SoundCapture.IsChecked;
            Aoba.Settings.SoundSuccess = (SoundSuccess.IsChecked == null) ? false : (bool)SoundSuccess.IsChecked;
            Aoba.Settings.SoundFailed  = (SoundFailed.IsChecked == null) ? false : (bool)SoundFailed.IsChecked;
            //Image Format
            Aoba.Settings.Format = (ImageFormat.SelectedIndex == 0) ? System.Drawing.Imaging.ImageFormat.Png : System.Drawing.Imaging.ImageFormat.Jpeg;
            //Save Copy
            Aoba.Settings.SaveCopy     = (SaveCopy.IsChecked == null) ? false : (bool)SaveCopy.IsChecked;
            Aoba.Settings.SaveLocation = SaveLocation.Text;
            //Fullscreen Capture Mode
            Aoba.Settings.FullscreenCapture = (DataStore.FullscreenCaptureMode)FullscreenCaputue.SelectedIndex;
            //Tray
            Aoba.Settings.CloseToTray = (CloseToTray.IsChecked == null) ? false : (bool)CloseToTray.IsChecked;
            Aoba.Settings.StartInTray = (StartInTray.IsChecked == null) ? false : (bool)StartInTray.IsChecked;
            //In-Game
            Aoba.Settings.ShowFPS     = (ShowFPS.IsChecked == null) ? false : (bool)ShowFPS.IsChecked;
            Aoba.Settings.GameCapture = (GameCapture.IsChecked == null) ? false : (bool)GameCapture.IsChecked;
            //Misc
            Aoba.Settings.AutoUploadFromClipboard = (ClipboardAutoUpload.IsChecked == null) ? false : (bool)ClipboardAutoUpload.IsChecked;

            Aoba.Save();
        }
示例#2
0
        public MainWindow()
        {
            InitializeComponent();
            Aoba.Init();
            //Start in Tray
            if (Aoba.Settings.StartInTray)
            {
                Hide();
            }
            if (!Aoba.Settings.HasAuth)
            {
                User.Focus();
            }
            //Set Values
            Load();
            //Tray Icon

            var pauseItem = new System.Windows.Forms.MenuItem("Pause");

            pauseItem.Click += (_, e) =>
            {
                Aoba.IsListening = !Aoba.IsListening;
                pauseItem.Text   = (Aoba.IsListening) ? "Pause" : "Unpause";
                Aoba.Notify($"Key Listening {pauseItem.Text}ed");
            };

            _contextMenu = new System.Windows.Forms.ContextMenu(new System.Windows.Forms.MenuItem[]
            {
                new System.Windows.Forms.MenuItem("Settings", RestoreWindow),
                pauseItem,
                new System.Windows.Forms.MenuItem("Quit", (o, e) =>
                {
                    willExit = true;
                    Aoba.Save();
                    Close();
                })
            });
            Aoba.TrayIcon.ContextMenu  = _contextMenu;
            Aoba.TrayIcon.DoubleClick += RestoreWindow;

            ClipboardUpdate += MainWindow_ClipboardUpdate;
        }