public TimelinePage() { InitializeComponent(); this.chart_Line.DataContext = new ProcessStatusViewModel(); dbOperator = DatabaseOperation.Instance; dbOperator.NewRecord_Registered += new EventHandler(this.NewRecord_Registered); dbOperator.Record_Deleted += new EventHandler(this.Record_Deleted); this.listBox_ProcName.DataContext = dbOperator.GetAllData(); }
public OveruseWarning() { InitializeComponent(); dbOperator = DatabaseOperation.Instance; var themeColor = new SolidColorBrush(AppearanceManager.Current.AccentColor); this.border.BorderBrush = themeColor; this.border_ListBox.BorderBrush = themeColor; this.border_Confirm.BorderBrush = themeColor; }
public ApplicationPage() { InitializeComponent(); themeColor = new SolidColorBrush(AppearanceManager.Current.AccentColor); dbOperator = DatabaseOperation.Instance; //EventHandlerの追加 dbOperator.UsageTime_Updated += new EventHandler(this.UsageTime_Updated); dbOperator.NewRecord_Registered += new EventHandler(this.NewRecord_Registered); SetDataGrid(); }
public MainWindow() { InitializeComponent(); dbOperator = DatabaseOperation.Instance; overuseWarningItems = dbOperator.GetOveruseWarningCollection(); dataBanker = DataBanker.Instance; dataBanker["WarningNotAgain"] = new List<int>(); dataBanker["WarningCount"] = 0; //コンテキストメニュー追加 ToolStripMenuItem exitItem = new ToolStripMenuItem() { Text = "終了(&E)" }; ToolStripMenuItem openItem = new ToolStripMenuItem() { Text = "開く(&O)" }; exitItem.Click += new EventHandler(exitItem_Click); openItem.Click += new EventHandler(openItem_Click); ContextMenuStrip menuStrip = new ContextMenuStrip(); menuStrip.Items.Add(openItem); menuStrip.Items.Add(new ToolStripSeparator()); menuStrip.Items.Add(exitItem); //バルーン通知の設定 notifyIcon = new NotifyIcon() { Text = "Manage your Life", Icon = Properties.Resources.originalIconTray, Visible = true, BalloonTipIcon = ToolTipIcon.Info, ContextMenuStrip = menuStrip }; notifyIcon.MouseDoubleClick += new MouseEventHandler(notifyIcon_MouseDoubleClick); this.procMonitor = new ActiveProcessMonitor(); this.procMonitor.OnActiveProcessChanged += OnActiveProcessChanged; this.procMonitor.Start(); }
public HomePage() { InitializeComponent(); pInfo = new ProcessInformation(); preCategorizedCountData = new Dictionary<string, int>(); dataBanker = DataBanker.Instance; dbOperator = DatabaseOperation.Instance; dbOperator.TimelineLog_Updated += new EventHandler(this.TimelineLog_Updated); this.chart_upTime.DataContext = new SystemUptimeViewModel(); this.chart_Bar.DataContext = new UsageTimeViewModel(DateTime.Today, 5); //起動時刻保存 dataBanker["StartUpTime"] = DateTime.Now; //タイマー登録 clockTimer = new DispatcherTimer(); clockTimer.Interval = new TimeSpan(0, 0, 1); clockTimer.Tick += ClockDispatcherTimer_Tick; clockTimer.Start(); updateUpTimeTimer = new DispatcherTimer(); updateUpTimeTimer.Interval = new TimeSpan(0, 15, 0); updateUpTimeTimer.Tick += UpdateUpTimeDispatcherTimer_Tick; updateUpTimeTimer.Start(); //カテゴライズ int sec = Properties.Settings.Default.label_TimeSpan / 1000; int milliSec = Properties.Settings.Default.label_TimeSpan % 1000; hatenaTimer = new DispatcherTimer(); hatenaTimer.Interval = new TimeSpan(0, 0, 0, sec, milliSec); hatenaTimer.Tick += HatenaDispatcherTimer_Tick; hatenaTimer.Start(); }