示例#1
0
        public void BindController(ITileBrushManagerPresenter controller)
        {
            if (_controller == controller)
                return;

            if (_controller != null) {
                _controller.SyncTileBrushManager -= SyncTileBrushManagerHandler;
                _controller.SyncTileBrushCollection -= SyncTileBrushCollectionHandler;
                _controller.SyncCurrentBrush -= SyncCurrentBrushHandler;
            }

            _controller = controller;

            if (_controller != null) {
                _controller.SyncTileBrushManager += SyncTileBrushManagerHandler;
                _controller.SyncTileBrushCollection += SyncTileBrushCollectionHandler;
                _controller.SyncCurrentBrush += SyncCurrentBrushHandler;

                _commandController.BindCommandManager(_controller.CommandManager);
            }
            else {
                _commandController.BindCommandManager(null);
            }
        }
示例#2
0
        public void BindTileBrushManager(ITileBrushManagerPresenter controller)
        {
            if (_brushManager != null) {
                _brushManager.TileBrushSelected -= TileBrushSelectedHandler;
            }

            _brushManager = controller;

            if (_brushManager != null) {
                _brushManager.TileBrushSelected += TileBrushSelectedHandler;
            }
        }