/// <summary>
        /// Groups the given StrokeCollection with the given label.
        /// </summary>
        public void Group(string label, System.Windows.Ink.StrokeCollection selectedStrokes)
        {
            // Apply the label
            if (selectedStrokes.Count > 0)
            {
                CommandList.ApplyLabelCmd applyLabel = new CommandList.ApplyLabelCmd(sketchPanel,
                                                                                     selectedStrokes, label);

                applyLabel.Regroup += new CommandList.RegroupEventHandler(applyLabel_Regroup);

                commandManager.ExecuteCommand(applyLabel);
            }
        }
Exemple #2
0
        public void ApplyLabelToSelection(ShapeType label)
        {
            if (this.sketchPanel.InkCanvas.GetSelectedStrokes().Count > 0)
            {
                // Apply the label
                CommandList.ApplyLabelCmd applyLabelCmd = new CommandList.ApplyLabelCmd(sketchPanel,
                                                                                        sketchPanel.InkCanvas.GetSelectedStrokes(), label);
                applyLabelCmd.Regroup        += new CommandList.RegroupEventHandler(applyLabel);
                applyLabelCmd.ErrorCorrected += new CommandList.ErrorCorrectedEventHandler(errorCorrected);
                CM.ExecuteCommand(applyLabelCmd);
            }

            if (LabelMenuFinished != null)
            {
                LabelMenuFinished();
            }
        }
        public void ApplyLabelToSelection(string label)
        {
            if (this.sketchPanel.InkCanvas.GetSelectedStrokes().Count > 0)
            {
                // Apply the label
                CommandList.ApplyLabelCmd applyLabelCmd = new CommandList.ApplyLabelCmd(sketchPanel,
                                                                                        sketchPanel.InkCanvas.GetSelectedStrokes(), label);
                applyLabelCmd.Regroup        += new CommandList.RegroupEventHandler(applyLabel);
                applyLabelCmd.ErrorCorrected += new CommandList.ErrorCorrectedEventHandler(errorCorrected);
                CM.ExecuteCommand(applyLabelCmd);
            }
            else
            {
                // Otherwise change back the cursor
                sketchPanel.InkCanvas.Cursor          = Cursors.Pen;
                sketchPanel.InkCanvas.UseCustomCursor = false;
            }

            this.Visibility = System.Windows.Visibility.Hidden;
            sketchPanel.InkCanvas.InvalidateArrange();
        }