private void OnAppModeChanged(IAppModeChangedEvent appModeChangedEvent) { if (appModeChangedEvent.NewAppMode == AppMode.Presentation) { disabled = true; } else { disabled = false; itemIndex.Clear(); RebuildFromRoot(); treeView.RefreshItem(rootItem); } }
private void OnModeChanged(IAppModeChangedEvent appModeChangedEvent) { StartPresentation.Enabled = appModeChangedEvent.NewAppMode != AppMode.Presentation; StopPresentation.Enabled = appModeChangedEvent.NewAppMode == AppMode.Presentation; }
private void OnAppModeChanged(IAppModeChangedEvent evnt) { switch (evnt.NewAppMode) { case AppMode.Editing: { var presentationView = (IFocusableView)renderControls[0].Viewports[0].View; var focusNodeId = presentationView.FocusNode.Id; var focusedEditingNode = worldTreeService.EditingWorld.GetNodeById(focusNodeId); var editingView = AmFactory.Create <EditingView>(); editingView.FocusOn(focusedEditingNode.GetComponent <IFocusNodeComponent>()); var storyGraphView = AmFactory.Create <StoryGraphView>(); var editViewport = AmFactory.Create <Viewport>(); editViewport.View = editingView; var storyGraphViewport = AmFactory.Create <Viewport>(); storyGraphViewport.View = storyGraphView; mainForm.RenderControl.SetViewports( new [] { editViewport, storyGraphViewport }, new ViewportsLayout { RowHeights = new[] { new ViewportLength(70, ViewportLengthUnit.Percent), new ViewportLength(30, ViewportLengthUnit.Percent), }, ColumnWidths = new[] { new ViewportLength(100, ViewportLengthUnit.Percent) }, ViewportIndices = new[, ] { { 0 }, { 1 } } }); mainForm.RenderControl.EndFullscreen(); viewService.ChangeRenderingArea(mainForm.RenderControl, editingView); break; } case AppMode.Presentation: { var editingView = (IFocusableView)renderControls[0].Viewports[0].View; var focusNodeId = editingView.FocusNode.Id; var focusedPresentationNode = worldTreeService.PresentationWorld.GetNodeById(focusNodeId); var presentationView = AmFactory.Create <PresentationView>(); presentationView.FocusOn(focusedPresentationNode.GetComponent <IFocusNodeComponent>()); var viewport = AmFactory.Create <Viewport>(); viewport.View = presentationView; mainForm.RenderControl.GoFullscreen(); mainForm.RenderControl.SetViewports( new [] { viewport }, new ViewportsLayout { RowHeights = new[] { new ViewportLength(100, ViewportLengthUnit.Percent) }, ColumnWidths = new[] { new ViewportLength(100, ViewportLengthUnit.Percent) }, ViewportIndices = new[, ] { { 0 } } }); viewService.ChangeRenderingArea(mainForm.RenderControl, presentationView); break; } default: throw new ArgumentOutOfRangeException(); } }
private void OnAppModeChange(IAppModeChangedEvent evnt) { SelectedNode = null; }