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); }
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); }
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()); } }
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); }
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()); } }