Пример #1
0
 private void Parse(Json.Document jsonDoc)
 {
     TargetPath  = jsonDoc.GetRoot().AsDictionary()["TargetPath"].AsString();
     SourcetPath = jsonDoc.GetRoot().AsDictionary()["SourcetPath"].AsString();
     foreach (var mod in jsonDoc.GetRoot().AsDictionary()["Mods"].AsDictionary())
     {
         _mods[(FTPTargetWatcher.ArchiveCryptMode)Enum.Parse(typeof(FTPTargetWatcher.ArchiveCryptMode), mod.Key)] = mod.Value.AsString();
     }
     isParsed = true;
 }
Пример #2
0
        public ScriptResult(PathDescriptor location, Json.Document store)
        {
            Json.Node node = store.Root;
            if (node != null)
            {
                node = node.Child;
            }

            projects = new PathDescriptor[0];

            if (store == null)
            {
                return;
            }
            else
            {
                while (node != null)
                {
                    switch (node.Name.ToLowerInvariant())
                    {
                    case "$projects":
                    {
                        string[] args = Store.TransformObject(node).Split(',');
                        projects = new PathDescriptor[args.Length];

                        for (int i = 0; i < projects.Length; i++)
                        {
                            projects[i] = new PathDescriptor(location, args[i].Trim('"'));
                        }
                    }
                    break;
                    }
                    node = node.Next;
                }
            }
        }