public CobieObjectCategoryMatch(CobieObject evaluatingType)
 {
     MatchedObject = evaluatingType;
     MatchingCategories = new List<Category>();
 }
Beispiel #2
0
        /// <summary>
        /// Write the text to the TextWriter
        /// </summary>
        /// <param name="logMe">string to write</param>
        public void WriteLine(CobieObject rootObj, CobieObject parentObj, Type mergeType, int duplicateNo, int mergedNo, int depthIndicator)
        {
            if (logger != null )
            {
                string mergeindicator = (mergedNo > 0) ? "*" : "";
                StringBuilder sb = new StringBuilder();
                if (mergedNo > 0)
                    sb.Append("*");
                else
                    sb.Append(" ");

                if (depthIndicator > 0)
                    sb.Append('\t', depthIndicator);
                
                if (rootObj != null && (depthIndicator == 0))
                {
                    sb.Append(rootObj.GetType().Name);
                    sb.Append("(");
                    sb.Append(rootObj.Name);
                    sb.Append(":");
                    sb.Append(rootObj.ExternalId);
                    sb.Append("): ");
                }

                if (parentObj != null) 
                {
                    sb.Append(parentObj.GetType().Name);
                    sb.Append("(");
                    sb.Append(parentObj.Name);
                    sb.Append(":");
                    sb.Append(parentObj.ExternalId);
                    sb.Append("): ");
                }
                
                sb.Append(mergeType.Name);
                sb.Append(" ");
                sb.Append(duplicateNo);
                sb.Append(" duplicate, ");
                sb.Append(mergedNo);
                sb.Append(" merged.");
                logger.WriteLine( sb.ToString());
            }
        }