Example #1
0
        /// <summary>
        /// Attach the Manager model and ManagerView to this presenter.
        /// </summary>
        /// <param name="model">The model</param>
        /// <param name="view">The view to attach</param>
        /// <param name="presenter">The explorer presenter being used</param>
        public void Attach(object model, object view, ExplorerPresenter presenter)
        {
            this.view      = view as IBubbleChartView;
            this.presenter = presenter;
            this.model     = model as IBubbleChart;

            this.view.OnGraphChanged += OnViewChanged;
            this.view.AddNode        += OnAddNode;
            this.view.DelNode        += OnDelNode;
            this.view.AddArc         += OnAddArc;
            this.view.DelArc         += OnDelArc;

            this.view.RuleList.ContextItemsNeeded += OnNeedVariableNames;
            //view.RuleList.TextHasChangedByUser += OnVariableNamesChanged;
            this.view.ActionList.ContextItemsNeeded += OnNeedEventNames;

            propertiesPresenter.Attach(this.model, this.view.PropertiesView, presenter);
            //view.ActionList.TextHasChangedByUser += OnEventNamesChanged;

            intellisense = new IntellisensePresenter(view as ViewBase);
            intellisense.ItemSelected += OnIntellisenseItemSelected;

            presenter.CommandHistory.ModelChanged += OnModelChanged;

            RefreshView();
        }