internal void Start(BO.Profile services, string hostProfile) { if (!Host.IsLoaded) { Host.Load(); } Start(services, Host.Profile[hostProfile]); }
internal void Start(BO.Profile serviceProfile) { if (!Host.IsLoaded) { Host.Load(); } Start(serviceProfile, Host.Profile.Default); }
static void GetServers(BO.Profile hosts) { Host t = new Host(); foreach (var host in hosts.Where(c => ((BO.Host)c).IsSSH == false)) { t.GetServices((BO.Host)host); } }
Queue <BO.IProfileItem> GetHosts(BO.Profile hosts, Queue <BO.IProfileItem> queue) { foreach (var host in hosts.Where(c => ((BO.Host)c).IsSSH == true)) { var temp = (BO.Host)host; temp.Log = LogHandler; temp.Progress = ProgressChanged; queue.Enqueue(temp); } return(queue); }
public void Start(BO.Profile profile, BO.Profile hosts) { Queue <BO.IProfileItem> queue = new Queue <BO.IProfileItem>(); GetHosts(hosts, queue); GetServices(profile, hosts, queue); _total = _items = queue.Count; while (queue.Count > 0) { _items--; queue.Dequeue().Start(); } }
Queue <BO.IProfileItem> GetServices(BO.Profile profile, BO.Profile hosts, Queue <BO.IProfileItem> queue) { foreach (BO.Service service in profile) { if (service.IsChecked != true) { continue; } GetServers(hosts); foreach (BO.Host host in hosts) { if (host.IsChecked != true) { continue; } if (!host.IsSSH) { foreach (var item in host.Services) { if (IsMatch(service, item)) { BO.Service s = new BO.Service { Host = host.Value, Server = host.Name, Name = item.Name, Value = item.Value, Description = service.Description, Status = item.Status, TimeOut = service.TimeOut, StartDelay = service.StartDelay, Username = host.Username, Password = host.Password, Domain = host.Domain }; s.Log += LogHandler; s.Progress += ProgressChanged; queue.Enqueue(s); } } } } } return(queue); }
public void Stop(BO.Profile profile, BO.Profile hosts) { Queue <BO.IProfileItem> queue = new Queue <BO.IProfileItem>(); GetHosts(hosts, queue); GetServices(profile, hosts, queue); _total = _items = queue.Count; Stack <BO.IProfileItem> stack = new Stack <BO.IProfileItem>(); while (queue.Count > 0) { stack.Push(queue.Dequeue()); // reverse queue } while (stack.Count > 0) { _items--; stack.Pop().Stop(); } }
internal void Start(BO.Profile services, BO.Profile hosts) { Control control = new Control(); control.Start(services, hosts); }