예제 #1
0
        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"]);
        }
예제 #2
0
        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"]);
        }
예제 #3
0
 public void Configure(TextConfiguration config)
 {
     foreach (var name in config.Formats.Keys)
         this.SetFormat(name, config.Formats[name]);
 }
예제 #4
0
 public static TextConfiguration LoadFromFile(string filename)
 {
     var result = new TextConfiguration();
     result.Load(File.ReadAllLines(filename));
     return result;
 }