/// <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); }
//ref:http://var.blog.jp/archives/67144454.html //ref;http://10.hateblo.jp/entry/2014/05/30/154157 private void listHeader_Click(object sender, RoutedEventArgs e) { var header = (GridViewColumnHeader)e.OriginalSource; var headerName = (string)header.Content; if (header.Column == null || string.IsNullOrEmpty(headerName)) { return; } Func <AppDataObject, dynamic> keySelecter = a => a.DisplayedName; var pre = new ObservableCollection <AppDataObject>(AppDatas); if (headerName == "アプリケーション名") { keySelecter = a => a.DisplayedName; } else if (headerName == "今日の起動時間") { keySelecter = a => a.TodaysTime; } else if (headerName == "累積起動時間") { keySelecter = a => a.TotalTime; } lock (AppDatas) { AppDatas = new ObservableCollection <AppDataObject>(AppDatas.OrderBy(keySelecter)); if (AppDatas.SequenceEqual(pre, keySelecter)) { AppDatas = new ObservableCollection <AppDataObject>(AppDatas.Reverse()); } Dispatcher.BeginInvoke(new Action(() => { listView.ItemsSource = null; listView.ItemsSource = AppDatas; })); } }
public static string GetNavigation(BillTypeEnum type) { var app = AppDatas.Where(a => a.BillType == type).FirstOrDefault(); return(app != null ? app.Navigation : ""); }
private void InitAppDatas() { AppDatas.ToList().ForEach(a => a.Init()); }