Пример #1
0
 public static bool?TryGet(IReadOnlyCollection <NodeData.ConfigData> config)
 {
     foreach (var c in config.Where(c => c.Type == GenericNodeConfigDefinition.StaticId))
     {
         var data = GenericNodeConfigDefinition.Extract(c);
         if (string.Compare("rounded", data.Key, StringComparison.OrdinalIgnoreCase) == 0)
         {
             return(bool.Parse(data.Value));
         }
     }
     return(null);
 }
Пример #2
0
 /// <summary>
 /// Determine the maximum width configuration for the input config or null if it is not specified
 /// </summary>
 public static float?TryGet(IReadOnlyCollection <NodeData.ConfigData> config)
 {
     foreach (var c in config.Where(c => c.Type == GenericNodeConfigDefinition.StaticId))
     {
         var data = GenericNodeConfigDefinition.Extract(c);
         if (string.Compare("maxwidth", data.Key, StringComparison.OrdinalIgnoreCase) == 0)
         {
             return(float.Parse(data.Value, CultureInfo.InvariantCulture));
         }
     }
     return(null);
 }
Пример #3
0
 public static Color?TryGet(IReadOnlyCollection <NodeData.ConfigData> config)
 {
     foreach (var c in config.Where(c => c.Type == ID))
     {
         return(Color.FromArgb(int.Parse((c.Parameters.Single() as IStringParameter).Value, System.Globalization.NumberStyles.HexNumber, CultureInfo.InvariantCulture)));
     }
     foreach (var c in config.Where(c => c.Type == GenericNodeConfigDefinition.StaticId))
     {
         var data = GenericNodeConfigDefinition.Extract(c);
         if (string.Compare("color", data.Key, StringComparison.OrdinalIgnoreCase) == 0)
         {
             return(Color.FromArgb(int.Parse(data.Value, System.Globalization.NumberStyles.HexNumber, CultureInfo.InvariantCulture)));
         }
     }
     return(null);
 }
Пример #4
0
 public static bool TryGet(IReadOnlyCollection <NodeData.ConfigData> config, out string keys)
 {
     keys = "";
     foreach (var c in config.Where(c => c.Type == ID))
     {
         keys = (c.Parameters.Single() as IStringParameter).Value;
         return(true);
     }
     foreach (var c in config.Where(c => c.Type == GenericNodeConfigDefinition.StaticId))
     {
         var data = GenericNodeConfigDefinition.Extract(c);
         if (string.Compare("Shortcut", data.Key, StringComparison.OrdinalIgnoreCase) == 0)
         {
             keys = data.Value;
             return(true);
         }
     }
     return(false);
 }