public SetFormat ( string name, string format ) : void | ||
name | string | |
format | string | |
return | void |
public void SetFormat(string name, string format)
{
int p = format.IndexOf("...");
if (p >= 0)
{
string begin = format.Substring(0, p);
string end = format.Substring(p + 3);
this.formats[name + "Begin"] = begin;
this.formats[name + "End"] = end;
}
else
this.formats[name] = format;
}
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"]); }