public MainWindow() { Mouse.OverrideCursor = Cursors.Wait; InitializeComponent(); SaveAndLoader = new SaveAndLoader(this); //データの読み込み SaveAndLoader.LoadData(); WindowTitleHolder = new WindowTitleHolder(this); ListViewSetter = new ListViewSetter(this); TogglManager = new TogglManager(this); SettingMenuWindow = new SettingWindow(this); NotifyIconSetter = new NotifyIconSetter(this); ContextMenuSetter = new ContextMenuSetter(this); TimeCounter = new TimeCounter(this); //日付を確認し、今日の日付と違っていれば更新 UpdateDateOfAppDatas(); //メニューの作成 CreateMenu(); SetView(); SetEvents(); Mouse.OverrideCursor = null; }
/// <summary> /// メニュー>計測するアプリケーションの追加 をクリック時に呼ばれる /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void menu_ClickAddApp(object sender, RoutedEventArgs e) { string path = GetFilePathByFileDialog(); if (!string.IsNullOrEmpty(path)) { ListViewSetter.AddListFromPath(path); } }
private void Window_Drop(object sender, DragEventArgs e) { string[] files = e.Data.GetData(DataFormats.FileDrop) as string[]; string text = ""; if (files != null) { files.ToList().ForEach(s => text += s + "\n"); files.ToList().ForEach(s => ListViewSetter.SetFilePathFromDroppedLinks(s)); } }
/// <summary> /// アプリケーションのデータを削除 /// </summary> /// <param name="appData"></param> public void RemoveAppData(AppDataObject appData) { appData.RemoveAllFileData(); lock (AppDatas) { AppDatas.Remove(appData); } ListViewSetter.UpdateListView(); SaveAndLoader.SaveCsvData(); IconGetter.RemoveIconImage(appData.ProcessName); }