public bool SavePackage(Models.Data.Package package) { if (package == null) { return(false); } var p = userSettings.packages.FirstOrDefault(s => s.name == package.name); if (p == null) { userSettings.packages.Add(package); } else { if (!string.IsNullOrEmpty(package.uid)) { p.uid = package.uid; } p.beans = package.beans; } SaveUserSettings(); return(true); }
void ShowPackage(Models.Data.Package package) { tboxName.Text = package.name; cboxBalancerStrategy.SelectedIndex = package.strategy; beanList = package.beans.Select(b => b.Clone()).ToList(); RefreshFlyContent(); }
void SaveCurPackageSetting() { var name = tboxName.Text; if (string.IsNullOrEmpty(name)) { Libs.UI.MsgBoxAsync(I18N.NameCanNotBeNull); return; } var package = new Models.Data.Package(); package.name = name; package.beans = GetFlyContentBeanList(); settings.SavePackage(package); RefreshPackageListBox(); }
public void SavePackage(Models.Data.Package package) { if (package == null) { Libs.UI.MsgBoxAsync(I18N.NullParam); return; } var p = userSettings.packages.FirstOrDefault(s => s.name == package.name); if (p == null) { userSettings.packages.Add(package); } else { p.beans = package.beans; } SaveUserSettings(); Libs.UI.MsgBoxAsync(I18N.Done); }
void SaveCurPackageSetting() { var name = tboxName.Text; if (string.IsNullOrEmpty(name)) { Libs.UI.MsgBoxAsync(I18N.NameCanNotBeNull); return; } var package = new Models.Data.Package { name = name, strategy = cboxBalancerStrategy.SelectedIndex, beans = GetFlyContentBeanList() }; Libs.UI.MsgBoxAsync( settings.SavePackage(package) ? I18N.Done : I18N.NullParam); RefreshPackageListBox(); }
void ShowPackage(Models.Data.Package package) { tboxName.Text = package.name; beanList = package.beans.Select(b => b.Clone()).ToList(); RefreshFlyContent(); }