public void SetAndGetFormat() { TextConfiguration config = new TextConfiguration(); config.SetFormat("Keyword", "<keyword>"); Assert.IsNotNull(config.Formats); Assert.AreEqual(1, config.Formats.Count); Assert.AreEqual("<keyword>", config.Formats["Keyword"]); }
public void SetAndGetFormatWithDots() { TextConfiguration config = new TextConfiguration(); config.SetFormat("Keyword", "<keyword>...</keyword>"); Assert.IsNotNull(config.Formats); Assert.AreEqual(2, config.Formats.Count); Assert.AreEqual("<keyword>", config.Formats["KeywordBegin"]); Assert.AreEqual("</keyword>", config.Formats["KeywordEnd"]); }
public void Configure(TextConfiguration config) { foreach (var name in config.Formats.Keys) this.SetFormat(name, config.Formats[name]); }
public static TextConfiguration LoadFromFile(string filename) { var result = new TextConfiguration(); result.Load(File.ReadAllLines(filename)); return result; }