Esempio n. 1
0
 public MgLegendControlPresenter(ILegendView legend, MgMapViewerProvider provider)
 {
     _legend = legend;
     _provider = provider;
     _map = _provider.GetMap();
     InitInitialSelectabilityStates();
     _resSvc = (MgResourceService)_provider.CreateService(MgServiceType.ResourceService);
     _selectableIcon = Properties.Resources.lc_select;
     _unselectableIcon = Properties.Resources.lc_unselect;
 }
        /// <summary>
        /// Attach the specified Model and View.
        /// </summary>
        /// <param name="model">The model to attach</param>
        /// <param name="view">The View</param>
        /// <param name="explorerPresenter">The explorer presenter</param>
        public void Attach(object model, object view, ExplorerPresenter explorerPresenter)
        {
            this.graph             = model as Graph;
            this.view              = view as ILegendView;
            this.explorerPresenter = explorerPresenter;

            // Trap change event from the model.
            this.explorerPresenter.CommandHistory.ModelChanged += this.OnModelChanged;

            // Trap events from the view.
            this.view.OnPositionChanged += this.OnTitleChanged;

            // Tell the view to populate the axis.
            this.PopulateView();
        }
Esempio n. 3
0
        /// <summary>
        /// Attach the specified Model and View.
        /// </summary>
        public void Attach(object model, object view, ExplorerPresenter explorerPresenter)
        {
            Graph = model as Graph;
            View = view as ILegendView;
            ExplorerPresenter = explorerPresenter;

            // Trap change event from the model.
            ExplorerPresenter.CommandHistory.ModelChanged += OnModelChanged;

            // Trap events from the view.
            View.OnPositionChanged += OnTitleChanged;

            // Tell the view to populate the axis.
            PopulateView();
        }
Esempio n. 4
0
 protected override void Context()
 {
     _legendView = A.Fake <ILegendView>();
     sut         = new LegendPresenter(_legendView);
 }