Exemple #1
0
        public NewToApplicationWindow(IApplicationHotkeyService hotkeyService, IAppSettingService settingService, IActionService actionService)
        {
            InitializeComponent();

            this.Title = "New to RecNForget?";

            if (DesignerProperties.GetIsInDesignMode(this))
            {
                this.hotkeyService = new DesignerApplicationHotkeyService();
                this.actionService = new DesignerActionService();
                SettingService     = new DesignerAppSettingService();
                return;
            }
            else
            {
                // ToDo: Evil Hack to have the cake (see actual design in design mode) and eat it too (have different styles at runtime)
                this.Resources = null;

                this.hotkeyService = hotkeyService;
                SettingService     = settingService;
                this.actionService = actionService;

                this.KeyDown += Window_KeyDown;
            }
        }
Exemple #2
0
        public SettingsWindow(IApplicationHotkeyService hotkeyService, IAppSettingService settingService)
        {
            InitializeComponent();

            if (DesignerProperties.GetIsInDesignMode(this))
            {
                this.hotkeyService = new DesignerApplicationHotkeyService();
                SettingService     = new DesignerAppSettingService();
            }
            else
            {
                // ToDo: Evil Hack to have the cake (see actual design in design mode) and eat it too (have different styles at runtime)
                this.Resources     = null;
                this.hotkeyService = hotkeyService;
                SettingService     = settingService;
            }
        }
Exemple #3
0
        public NewToVersionDialog(Version lastInstalledVersion, Version currentVersion, IAppSettingService settingService)
        {
            InitializeComponent();
            DataContext = this;

            this.Title = "Things changed since we last met";

            if (DesignerProperties.GetIsInDesignMode(this))
            {
                SettingService = new DesignerAppSettingService();
            }
            else
            {
                // ToDo: Evil Hack to have the cake (see actual design in design mode) and eat it too (have different styles at runtime)
                this.Resources = null;

                SettingService = settingService;

                this.KeyDown += Window_KeyDown;

                var featuresSinceLastVersion         = HelpFeature.All.Where(f => f.MinVersion != null && f.MinVersion.CompareTo(lastInstalledVersion) > 0).OrderBy(f => f.Priority);
                var disabledFeaturesSinceLastVersion = featuresSinceLastVersion.Where(f => f.MaxVersion != null && f.MaxVersion.CompareTo(currentVersion) < 0);
                var addedFeaturesSinceLastVersion    = featuresSinceLastVersion.Except(disabledFeaturesSinceLastVersion);

                // we dont show disabled features in this dialog
                // major feature changes are communicated by Information feature class
                this.verboseInformationFeatures = addedFeaturesSinceLastVersion.Where(f => f.FeatureClass == HelpFeatureClass.Information);
                this.addedFeatures = addedFeaturesSinceLastVersion.Where(f => f.FeatureClass == HelpFeatureClass.NewFeature);
                this.bugFixes      = addedFeaturesSinceLastVersion.Where(f => f.FeatureClass == HelpFeatureClass.BugFix);

                foreach (var feature in verboseInformationFeatures)
                {
                    AddFeatureToDisplayList(feature, VersionInfoFeatureList);
                }

                foreach (var feature in bugFixes)
                {
                    AddFeatureToDisplayList(feature, VersionInfoFeatureList);
                }

                foreach (var feature in addedFeatures)
                {
                    AddFeatureToDisplayList(feature, VersionInfoFeatureList);
                }
            }
        }
Exemple #4
0
        public RecordingTimerControl()
        {
            InitializeComponent();

            if (DesignerProperties.GetIsInDesignMode(this))
            {
                ActionService         = new DesignerActionService();
                SettingService        = new DesignerAppSettingService();
                AudioRecordingService = new DesignerAudioRecordingService();

                return;
            }
            else
            {
                // ToDo: Evil Hack to have the cake (see actual design in design mode) and eat it too (have different styles at runtime)
                this.Resources = null;

                ActionService         = UnityHandler.UnityContainer.Resolve <IActionService>();
                SettingService        = UnityHandler.UnityContainer.Resolve <IAppSettingService>();
                AudioRecordingService = UnityHandler.UnityContainer.Resolve <IAudioRecordingService>();
            }
        }
