Exemple #1
0
 private bool IsContainDoubleKey(List <string> resultStrArray)
 {
     for (int i = 0; i < resultStrArray.Count - 1; i++)
     {
         for (int j = i + 1; j < resultStrArray.Count; j++)
         {
             if (ShapeType.IsSupportShape(resultStrArray[j]))
             {
                 if (resultStrArray[j].Length >= resultStrArray[i].Length)
                 {
                     if (resultStrArray[j].Contains(resultStrArray[i]))
                     {
                         return(true);
                     }
                 }
                 else
                 {
                     if (resultStrArray[i].Contains(resultStrArray[j]))
                     {
                         return(true);
                     }
                 }
             }
         }
     }
     return(false);
 }
Exemple #2
0
        private void AnalyzResult(List <string> resultStrArray)
        {
            bool isContainDoubleKey = this.IsContainDoubleKey(resultStrArray);

            if (isContainDoubleKey)
            {
                this.ReduceAnalyzeStrokeTo(0);
                return;
            }
            foreach (var shapeKey in resultStrArray)
            {
                StrokeCollection[] strokeCollectionArray = this.theInkAnalyzer.Search(shapeKey);
                if (strokeCollectionArray.Length > 0)
                {
                    if (ShapeType.IsSupportShape(shapeKey))
                    {
                        StylusPointCollection targetCollection = this.GetCombineStylusPoints(strokeCollectionArray);

                        #region Mend
                        this.MendStroke(shapeKey, strokeCollectionArray, this.lastDrawingAttributes, targetCollection);
                        #endregion
                    }
                    else
                    {
                        if (string.IsNullOrEmpty(shapeKey) && shapeKey != ShapeType.Straight)
                        {
                            foreach (StrokeCollection strokeCollection in strokeCollectionArray)
                            {
                                this.RemoveStrokes(strokeCollection);
                            }
                        }
                        else
                        {
                            //line or can not be mended
                            this.AddLine(strokeCollectionArray);
                        }
                    }
                }
            }
        }