Beispiel #1
0
        private void CleanupEditCtx()
        {
            if (editCtx != null)
            {
                editCtx.ZoomManipulator.Delta -= Window_ManipulationDelta;

                editCtx.CleanupScene();
                editCtx = null;
            }
        }
Beispiel #2
0
        private void CreateEditCtx()
        {
            CleanupEditCtx();

            avaBar.SelectCurrentUser();

            editCtx = new EditorWndCtx(scene,
                                       inkCanv,
                                       palette,
                                       inkPalette,
                                       this, //surface window for focus fix
                                       _topicId != -1 ? _topicId : CurrentTopic.Id,
                                       _discussionId != -1 ? _discussionId : CurrentTopic.Discussion.Id,
                                       _shapesVisibile);

            editCtx.ZoomManipulator.Delta += Window_ManipulationDelta;

            DataContext = this;
            _sharedClient.clienRt.SendInitialSceneLoadRequest(_topicId != -1 ? _topicId : CurrentTopic.Id);
        }
        bool CreateGraphicContext(bool createNewGraphics)
        {          
            if(graphicsCtx!=null)
            {
                graphicsCtx.SetListeners(false);
                graphicsCtx = null;
            }

            int owner = SessionInfo.Get().person.Id;
            graphicsCtx = new EditorWndCtx(overlay, ink, toolPanel, btnFinishFreeForm, owner, this);
            if (createNewGraphics)
            {
                overlay.Children.Clear();
                graphicsCtx.CreateAnnotation(null, (int)this.ActualWidth, (int)this.ActualHeight, owner);                              
                return true;
            }                
            else
            {
                var aw = new AnnotationsWnd();
                aw.ShowDialog();

                if (aw.SelectedAnnotation() == null)
                    return false;
                
                if (aw.SelectedAnnotation().Bg != null)
                {
                    MessageBox.Show("Only can open in-place annotations in this form");
                    return false;
                }
                    
                graphicsCtx.LoadAnnotation(aw.SelectedAnnotation());
                btnEditLayer.Visibility = Visibility.Visible;
                btnEditLayer.Content = "Edit graphics";              
                return true;
            }
        }