private bool SaveConfig() { Config.Main.Set(Const.Param.ScreenWidth, ActualWidth); Config.Main.Set(Const.Param.ScreenHeight, ActualHeight); Config.Main.Set(Const.Param.ScreenTop, Top); Config.Main.Set(Const.Param.ScreenLeft, Left); Config.Main.Set(Const.Param.OnTop, Topmost); Config.Main.Set(Const.Param.DataWidth, DataWidth.ActualWidth); Config.Main.Set(Const.Param.NetworkHeight, NetworkHeight.ActualHeight); ConfigParams.ForEach(p => p.SaveConfig()); if (!SaveSettings()) { return(false); } if (NetworksManager != null) { CtlInputDataPresenter.SaveConfig(NetworksManager.Config); if (!NetworksManager.IsValid()) { MessageBox.Show("Network parameter is invalid", "Error"); return(false); } else { NetworksManager.SaveConfig(); } } Config.Main.FlushToDrive(); if (NetworksManager != null) { NetworksManager.Config.FlushToDrive(); } return(true); }
private bool SaveConfig() { if (!SaveSettings()) { return(false); } if (NetworksManager != null) { if (!NetworksManager.IsValid()) { MessageBox.Show("Network parameter is invalid", "Error"); return(false); } else { NetworksManager.SaveConfig(); } } return(true); }