Esempio n. 1
0
        public void Load_Settings()
        {
            try
            {
                XmlSerializer serializer = new XmlSerializer(typeof(Settings));

                if (System.IO.File.Exists(SettingsPath))
                {
                    System.IO.FileStream fs = new System.IO.FileStream(SettingsPath, System.IO.FileMode.Open);
                    this.settings = (Settings)serializer.Deserialize(fs);
                    fs.Close();
                    Report.PrintDateBar(this);
                    Report.Print("Setting Loaded.", this);
                    Report.Print("SettingFilePath : " + this.SettingsPath, this);
                    Report.Print("PortNum : " + this.settings.PortNum, this);
                    Report.Print("StartPort : " + this.settings.StartPort, this);
                }
                else
                {
                    this.settings.Initialize();
                    this.WriteSettings();
                }
            }
            catch (Exception ex)
            {
                Errorlog.Print(ex, this);
            }
        }
Esempio n. 2
0
 private void Init_Classes()
 {
     this.settings            = new Settings();
     this.List_ClientHosts    = new List <ClientHost>();
     this.List_Port           = new List <int>();
     this.List_DataConnection = new List <DataConnection>();
 }
Esempio n. 3
0
 private void Init_Classes()
 {
     this.settings = new Settings();
     this.List_ClientHosts = new List<ClientHost>();
     this.List_Port = new List<int>();
     this.List_DataConnection = new List<DataConnection>();
 }
Esempio n. 4
0
        public void Load_Settings()
        {
            try
            {
                XmlSerializer serializer = new XmlSerializer(typeof(Settings));

                if (System.IO.File.Exists(SettingsPath))
                {

                    System.IO.FileStream fs = new System.IO.FileStream(SettingsPath, System.IO.FileMode.Open);
                    this.settings = (Settings)serializer.Deserialize(fs);
                    fs.Close();
                    Report.PrintDateBar(this);
                    Report.Print("Setting Loaded.", this);
                    Report.Print("SettingFilePath : " + this.SettingsPath, this);
                    Report.Print("PortNum : " + this.settings.PortNum, this);
                    Report.Print("StartPort : " + this.settings.StartPort, this);
                }
                else
                {
                    this.settings.Initialize();
                    this.WriteSettings();
                }
            }
            catch (Exception ex)
            {
                Errorlog.Print(ex, this);
            }
        }