Example #1
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);
            if (disposing)
            {
                _tile.Drawing                        -= OnTileDrawing;
                _tile.RendererChanged                -= OnRendererChanged;
                _tile.SelectionChanged               -= OnSelectionChanged;
                _tileController.CursorTokenChanged   -= OnCursorTokenChanged;
                _tileController.ContextMenuRequested -= OnContextMenuRequested;
                _tileController.CaptureChanging      -= OnCaptureChanging;
                _tile.InformationBoxChanged          -= OnInformationBoxChanged;

                if (_contextMenu != null)
                {
                    _contextMenu.Dispose();
                    _contextMenu = null;
                }

                try
                {
                    DisposeSurface();
                }
                catch (Exception e)
                {
                    Platform.Log(LogLevel.Debug, e);
                }
            }
        }
Example #2
0
        private void FireContextMenuEvent()
        {
            if (_tileController.ContextMenuProvider != null && _tileController.ContextMenuEnabled)
            {
                ActionModelNode actionModelNode = _tileController.ContextMenuProvider.GetContextMenuModel(_tileController);
                if (_contextMenu != null)
                {
                    _contextMenu.Dispose();
                }

                _contextMenu = new ContextMenuContainer(actionModelNode);

                ApplicationContext.FireEvent(new ContextMenuEvent
                {
                    Identifier      = Guid.NewGuid(),
                    SenderId        = Identifier,
                    ActionModelRoot = new WebActionNode {
                        Children = _contextMenu.GetWebActions()
                    }
                });
            }
        }