public static SettingCommon SettingCommon(string data) { SettingCommon settingCommon = new Core.SettingCommon(); string[] lines = data.Split('\n'); int bias = Convert.ToInt32(lines[0][0]); for (int i = 1; i < lines[0].Length; i++) { settingCommon.PassAdmin += ((char)(lines[0][i] - bias)).ToString(); } int indexLine = 1; settingCommon.graphSetting.AxisSizeFont = Convert.ToInt32(lines[indexLine++]); settingCommon.graphSetting.LegendPos = (OxyPlot.LegendPosition)Enum.Parse(typeof(OxyPlot.LegendPosition), lines[indexLine++]); settingCommon.graphSetting.LegendSizeFont = Convert.ToInt32(lines[indexLine++]); settingCommon.graphSetting.LegendVis = Convert.ToBoolean(lines[indexLine++]); settingCommon.graphSetting.LineWidth = Convert.ToInt32(lines[indexLine++]); settingCommon.IsWindowMode = Convert.ToBoolean(lines[indexLine++]); settingCommon.IsAutorunWin = Convert.ToBoolean(lines[indexLine++]); settingCommon.IsRunModules = Convert.ToBoolean(lines[indexLine++]); settingCommon.PathConfig = lines[indexLine++]; settingCommon.MaxColor = (Color)ColorConverter.ConvertFromString(lines[indexLine++]); settingCommon.MinColor = (Color)ColorConverter.ConvertFromString(lines[indexLine++]); try { settingCommon.Dark = Convert.ToBoolean(lines[indexLine++]); } catch { } return(settingCommon); }
public SettingCommonWindow(Core.SettingCommon settingCommon) { InitializeComponent(); settingCommonReturn = settingCommon; this.settingCommon = settingCommon.Clone(); DataContext = this.settingCommon; bMinColor.Background = new SolidColorBrush(Color.FromRgb(settingCommon.MinColor.R, settingCommon.MinColor.G, settingCommon.MinColor.B)); bMaxColor.Background = new SolidColorBrush(Color.FromRgb(settingCommon.MaxColor.R, settingCommon.MaxColor.G, settingCommon.MaxColor.B)); }