Example #1
0
 private static void configP2Pplugin(Dictionary <string, string> dataList, System.Collections.ObjectModel.ReadOnlyCollection <ConfigDefinition> configs)
 {
     foreach (var data in dataList)
     {
         if (data.Key.Contains("wants: "))
         {
             string toBeSearched = "wants: ";
             string GUID         = data.Key.Substring(data.Key.IndexOf(toBeSearched) + toBeSearched.Length);
             if (!configs.Any(p => p.Key == GUID))
             {
                 configPlugin(GUID);
             }
         }
         else if (data.Key.Contains("has: "))
         {
             {
                 string toBeSearched = "has: ";
                 string GUID         = data.Key.Substring(data.Key.IndexOf(toBeSearched) + toBeSearched.Length);
                 if (!configs.Any(p => p.Key == GUID))
                 {
                     configPlugin(GUID);
                 }
             }
         }
     }
 }
Example #2
0
        public static ServerModeOrderDescriptor[] GetSortExpression(
            System.Collections.ObjectModel.ReadOnlyCollection <GridViewColumnState> columns,
            System.Collections.ObjectModel.ReadOnlyCollection <GridViewColumnState> defaultSort)
        {
            ServerModeOrderDescriptor[] orderDescriptors = null;

            if (columns.Any() && defaultSort.Any())
            {
                var joind = columns.ToList();
                joind.AddRange(defaultSort);
                orderDescriptors =
                    joind.Select(
                        c =>
                        new ServerModeOrderDescriptor(new OperandProperty(c.FieldName),
                                                      c.SortOrder == ColumnSortOrder.Descending)).ToArray();
            }
            else if (columns.Any())
            {
                orderDescriptors =
                    columns.Select(
                        c =>
                        new ServerModeOrderDescriptor(new OperandProperty(c.FieldName),
                                                      c.SortOrder == ColumnSortOrder.Descending)).ToArray();
            }
            else if (defaultSort.Any())
            {
                orderDescriptors =
                    defaultSort.Select(
                        c =>
                        new ServerModeOrderDescriptor(new OperandProperty(c.FieldName),
                                                      c.SortOrder == ColumnSortOrder.Descending)).ToArray();
            }
            return(orderDescriptors);
        }
Example #3
0
        public void WaitForReady(string message)
        {
            WebDriverWait wait = new WebDriverWait(WebDriver, TimeSpan.FromSeconds(3));

            wait.Until(driver =>
            {
                System.Collections.ObjectModel.ReadOnlyCollection <LogEntry> logs = driver.Manage().Logs.GetLog(LogType.Browser);
                return(logs.Any(log => log.Message.Contains(message)));
            });
        }
Example #4
0
 private void AddMetaBehavior(System.Collections.ObjectModel.ReadOnlyCollection <Uri> uris)
 {
     if (addMeta)
     {
         ServiceMetadataBehavior mexBehavior = this.Description.Behaviors.Find <ServiceMetadataBehavior>();
         if (mexBehavior == null)
         {
             mexBehavior = new ServiceMetadataBehavior();
             mexBehavior.HttpsGetEnabled = uris.Any(it => it.Scheme == Uri.UriSchemeHttps);
             this.Description.Behaviors.Add(mexBehavior);
         }
     }
 }