Beispiel #1
0
 private void EventSinkService_NodeKeyPress(NNodeKeyPressEventArgs args)
 {
     // process shape char
     if (args.Node is NShape)
     {
         ProcessShapeChar(args);
         document.SmartRefreshAllViews();
         return;
     }
 }
Beispiel #2
0
        private void ProcessShapeChar(NNodeKeyPressEventArgs args)
        {
            if (!char.IsLetterOrDigit(args.KeyChar) &&
                !char.IsWhiteSpace(args.KeyChar) &&
                !char.IsPunctuation(args.KeyChar))
            {
                return;
            }

            // the shape processes all chars and adds them to the shape text
            NShape shape = (args.Node as NShape);

            if (shape.Text == InitialShapeText)
            {
                shape.Text = "";
            }

            shape.Text += args.KeyChar;

            // mark as handled and processed to stop bubbling and processing
            args.Handled   = true;
            args.Processed = markEventsAsProcessedCheck.Checked;
        }