Example #1
0
        private void OpenDock(OpenDockMessage message)
        {
            if (message.IgnoreIfExists)
            {
                if (typeof(DockToolViewModelTemplate).IsAssignableFrom(message.Type))
                {
                    if (this.Anchorables.ToList().Exists((item) => item.GetType() == message.Type))
                    {
                        return;
                    }
                }
                else if (typeof(EditorViewModelTemplate).IsAssignableFrom(message.Type))
                {
                    if (this.Documents.ToList().Exists((item) => item.GetType() == message.Type))
                    {
                        return;
                    }
                }
            }
            DockViewModelTemplate dockViewModel;
            object content = message.Content;

            if (content != null)
            {
                this.dockCreator.UpdateContainer(message.Type, content.GetType(), content);
            }
            dockViewModel = this.dockCreator.CreateDock(message.Type);
            if (!string.IsNullOrEmpty(message.Title))
            {
                dockViewModel.Title.Value = message.Title;
            }
            AddDockViewModel(dockViewModel);
        }
Example #2
0
        private void MapsChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            switch (e.Action)
            {
            case NotifyCollectionChangedAction.Add:
                foreach (Map map in e.NewItems)
                {
                    OpenDockMessage openMapEditorMessage = new OpenDockMessage(typeof(MapEditorViewModel), map);
                    this.eventAggregator.GetEvent <OpenDockEvent>().Publish(openMapEditorMessage);
                }
                break;

            case NotifyCollectionChangedAction.Remove:
                foreach (Map map in e.OldItems)
                {
                    IEnumerable <MapEditorViewModel> mapViewModels        = this.Documents.OfType <MapEditorViewModel>();
                    IEnumerable <MapEditorViewModel> removedMapViewModels = mapViewModels.Where(viewModel => viewModel.Map.Value == map);
                    foreach (MapEditorViewModel removedMapViewModel in removedMapViewModels)
                    {
                        this.Documents.Remove(removedMapViewModel);
                    }
                }
                break;

            default:
                break;
            }
        }
Example #3
0
        private void OnNewTilesetWindowClosed(INotification notification)
        {
            IConfirmation confirmation = notification as IConfirmation;

            if (Mouse.OverrideCursor == Cursors.Pen)
            {
                Mouse.OverrideCursor = null;
            }
            if (confirmation.Confirmed)
            {
                TilesetModel tilesetModel = confirmation.Content as TilesetModel;
                this.Session.CurrentTilesets.Value.Add(tilesetModel);

                OpenDockMessage message = new OpenDockMessage(typeof(ItemEditorViewModel));
                message.IgnoreIfExists = true;
                message.Content        = tilesetModel;
                this.eventAggregator.GetEvent <OpenDockEvent>().Publish(message);
            }
        }
Example #4
0
        public void OpenProjectExplorerDock()
        {
            OpenDockMessage openDockMessage = new OpenDockMessage(typeof(ProjectExplorerViewModel));

            this.actionHandler.OpenDock(openDockMessage);
        }
Example #5
0
        public void OpenSessionViewerDock()
        {
            OpenDockMessage openDockMessage = new OpenDockMessage(typeof(SessionViewerViewModel));

            this.actionHandler.OpenDock(openDockMessage);
        }
Example #6
0
        public void OpenMinimapDock()
        {
            OpenDockMessage openDockMessage = new OpenDockMessage(typeof(MinimapViewModel));

            this.actionHandler.OpenDock(openDockMessage);
        }
Example #7
0
        public void OpenSelectedBrushDock()
        {
            OpenDockMessage openDockMessage = new OpenDockMessage(typeof(SelectedBrushViewModel));

            this.actionHandler.OpenDock(openDockMessage);
        }
Example #8
0
        public void OpenToolboxDock()
        {
            OpenDockMessage openDockMessage = new OpenDockMessage(typeof(ToolboxViewModel));

            this.actionHandler.OpenDock(openDockMessage);
        }
Example #9
0
        public void OpenLayerListDock()
        {
            OpenDockMessage openDockMessage = new OpenDockMessage(typeof(LayerListViewModel));

            this.actionHandler.OpenDock(openDockMessage);
        }
Example #10
0
        public void OpenItemEditorDock()
        {
            OpenDockMessage openDockMessage = new OpenDockMessage(typeof(ItemEditorViewModel));

            this.actionHandler.OpenDock(openDockMessage);
        }
Example #11
0
        public void OpenClipboardDock()
        {
            OpenDockMessage openDockMessage = new OpenDockMessage(typeof(ClipboardViewModel));

            this.actionHandler.OpenDock(openDockMessage);
        }
Example #12
0
 public void OpenDock(OpenDockMessage dockMessage)
 {
     this.eventAggregator.GetEvent <OpenDockEvent>().Publish(dockMessage);
 }