예제 #1
0
    public bool AnalyzeYAMLFile(string name)
    {
        bool      success = false;
        string    text    = File.ReadAllText(name);
        TextInput input   = new TextInput(text);

        YamlParser parser     = new YamlParser();
        YamlStream yamlStream = parser.ParseYamlStream(input, out success);

        if (success)
        {
            {
                // foreach(var doc in yamlStream.Documents)
                var __enumerator1 = (yamlStream.Documents).GetEnumerator();
                while (__enumerator1.MoveNext())
                {
                    var doc = (YamlDocument)__enumerator1.Current;
                    {
                        AnalyzeYAMLNode(doc.Root);
                    }
                }
            }
        }
        else
        {
            Debug.LogError(parser.GetEorrorMessages());
        }

        return(success);
    }
예제 #2
0
        public static YamlStream Parse(String conf)
        {
            conf = Tab2Spaces(conf);
            bool       tmp;
            YamlParser parser = new YamlParser();
            YamlStream stream = parser.ParseYamlStream(new TextInput(conf), out tmp);

            if (!tmp)
            {
                throw new Exception(parser.GetEorrorMessages());
            }
            return(stream);
        }
예제 #3
0
        private void LoadYaml()
        {
            TextInput  input = new TextInput(txtConfig.Text);
            bool       success;
            YamlParser parser     = new YamlParser();
            YamlStream yamlStream = parser.ParseYamlStream(input, out success);

            if (success)
            {
                tviYaml.Nodes.Clear();
                foreach (YamlDocument doc in yamlStream.Documents)
                {
                    tviYaml.Nodes.Add(YamlEmittor.CreateNode(doc.Root));
                }
                tviYaml.ExpandAll();
                ESClustername = YamlEmittor.ClusterName;
            }
            else
            {
                MessageBox.Show(parser.GetEorrorMessages());
            }
        }
예제 #4
0
    public bool AnalyzeYAMLFile(string name)
    {
        bool      success = false;
        string    text    = File.ReadAllText(name);
        TextInput input   = new TextInput(text);

        YamlParser parser     = new YamlParser();
        YamlStream yamlStream = parser.ParseYamlStream(input, out success);

        if (success)
        {
            foreach (YamlDocument doc in yamlStream.Documents)
            {
                AnalyzeYAMLNode(doc.Root);
            }
        }
        else
        {
            Debug.LogError(parser.GetEorrorMessages());
        }

        return(success);
    }
예제 #5
0
        private void toolStripButtonParse_Click(object sender, EventArgs e)
        {
            TextInput input = new TextInput(richTextBoxSource.Text);

            bool       success;
            YamlParser parser     = new YamlParser();
            YamlStream yamlStream = parser.ParseYamlStream(input, out success);

            if (success)
            {
                treeViewData.Nodes.Clear();
                foreach (YamlDocument doc in yamlStream.Documents)
                {
                    treeViewData.Nodes.Add(YamlEmittor.CreateNode(doc.Root));
                }
                treeViewData.ExpandAll();
                tabControl1.SelectedTab = tabPageDataTree;
            }
            else
            {
                MessageBox.Show(parser.GetEorrorMessages());
            }
        }