Beispiel #1
0
        private DefinitionJson getDefinition(DefinitionCacheItem parameter)
        {
            var json = new DefinitionJson();

            if (parameter.Override)
            {
                json.Cmd = "[[" + parameter.Name + "]]";
            }
            else
            {
                if (parameter.Required)
                {
                    json.Cmd = parameter.Name;
                }
                else
                {
                    json.Cmd = "[" + parameter.Name + "]";
                }
            }
            json.Type     = parameter.Type.ToString().ToLower();
            json.Location = parameter.Location;
            json.Updated  =
                string.Format("{0}.{1}.{2} {3}:{4}:{5}",
                              parameter.Updated.Year,
                              parameter.Updated.Month.ToString().PadLeft(2, '0'),
                              parameter.Updated.Day.ToString().PadLeft(2, '0'),
                              parameter.Updated.Hour.ToString().PadLeft(2, '0'),
                              parameter.Updated.Minute.ToString().PadLeft(2, '0'),
                              parameter.Updated.Second.ToString().PadLeft(2, '0'));
            json.Description = parameter.Description;
            return(json);
        }
 private void addChildren(DefinitionJson json, IEnumerable<DefinitionCacheItem> parameters)
 {
     foreach (var parameter in parameters) {
         var child = getDefinition(parameter);
         addChildren(child, parameter.Parameters);
         json.Arguments.Add(child);
     }
 }
Beispiel #3
0
 private void addChildren(DefinitionJson json, IEnumerable <DefinitionCacheItem> parameters)
 {
     foreach (var parameter in parameters)
     {
         var child = getDefinition(parameter);
         addChildren(child, parameter.Parameters);
         json.Arguments.Add(child);
     }
 }
 private DefinitionJson getDefinition(DefinitionCacheItem parameter)
 {
     var json = new DefinitionJson();
     if (parameter.Override) {
         json.Cmd = "[[" + parameter.Name + "]]";
     } else {
         if (parameter.Required)
             json.Cmd = parameter.Name;
         else
             json.Cmd = "[" + parameter.Name + "]";
     }
     json.Type = parameter.Type.ToString().ToLower();
     json.Location = parameter.Location;
     json.Updated =
         string.Format("{0}.{1}.{2} {3}:{4}:{5}",
             parameter.Updated.Year,
             parameter.Updated.Month.ToString().PadLeft(2, '0'),
             parameter.Updated.Day.ToString().PadLeft(2, '0'),
             parameter.Updated.Hour.ToString().PadLeft(2, '0'),
             parameter.Updated.Minute.ToString().PadLeft(2, '0'),
             parameter.Updated.Second.ToString().PadLeft(2, '0'));
     json.Description = parameter.Description;
     return json;
 }