private ObservableCollection <OraDB> GetDbsBySelectedCluster() { var updated_items = WorkloadSetupInfo.GetValue <ObservableCollection <Cluster> >(WorkloadSetupKeys.CLUSTERS); var selected = from m in updated_items where m.IsSelected == true select m; var rs_list = new ObservableCollection <OraDB>(); if (selected.Count() == 1) { var cluster = selected.First <Cluster>(); var candiate_node = SelectOneNodeFromCluster(cluster.ClusterName); var proxy = GammaProxyFactory.GetCrsEnvProxy(candiate_node); var rs = proxy.GetDBNames(); var dbnames = rs.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries).ToList(); int count = 0; foreach (var db in dbnames) { var dbhome = proxy.GetDBHOMEByName(db); rs_list.Add(new OraDB(count) { DBHome = dbhome, DBName = db }); count++; } return(rs_list); } else { return(null); } }
public WorkLoadClusterInfoViewModel() { ClusterItems = WorkloadSetupInfo.GetValue <ObservableCollection <Cluster> >(WorkloadSetupKeys.CLUSTERS); WorkLoads = new ObservableCollection <string>() { "Swingbench", "Aroltp" }; }
public WorkLoadDBInfoViewModel() { DBs = WorkloadSetupInfo.GetValue <ObservableCollection <OraDB> >(WorkloadSetupKeys.DBS); WorkLoads = new ObservableCollection <string>() { "Swingbench", "Aroltp" }; }
public void SetDbs(object button) { var btn = button as Button; btn.IsEnabled = false; var task = Task.Run(() => { WorkloadSetupInfo.SetValue(WorkloadSetupKeys.DBS, GetDbsBySelectedCluster()); }); task.GetAwaiter().OnCompleted(() => { btn.IsEnabled = true; }); }
public void SetClusterInfo() { WorkloadSetupInfo.SetValue(WorkloadSetupKeys.CLUSTERS, GetClusterInfo()); }