コード例 #1
0
        private void InkWindow_Loaded(object sender, RoutedEventArgs e)
        {
            //Initialize analyzer and pipeline
            inkAnalyzer = new InkAnalyzer(this.Dispatcher);
            pipeline    = new PipelineAnalyzer(inkAnalyzer);

            //Initialize headings
            headings         = new Headings();
            headings.sidebar = SideInkCanvas;
            headings.scrollViewerContainer = MainScrollView;

            MainInkCanvas.Strokes.StrokesChanged += Strokes_StrokesChanged;
            inkAnalyzer.ContextNodeCreated       += InkAnalyzer_ContextNodeCreated;
            pipeline.PipelineComplete            += pipeline_PipelineComplete;

            //DisableDictionary();

            insertionBox = new InsertionBox(inserter);
            insertionBox.TheInsertButton.Click += InsertButton_Click;
            insertionBox.TheCancelButton.Click += CancelButton_Click;
            insertReflow = new ReflowProcessor(insertionBox.InkCanvas, false);
            OverlayCanvas.Children.Add(insertionBox);
            insertionBox.Visibility = Visibility.Collapsed;

            inserter = new InsertionProcessor(MainInkCanvas, insertionBox);
            pipeline.AddProcessor(inserter);
            pipeline.AddProcessor(new StrikethroughProcessor(MainInkCanvas));
            pipeline.AddProcessor(new ReflowProcessor(MainInkCanvas, true));
            pipeline.AddProcessor(new NavigationProcessor(headings));
            pipeline.AddProcessor(new AutocorrectProcessor(this));
        }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: rudi-c/htn-stylus
        private void InkWindow_Loaded(object sender, RoutedEventArgs e)
        {
            //Initialize analyzer and pipeline
            inkAnalyzer = new InkAnalyzer(this.Dispatcher);
            pipeline = new PipelineAnalyzer(inkAnalyzer);

            //Initialize headings
            headings = new Headings();
            headings.sidebar = SideInkCanvas;
            headings.scrollViewerContainer = MainScrollView;

            MainInkCanvas.Strokes.StrokesChanged += Strokes_StrokesChanged;
            inkAnalyzer.ContextNodeCreated += InkAnalyzer_ContextNodeCreated;
            pipeline.PipelineComplete += pipeline_PipelineComplete;

            //DisableDictionary();

            insertionBox = new InsertionBox(inserter);
            insertionBox.TheInsertButton.Click += InsertButton_Click;
            insertionBox.TheCancelButton.Click += CancelButton_Click;
            insertReflow = new ReflowProcessor(insertionBox.InkCanvas, false);
            OverlayCanvas.Children.Add(insertionBox);
            insertionBox.Visibility = Visibility.Collapsed;

            inserter = new InsertionProcessor(MainInkCanvas, insertionBox);
            pipeline.AddProcessor(inserter);
            pipeline.AddProcessor(new StrikethroughProcessor(MainInkCanvas));
            pipeline.AddProcessor(new ReflowProcessor(MainInkCanvas, true));
            pipeline.AddProcessor(new NavigationProcessor(headings));
            pipeline.AddProcessor(new AutocorrectProcessor(this));
        }