/// <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(); }
/// <summary> /// Attach the specified Model and View. /// </summary> /// <param name="model">The model</param> /// <param name="view">The view</param> /// <param name="explorerPresenter">The parent explorer presenter</param> public void Attach(object model, object view, ExplorerPresenter explorerPresenter) { this.map = model as Map; this.view = view as IMapView; this.explorerPresenter = explorerPresenter; propertyPresenter = new SimplePropertyPresenter(); propertyPresenter.Attach(model, this.view.PropertiesGrid, this.explorerPresenter); // Tell the view to populate the axis. this.PopulateView(); this.view.Zoom = this.map.Zoom; this.view.Center = this.map.Center; this.view.ViewChanged += this.OnViewChanged; explorerPresenter.CommandHistory.ModelChanged += OnModelChanged; }