Example #1
0
 static void CheckSetProperties(Dictionary <string, ClassInfo> classes, ClassInfo classInfo, FlowSourceObjectBase flowSource)
 {
     foreach (var name in classInfo.SetValues)
     {
         if (!flowSource.InPropertyNames.Contains(name))
         {
             classInfo.AddError(String.Format("{0} is not defined", name));
             errorFiles.Add(classInfo);
         }
     }
     foreach (var setterPropertyName in flowSource.InPropertyNames)
     {
         bool      usedFound        = false;
         var       type             = flowSource.GetType();
         ClassInfo currentClassInfo = classInfo;
         while (type != null)
         {
             if (currentClassInfo.ContainsSetValue(setterPropertyName))
             {
                 usedFound = true;
                 break;
             }
             type = type.BaseType;
             var className = type.FullName;
             if (type.IsGenericType)
             {
                 className = GetGenericClassName(className);
             }
             if (!classes.TryGetValue(className, out currentClassInfo))
             {
                 break;
             }
         }
         if (!usedFound)
         {
             classInfo.AddError(String.Format("{0} is defined, but not used in SetValue()", setterPropertyName));
             errorFiles.Add(classInfo);
         }
     }
 }