public void IgnoreActionTest() { var tv = new TextViewer(); tv.Actions.Clear(); tv.Actions.Add(Action.CreateIgnoreAction("foo")); tv.AddEvent("bar", new FileListener()); Assert.AreEqual("bar\n", tv.Txt.Text); tv.AddEvent("foo", new FileListener()); Assert.AreEqual("bar\n", tv.Txt.Text); tv.AddEvent("bar", new FileListener()); Assert.AreEqual("bar\nbar\n", tv.Txt.Text); }
public void ActionFontSizeIsFloat() { var foo = "<viewer type=\"Text\" buffer=\"5000\" forecolor=\"Lime\" backcolor=\"Black\" font=\"Courier New\" fontsize=\"9\">" + "<action type=\"Highlight\" pattern=\"Document\" color=\"White\" font-name=\"Microsoft Sans Serif\" font-size=\"8.25\" font-style=\"Regular\" />" + "</viewer>"; var xml = new XmlDocument(); xml.LoadXml(foo); var n = xml.FirstChild.ChildNodes[0]; var a = Action.CreateGenericEventAction(n); var s = 8.25f; Assert.AreEqual(s, a.Font.Size); }
/// <summary> /// Empty method just to implement the interface /// </summary> /// <param name="action"></param> public void RemoveAction(Action action) { }
/// <summary> /// Adds an actin to this Viewer /// </summary> /// <param name="action">Action.</param> public void AddAction(Action action) { }