Example #1
0
        public void Dispose()
        {
            if (this.client != null)
            {
                this.client.Dispose();
                this.client = null;
            }

            GC.SuppressFinalize(this);
        }
Example #2
0
        public void Dispose()
        {
            if (this.client != null)
            {
                this.client.Dispose();
                this.client = null;
            }

            GC.SuppressFinalize(this);
        }
        public SelectConfigWindow(FanControlClient client)
            : this()
        {
            this.client = client;

            if ((!string.IsNullOrWhiteSpace(client.ViewModel.SelectedConfig) &&
                 configManager.SelectConfig(client.ViewModel.SelectedConfig)) ||
                (configManager.SelectConfig(GetNotebookModel())))
            {
                this.configSelector.SelectedValue = configManager.SelectedConfigName;
            }
        }
Example #4
0
        public SelectConfigWindow(FanControlClient client)
            : this()
        {
            this.client = client;

            if ((!string.IsNullOrWhiteSpace(client.ViewModel.SelectedConfig)
                && configManager.SelectConfig(client.ViewModel.SelectedConfig))
                || (configManager.SelectConfig(GetNotebookModel())))
            {
                this.configSelector.SelectedValue = configManager.SelectedConfigName;
            }
        }
Example #5
0
        public MainWindow()
        {
            ProcessCommandLineArgs();
            InitializeComponent();

            Application.Current.SessionEnding += Current_SessionEnding;

            this.renderer       = new TrayIconRenderer();
            this.renderer.Color = Settings.Default.TrayIconForegroundColor;

            this.saveSizeTimer          = new DispatcherTimer();
            this.saveSizeTimer.Interval = TimeSpan.FromSeconds(SaveWindowSizeDelay);
            this.saveSizeTimer.Tick    += saveSizeTimer_Tick;

            this.viewModel             = new MainWindowViewModel();
            viewModel.PropertyChanged += viewModel_PropertyChanged;

            this.client      = new FanControlClient(viewModel, UpdateInterval);
            this.DataContext = viewModel;
            client.UpdateViewModel();

            this.Height       = Settings.Default.WindowHeight;
            this.Width        = Settings.Default.WindowWidth;
            this.SizeChanged += MainWindow_SizeChanged;

            var wbcd = new DateTime(DateTime.Now.Year, 5, 28);

            if ((DateTime.Today > wbcd.Subtract(new TimeSpan(14, 0, 0, 0))) &&
                (DateTime.Today <= wbcd))
            {
                this.wbcd.Visibility = System.Windows.Visibility.Visible;
            }
            else
            {
                this.wbcd.Visibility = System.Windows.Visibility.Collapsed;
            }
        }
Example #6
0
        public MainWindow()
        {
            ProcessCommandLineArgs();
            InitializeComponent();

            Application.Current.SessionEnding += Current_SessionEnding;

            this.renderer = new TrayIconRenderer();
            this.renderer.Color = Settings.Default.TrayIconForegroundColor;

            this.saveSizeTimer = new DispatcherTimer();
            this.saveSizeTimer.Interval = TimeSpan.FromSeconds(SaveWindowSizeDelay);
            this.saveSizeTimer.Tick += saveSizeTimer_Tick;

            this.viewModel = new MainWindowViewModel();
            viewModel.PropertyChanged += viewModel_PropertyChanged;

            this.client = new FanControlClient(viewModel, UpdateInterval);
            this.DataContext = viewModel;
            client.UpdateViewModel();

            this.Height = Settings.Default.WindowHeight;
            this.Width = Settings.Default.WindowWidth;
            this.SizeChanged += MainWindow_SizeChanged;

            var wbcd = new DateTime(DateTime.Now.Year, 5, 28);

            if ((DateTime.Today > wbcd.Subtract(new TimeSpan(14, 0, 0, 0)))
                && (DateTime.Today <= wbcd))
            {
                this.wbcd.Visibility = System.Windows.Visibility.Visible;
            }
            else
            {
                this.wbcd.Visibility = System.Windows.Visibility.Collapsed;
            }
        }
 public FanControllerViewModel(FanControlClient client, int fanIndex)
     : this()
 {
     this.client   = client;
     this.fanIndex = fanIndex;
 }
Example #8
0
 public FanControllerViewModel(FanControlClient client, int fanIndex)
     : this()
 {
     this.client = client;
     this.fanIndex = fanIndex;
 }