Beispiel #1
0
 bool IsMatch(BO.Service service, BO.Service item)
 {
     if (!service.isRegEx ?? false)      // Is not regex
     {
         if (service.Value == item.Name) // Determine if XML value matches Service Description
         {
             return(true);
         }
         else if (service.Value == item.Value) // Determine if XML value matches Service Name
         {
             return(true);
         }
     }
     else
     {
         if (System.Text.RegularExpressions.Regex.IsMatch(item.Name, service.Value)) // Determine if XML pattern matches Service Description
         {
             return(true);
         }
         else if (System.Text.RegularExpressions.Regex.IsMatch(item.Value, service.Value)) // Determine if XML pattern matches Service Name
         {
             return(true);
         }
     }
     return(false);
 }
Beispiel #2
0
 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);
 }