Exemplo n.º 1
0
        public void UpdateAllNamesIsChecked()
        {
            AppandLoadingLog("\nUpdateAllNamesIsChecked: " + isUpadetingAllNames);

            if (isUpadetingAllNames)
            {
                return;
            }
            isUpadetingAllNames = true;

            AppandLoadingLog("\nAllNamesIsChecked: ");
            allNamesIsChecked = ShowEventNames.All(x => x.IsChecked);
            AppandLoadingLog(allNamesIsChecked);

            NotifyPropertyChanged("AllNamesIsChecked");
            SaveUncheckedNames();

            isUpadetingAllNames = false;
        }
Exemplo n.º 2
0
        private async void SaveUncheckedNames()
        {
            AppandLoadingLog("\nUncheckedNames: ");
            IEnumerable <string> uncheckedNames = ShowEventNames.Where(x => !x.IsChecked).Select(x => x.Name);

            AppandLoadingLog(uncheckedNames.Count());

            try
            {
                AppandLoadingLog("\nSaveUncheckedNames...");
                await PathIO.WriteLinesAsync(filterFilepath, uncheckedNames);

                AppandLoadingLog("Done");
            }
            catch (FileNotFoundException)
            {
                try
                {
                    AppandLoadingLog("\nFileNotFound. CreateFile...");
                    await ApplicationData.Current.LocalFolder.CreateFileAsync(FilterFileName);

                    AppandLoadingLog("Done\nTrySaveAgain...");
                    await PathIO.WriteLinesAsync(filterFilepath, uncheckedNames);

                    AppandLoadingLog("Done");
                }
                catch (Exception e)
                {
                    AppandLoadingLog(GetExceptionMesageses(e));
                }
            }
            catch (Exception e)
            {
                AppandLoadingLog(GetExceptionMesageses(e));
            }
        }