public override TextLayer[] Process(TextInfo text) { TextLayer[] result = null; if (text != null) { result = new TextLayer[1]; int charCount = text.Text.Length; MyLayerItem data = text.GetLayer("FirstLayer").ItemList[0] as MyLayerItem; result[0] = new TextLayer(_outputLayers[0], new BaseTextLayerItem[] { new MyLayerItem("Created by " + _name + " from " + data.Owner.Name, charCount) }); } return(result); }
static void Main(string[] args) { TextProcessingManager exampleManager = new TextProcessingManager(); MyExampleTextProcessor firstProcessor = new MyExampleTextProcessor(); MyExampleTextProcessor2 secondProcessor = new MyExampleTextProcessor2(); String registerDetails; if (exampleManager.RegisterProcessor(firstProcessor, out registerDetails) != TextProcessingManager.RegisterState.SuccessfullyRegistered || exampleManager.RegisterProcessor(secondProcessor, out registerDetails) != TextProcessingManager.RegisterState.SuccessfullyRegistered) { Console.WriteLine("Error!"); } TextInfo textInfo = exampleManager.GetTextInfo("It is my test text!"); textInfo.GetLayer("SecondLayer"); Console.ReadLine(); }