ApiExamples.ExField.InsertTcFieldHandler.IReplacingCallback C# (CSharp) Метод

IReplacingCallback() приватный Метод

private IReplacingCallback ( ReplacingArgs args ) : ReplaceAction
args ReplacingArgs
Результат ReplaceAction
            ReplaceAction IReplacingCallback.Replacing(ReplacingArgs args)
            {
                // Create a builder to insert the field.
                DocumentBuilder builder = new DocumentBuilder((Document) args.MatchNode.Document);
                // Move to the first node of the match.
                builder.MoveTo(args.MatchNode);

                // If the user specified text to be used in the field as display text then use that, otherwise use the 
                // match string as the display text.
                string insertText;

                if (!string.IsNullOrEmpty(this.mFieldText))
                    insertText = this.mFieldText;
                else
                    insertText = args.Match.Value;

                // Insert the TC field before this node using the specified string as the display text and user defined switches.
                builder.InsertField(string.Format("TC \"{0}\" {1}", insertText, this.mFieldSwitches));

                // We have done what we want so skip replacement.
                return ReplaceAction.Skip;
            }
        }
ExField.InsertTcFieldHandler