コード例 #1
0
        private void Redraw()
        {
            try
            {
                // draw and set up controller
                view = new View(model);
                controller = new GrammarController(model, view);
                controller.RedrawEvent += new GrammarController.ReDrawEventHandler(Refresh);
                controller.ControlSelected += new GrammarController.ControlSelectedHandler(setActionBar);
                controller.ErrorSerious += new GrammarController.ErrorEventHandler(controller_ErrorEventSerious);
                controller.OfferDeleteRule += new GrammarController.OfferDeleteRuleHandler(controller_OfferDeleteRule);
                controller.Error += new GrammarController.ErrorEventHandler(controller_Error);

                grammarContent.Content = view;

                setStartSymbolChoices();
            }
            catch (Exception e)
            {
                controller_ErrorEventSerious(e);
            }
        }
コード例 #2
0
        private void SetView()
        {
            view = new View(model);
            controller = new GrammarController(model, view);

            // set text
            grammarText.Text = model.DefinitiveGrammar.PrintGrammar();

            // add component
            grid1.Children.Clear();
            grid1.Children.Add(view);
        }