コード例 #1
0
 /// <summary>
 /// </summary>
 /// <param name="mainWindow"></param>
 /// <param name="ni"></param>
 /// <param name="activeDevices"></param>
 /// <param name="rotateDisplay"></param>
 /// <param name="rotateButtonAndCanvas"></param>
 /// <exception cref="ArgumentNullException">
 ///     <paramref name="mainWindow" /> is <see langword="null" />.
 ///     <paramref name="ni" /> is <see langword="null" />.
 ///     <paramref name="activeDevices" /> is <see langword="null" />.
 ///     <paramref name="rotateDisplay" /> is <see langword="null" />.
 ///     <paramref name="rotateButtonAndCanvas" /> is <see langword="null" />.
 /// </exception>
 public ApplicationSettings(MainWindow mainWindow, NotifyIcon ni, IActiveDevices activeDevices, IRotateDisplay rotateDisplay, IRotateButtonAndCanvas rotateButtonAndCanvas)
 {
     if (mainWindow == null)
     {
         throw new ArgumentNullException(nameof(mainWindow));
     }
     if (ni == null)
     {
         throw new ArgumentNullException(nameof(ni));
     }
     if (activeDevices == null)
     {
         throw new ArgumentNullException(nameof(activeDevices));
     }
     if (rotateDisplay == null)
     {
         throw new ArgumentNullException(nameof(rotateDisplay));
     }
     if (rotateButtonAndCanvas == null)
     {
         throw new ArgumentNullException(nameof(rotateButtonAndCanvas));
     }
     _mainWindow = mainWindow;
     _ni = ni;
     _activeDevices = activeDevices;
     _rotateDisplay = rotateDisplay;
     _rotateButtonAndCanvas = rotateButtonAndCanvas;
 }
コード例 #2
0
 /// <summary>
 /// </summary>
 /// <param name="mainWindow"></param>
 /// <param name="taskbarIcon"></param>
 /// <param name="activeDevices"></param>
 /// <param name="rotateDisplay"></param>
 /// <param name="rotateButtonAndCanvas"></param>
 /// <exception cref="ArgumentNullException">
 ///     <paramref name="mainWindow" /> is <see langword="null" />.
 ///     <paramref name="taskbarIcon" /> is <see langword="null" />.
 ///     <paramref name="activeDevices" /> is <see langword="null" />.
 ///     <paramref name="rotateDisplay" /> is <see langword="null" />.
 ///     <paramref name="rotateButtonAndCanvas" /> is <see langword="null" />.
 /// </exception>
 public TaskbarIconConfiguration(MainWindow mainWindow, TaskbarIcon taskbarIcon, IActiveDevices activeDevices, IRotateDisplay rotateDisplay,
                                 IRotateButtonAndCanvas rotateButtonAndCanvas)
 {
     _mainWindow            = mainWindow ?? throw new ArgumentNullException(nameof(mainWindow));
     _taskbarIcon           = taskbarIcon ?? throw new ArgumentNullException(nameof(taskbarIcon));
     _activeDevices         = activeDevices ?? throw new ArgumentNullException(nameof(activeDevices));
     _rotateDisplay         = rotateDisplay ?? throw new ArgumentNullException(nameof(rotateDisplay));
     _rotateButtonAndCanvas = rotateButtonAndCanvas ?? throw new ArgumentNullException(nameof(rotateButtonAndCanvas));
 }
コード例 #3
0
 public MainWindow()
 {
     ISettings coreSettings = new CoreSettings();
     InitializeComponent();
     _style = new MetroStyle(this, Accent, ThemeSwitch, coreSettings);
     _style.Load(true);
     var activeDevices = new ActiveDevices();
     _rotateDisplay = new RotateDisplay();
     _rotateButtonAndCanvas = new RotateButtonAndCanvas();
     BuildDeviceButtons(activeDevices);
     var appSettings = new ApplicationSettings(this, new NotifyIcon(), activeDevices, _rotateDisplay, _rotateButtonAndCanvas);
     appSettings.Run();
     var linkerTime = Assembly.GetExecutingAssembly().GetLinkerTime();
     LinkerTime.Content = linkerTime.ToString(CultureInfo.InvariantCulture);
     _overrideProtection = 1;
 }
コード例 #4
0
        public MainWindow()
        {
            InitializeComponent();
            IAppSettingsBase          appSettingsBase          = new AppSettingsBase(Settings.Default);
            IApplicationStyleSettings applicationStyleSettings = new ApplicationStyleSettings(appSettingsBase);
            IThemeManagerHelper       themeManagerHelper       = new ThemeManagerHelper();

            _applicationStyle = new ApplicationStyle(this, Accent, ThemeSwitch, applicationStyleSettings, themeManagerHelper);
            _applicationStyle.Load(true);

            _rotateDisplay         = new RotateDisplay();
            _rotateButtonAndCanvas = new RotateButtonAndCanvas();
            Load();
            var linkerTime = Assembly.GetExecutingAssembly().GetLinkerTime();

            LinkerTime.Content = linkerTime.ToString(CultureInfo.InvariantCulture);

            Application.Current.Exit += CurrentExit;
            _overrideProtection       = 1;
            ConfigureAutoRun();
        }