public frmMain() { InitializeComponent(); _mainNode = true; CreateTheme.Checked = true; _links = new LinksCollection(); _themes = new ThemesCollection(); _selectedTheme = -1; _selectedLink = -1; _dragDropSelected = -1; _isThemeSelected = true; // Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("ru-RU"); }
/// <summary> /// </summary> private void DeserializeThemes() { try { FileInfo themesfile = new FileInfo(AYarkov.LinksSaver.Properties.Resources.ThemesStorageName); if (themesfile.Exists == true) { XmlSerializer s = new XmlSerializer(typeof(ThemesCollection)); TextReader r = new StreamReader(AYarkov.LinksSaver.Properties.Resources.ThemesStorageName); _themes = (ThemesCollection)s.Deserialize(r); r.Close(); } } catch (System.Security.SecurityException) { MessageBox.Show(@"Cannot read settings due to folder security settings!"); } catch (UnauthorizedAccessException) { MessageBox.Show(@"Please, use 'Run As Administrator' option to start application!"); } catch (PathTooLongException) { MessageBox.Show(@"Cannot read settings because path to the source file is too long!"); } catch (IOException) { MessageBox.Show(@"Cannot read settings due to I/O Error!"); } catch (Exception) { MessageBox.Show(@"Cannot read settings due to some errors!"); } }