コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 /// <summary>
 /// Empty method just to implement the interface
 /// </summary>
 /// <param name="action"></param>
 public void RemoveAction(Action action)
 {
 }
コード例 #4
0
 /// <summary>
 /// Adds an actin to this Viewer
 /// </summary>
 /// <param name="action">Action.</param>
 public void AddAction(Action action)
 {
 }