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> /// Deserializing method /// </summary> private void DeserializeLinks() { try { FileInfo linksfile = new FileInfo(AYarkov.LinksSaver.Properties.Resources.LinksStorageName); if (linksfile.Exists == true) { XmlSerializer n = new XmlSerializer(typeof(LinksCollection)); TextReader m = new StreamReader(AYarkov.LinksSaver.Properties.Resources.LinksStorageName); _links = (LinksCollection)n.Deserialize(m); m.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!"); } }