/// <summary>
 /// 序列化。
 /// </summary>
 /// <param name="data"></param>
 public static void Serializer(MonitorUIColorSettings data)
 {
     if (data != null)
     {
         string path = FolderStructure.MonitorUIColorSettingsFile;
         UtilTools.Serializer<MonitorUIColorSettings>(data, path);
     }
 }
        private void SystemSettingsWindow_Load(object sender, EventArgs e)
        {
            this.portSettings = this.CoreService["portsettings"] as PortSettings;
            if (this.portSettings == null)
            {
                this.portSettings = NetPortSettingsMgr.DeSerializer();
            }

            this.colorSettings = this.CoreService["monitoruicolorsettings"] as MonitorUIColorSettings;
            if (this.colorSettings == null)
            {
                this.colorSettings = MonitorUIColorSettings.DeSerializer();
            }

            this.SetTextBoxValue(this.txtHostBroadcast, this.portSettings.HostBroadcast);
            this.SetTextBoxValue(this.txtBroadcastInterval, this.portSettings.BroadcastInterval);
            this.SetTextBoxValue(this.txtHostOrder, this.portSettings.HostOrder);
            this.SetTextBoxValue(this.txtClientCallback, this.portSettings.ClientCallback);
            this.SetTextBoxValue(this.txtFileUpTransfer, this.portSettings.FileUpTransfer);
            this.SetTextBoxValue(this.txtFileDownTransfer, this.portSettings.FileDownTransfer);
            this.SetTextBoxValue(this.txtMaxFileSize, this.portSettings.MaxFileSize);

            this.SetTextBoxColor(this.txtOnlineColor, this.colorSettings.OnlineColor);
            this.SetTextBoxColor(this.txtOfflineColor, this.colorSettings.OfflineColor);
            this.SetTextBoxColor(this.txtUploadColor, this.colorSettings.UploadColor);
            this.SetTextBoxColor(this.txtOfflineUploadColor, this.colorSettings.OfflineUploadColor);
            this.SetTextBoxColor(this.txtMoveColor, this.colorSettings.MoveColor);
            this.SetTextBoxColor(this.txtReviewColor, this.colorSettings.ReviewColor);
        }
 /// <summary>
 /// 反序列化。
 /// </summary>
 /// <returns></returns>
 public static MonitorUIColorSettings DeSerializer()
 {
     string path = FolderStructure.MonitorUIColorSettingsFile;
     MonitorUIColorSettings data = UtilTools.DeSerializer<MonitorUIColorSettings>(path);
     if (data == null)
         data = new MonitorUIColorSettings();
     return data;
 }
Beispiel #4
0
 /// <summary>
 /// 加载数据。
 /// </summary>
 /// <param name="students"></param>
 public void Start(StudentsEx students)
 {
     lock (this)
     {
         this.settings = this.CoreService["monitoruicolorsettings"] as MonitorUIColorSettings;
         if (this.settings == null) this.settings = new MonitorUIColorSettings();
         this.DrawStudents(students);
     }
 }