public frmMain() { XMLSettings.WriteDefaultSettings(); XMLSettings.ListenPort = ushort.Parse(XMLSettings.ReadValue("ListenPort")); XMLSettings.AutoListen = bool.Parse(XMLSettings.ReadValue("AutoListen")); XMLSettings.ShowPopup = bool.Parse(XMLSettings.ReadValue("ShowPopup")); XMLSettings.Password = XMLSettings.ReadValue("Password"); if (bool.Parse(XMLSettings.ReadValue("ShowToU"))) { using (var frm = new frmTermsOfUse()) { frm.ShowDialog(); } Thread.Sleep(300); } InitializeComponent(); this.Menu = mainMenu; lvwColumnSorter = new ListViewColumnSorter(); lstClients.ListViewItemSorter = lvwColumnSorter; ListViewExtensions.removeDots(lstClients); ListViewExtensions.changeTheme(lstClients); }
private void ReadSettings(bool writeIfNotExist = true) { if (writeIfNotExist) { XMLSettings.WriteDefaultSettings(); } XMLSettings.ListenPort = ushort.Parse(XMLSettings.ReadValue("ListenPort")); XMLSettings.ShowToU = bool.Parse(XMLSettings.ReadValue("ShowToU")); XMLSettings.AutoListen = bool.Parse(XMLSettings.ReadValue("AutoListen")); XMLSettings.ShowPopup = bool.Parse(XMLSettings.ReadValue("ShowPopup")); XMLSettings.UseUPnP = bool.Parse(XMLSettings.ReadValue("UseUPnP")); XMLSettings.Password = XMLSettings.ReadValue("Password"); }
private void ReadSettings(bool writeIfNotExist = true) { if (writeIfNotExist) { XMLSettings.WriteDefaultSettings(); } XMLSettings.ListenPort = ushort.Parse(XMLSettings.ReadValue("ListenPort")); XMLSettings.ShowToU = bool.Parse(XMLSettings.ReadValue("ShowToU")); XMLSettings.AutoListen = bool.Parse(XMLSettings.ReadValue("AutoListen")); XMLSettings.ShowPopup = bool.Parse(XMLSettings.ReadValue("ShowPopup")); XMLSettings.UseUPnP = bool.Parse(XMLSettings.ReadValue("UseUPnP")); XMLSettings.ShowToolTip = bool.Parse(!string.IsNullOrEmpty(XMLSettings.ReadValue("ShowToolTip")) ? XMLSettings.ReadValue("ShowToolTip") : "False"); //fallback XMLSettings.Password = XMLSettings.ReadValue("Password"); }
private void ReadSettings(bool writeIfNotExist = true) { if (writeIfNotExist) { XMLSettings.WriteDefaultSettings(); } XMLSettings.ListenPort = ushort.Parse(XMLSettings.ReadValue("ListenPort")); XMLSettings.ShowToU = bool.Parse(XMLSettings.ReadValue("ShowToU")); XMLSettings.AutoListen = bool.Parse(XMLSettings.ReadValue("AutoListen")); XMLSettings.ShowPopup = bool.Parse(XMLSettings.ReadValue("ShowPopup")); XMLSettings.UseUPnP = bool.Parse(XMLSettings.ReadValue("UseUPnP")); XMLSettings.ShowToolTip = bool.Parse(XMLSettings.ReadValueSafe("ShowToolTip", "False")); XMLSettings.IntegrateNoIP = bool.Parse(XMLSettings.ReadValueSafe("EnableNoIPUpdater", "False")); XMLSettings.NoIPHost = XMLSettings.ReadValueSafe("NoIPHost"); XMLSettings.NoIPUsername = XMLSettings.ReadValueSafe("NoIPUsername"); XMLSettings.NoIPPassword = XMLSettings.ReadValueSafe("NoIPPassword"); XMLSettings.Password = XMLSettings.ReadValue("Password"); }