コード例 #1
0
        public void Dispose()
        {
            if (this.client != null)
            {
                this.client.Dispose();
                this.client = null;
            }

            GC.SuppressFinalize(this);
        }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: binmallow/nbfc
        public void Dispose()
        {
            if (this.client != null)
            {
                this.client.Dispose();
                this.client = null;
            }

            GC.SuppressFinalize(this);
        }
コード例 #3
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;
            }
        }
コード例 #4
0
ファイル: SelectConfigWindow.xaml.cs プロジェクト: qzcw/nbfc
        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;
            }
        }
コード例 #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;
            }
        }
コード例 #6
0
ファイル: MainWindow.xaml.cs プロジェクト: binmallow/nbfc
        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;
            }
        }
コード例 #7
0
 public FanControllerViewModel(FanControlClient client, int fanIndex)
     : this()
 {
     this.client   = client;
     this.fanIndex = fanIndex;
 }
コード例 #8
0
ファイル: FanControllerViewModel.cs プロジェクト: qzcw/nbfc
 public FanControllerViewModel(FanControlClient client, int fanIndex)
     : this()
 {
     this.client = client;
     this.fanIndex = fanIndex;
 }