private void EventSinkService_NodeKeyPress(NNodeKeyPressEventArgs args) { // process shape char if (args.Node is NShape) { ProcessShapeChar(args); document.SmartRefreshAllViews(); return; } }
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; }