Exemple #5
0
        public QuickTipDialog(IAppSettingService settingService, HelpFeature randomFeature)
        {
            DataContext = this;
            InitializeComponent();

            this.Title = "Did you know?";

            if (DesignerProperties.GetIsInDesignMode(this))
            {
                SettingService = new DesignerAppSettingService();
            }
            else
            {
                // ToDo: Evil Hack to have the cake (see actual design in design mode) and eat it too (have different styles at runtime)
                this.Resources = null;

                SettingService = settingService;

                this.KeyDown += Window_KeyDown;
            }

            SetContents(randomFeature);
        }
Exemple #6
0
        public MainWindow()
        {
            DataContext = this;
            InitializeComponent();


            if (DesignerProperties.GetIsInDesignMode(this))
            {
                this.actionService    = new DesignerActionService();
                this.hotkeyService    = new DesignerApplicationHotkeyService();
                SelectedFileService   = new DesignerSelectedFileService();
                SettingService        = new DesignerAppSettingService();
                AudioRecordingService = new DesignerAudioRecordingService();
                AudioPlaybackService  = new DesignerAudioPlaybackService();
                return;
            }
            else
            {
                // ToDo: Evil Hack to have the cake (see actual design in design mode) and eat it too (have different styles at runtime)
                this.Resources = null;

                this.actionService = UnityHandler.UnityContainer.Resolve <IActionService>();
                //actionService.ChangeTheme("Simple_Black");
                //this.InvalidateVisual();


                this.hotkeyService = UnityHandler.UnityContainer.Resolve <IApplicationHotkeyService>();

                SelectedFileService = UnityHandler.UnityContainer.Resolve <ISelectedFileService>();

                SettingService = UnityHandler.UnityContainer.Resolve <IAppSettingService>();
                SettingService.PropertyChanged += SettingService_PropertyChanged;

                AudioRecordingService = UnityHandler.UnityContainer.Resolve <IAudioRecordingService>();
                AudioRecordingService.PropertyChanged += AudioRecordingService_PropertyChanged;

                AudioPlaybackService = UnityHandler.UnityContainer.Resolve <IAudioPlaybackService>();
                AudioPlaybackService.PropertyChanged += AudioPlaybackService_PropertyChanged;

                // try restore last window positon
                if (!SettingService.MainWindowLeftX.HasValue || !SettingService.MainWindowTopY.HasValue)
                {
                    this.Left = (SystemParameters.PrimaryScreenWidth / 2) - (this.Width / 2);
                    this.Top  = (SystemParameters.PrimaryScreenHeight / 2) - (this.Height / 2);
                }
                else
                {
                    this.Left = SettingService.MainWindowLeftX.Value;
                    this.Top  = SettingService.MainWindowTopY.Value;
                }

                this.KeyDown            += Window_KeyDown;
                this.MouseRightButtonUp += MainWindow_MouseRightButtonUp;

                trayIcon = new System.Windows.Forms.NotifyIcon
                {
                    Icon    = System.Drawing.Icon.ExtractAssociatedIcon(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName),
                    Visible = true
                };

                trayIcon.Click       += new EventHandler(TrayIcon_Click);
                trayIcon.DoubleClick += new EventHandler(TrayIconMenu_DoubleClick);

                // initialize control visibility (is being toggled via SettingService_PropertyChanged - binding with bool to visibility converter did not update)
                OutputPathControl.Visibility           = SettingService.OutputPathControlVisible ? Visibility.Visible : Visibility.Collapsed;
                OutputPathControlSpacer.Visibility     = SettingService.OutputPathControlVisible ? Visibility.Visible : Visibility.Collapsed;
                SelectedFileControl.Visibility         = SettingService.SelectedFileControlVisible ? Visibility.Visible : Visibility.Collapsed;
                SelectedFileControlSpacer.Visibility   = SettingService.SelectedFileControlVisible ? Visibility.Visible : Visibility.Collapsed;
                RecordingTimerControl.Visibility       = SettingService.RecordingTimerControlVisible ? Visibility.Visible : Visibility.Collapsed;
                RecordingTimerControlSpacer.Visibility = SettingService.RecordingTimerControlVisible ? Visibility.Visible : Visibility.Collapsed;

                this.Topmost = SettingService.WindowAlwaysOnTop;


                // hacky way to have a window for NotificationManager
                // is this really needed? (window is loaded into memory even if running in background)
                this.Show();
                if (SettingService.MinimizedToTray)
                {
                    SwitchToBackgroundMode();
                }


                SelectedFileService.SelectLatestFile();
                //else
                //{
                //    SwitchToForegroundMode();
                //}
            }
        }