Ejemplo n.º 1
0
        public FindReplace (MainForm main, NodeTreeController controller, DataNode searchRoot)
        {
            InitializeComponent();

            _main = main;
            _mainController = controller;
            _mainSearchRoot = searchRoot;

            _findController = new RuleTreeController(treeView1);
            treeView1.NodeMouseDoubleClick += (s, e) => {
                _findController.EditSelection();
            };

            //_findController.VirtualRootDisplay = "Find Rules";

            _replaceController = new NodeTreeController(treeView2);
            treeView2.NodeMouseDoubleClick += (s, e) => {
                _replaceController.EditSelection();
            };

            _replaceController.VirtualRootDisplay = "Replacement Tags";

            _explorerStrip.Renderer = new ToolStripExplorerRenderer();
            _explorerStrip.ImageList = _mainController.IconList;

            _explorerManager = new ExplorerBarController(_explorerStrip, _mainController.IconRegistry, _mainController.IconList, searchRoot);
            _explorerManager.SearchRootChanged += (s, e) => {
                _mainSearchRoot = _explorerManager.SearchRoot;
                Reset();
            };
        }
Ejemplo n.º 2
0
        public FindReplace(MainForm main, NodeTreeController controller, DataNode searchRoot)
        {
            InitializeComponent();

            _main           = main;
            _mainController = controller;
            _mainSearchRoot = searchRoot;

            _findController = new RuleTreeController(treeView1);
            treeView1.NodeMouseDoubleClick += (s, e) => { _findController.EditSelection(); };

            //_findController.VirtualRootDisplay = "Find Rules";

            _replaceController              = new NodeTreeController(treeView2);
            treeView2.NodeMouseDoubleClick += (s, e) => { _replaceController.EditSelection(); };

            _replaceController.VirtualRootDisplay = "Replacement Tags";

            _explorerStrip.Renderer  = new ToolStripExplorerRenderer();
            _explorerStrip.ImageList = _mainController.IconList;

            _explorerManager = new ExplorerBarController(_explorerStrip, _mainController.IconRegistry,
                                                         _mainController.IconList, searchRoot);
            _explorerManager.SearchRootChanged += (s, e) =>
            {
                _mainSearchRoot = _explorerManager.SearchRoot;
                Reset();
            };
        }
Ejemplo n.º 3
0
        public void RuleTreeControllerShouldDisplayRulesAlphabeticallyFromRuleProvider()
        {
            IRule ruleAlpha = Mocker.DynamicMock <IRule>();
            IRule ruleBravo = Mocker.DynamicMock <IRule>();

            IList <IRule> rules = new List <IRule>();

            rules.Add(ruleBravo);
            rules.Add(ruleAlpha);

            IList <IRule> rulesSorted = new List <IRule>();

            rulesSorted.Add(rules[1]);
            rulesSorted.Add(rules[0]);

            TreeViewImp                      view          = new TreeViewImp(rulesSorted);
            ICalidusRuleProvider             ruleProvider  = Mocker.DynamicMock <ICalidusRuleProvider>();
            ICalidusRuleConfigurationFactory configFactory = Mocker.DynamicMock <ICalidusRuleConfigurationFactory>();

            Expect.Call(ruleAlpha.Category).Return("Alpha").Repeat.Any();
            Expect.Call(ruleBravo.Category).Return("Bravo").Repeat.Any();

            Expect.Call(ruleProvider.GetRules(configFactory)).Return(rules).Repeat.Once();
            Expect.Call(() => view.DisplayRules(rulesSorted)).Repeat.Once();

            Mocker.ReplayAll();

            RuleTreeController controller = new RuleTreeController(view, ruleProvider, configFactory);

            Mocker.VerifyAll();
        }