public void AddActivity(Activity input) { var path = ((Activity)input).GetPrivateMethodValue <string>("get_DottedPath"); bool isRoot = (input.Parent == null) || (path.Contains(".") == false); if (isRoot) { ActivityTree.Add(new ActivityWrapper(input, path)); } else { UnresolvedActivities.Add(new ActivityWrapper(input, path)); } #region Populate Base and Declaration List lock (this) { string fullName = input.GetType().FullName; if (DeclarationTypes.Contains(fullName) == false) { lock (this) { fullName = input.GetType().FullName; if (DeclarationTypes.Contains(fullName) == false) { DeclarationTypes.Add(fullName); } } } } lock (this) { string baseTypeName = input.GetType().BaseType.FullName; if (BaseTypes.Contains(baseTypeName) == false) { lock (this) { baseTypeName = input.GetType().BaseType.FullName; if (BaseTypes.Contains(baseTypeName) == false) { BaseTypes.Add(baseTypeName); } } } } #endregion }
//Является типом public override bool LessOrEquals(ITablikType type) { if (type is ObjectType) { return(this == type); } if (type is BaseObjectType) { return(BaseTypes.Contains((BaseObjectType)type)); } if (type is SimpleType) { Simple.LessOrEquals(type); } return(false); }
/// <summary> /// 是否基本类型 /// </summary> /// <param name="type"></param> /// <returns></returns> public static bool IsBaseType(this Type type) { return(type.IsPrimitive || type.IsEnum || BaseTypes.Contains(type)); }
/// <summary> /// 是否是基本类型 /// </summary> /// <param name="type"></param> /// <returns></returns> public static bool IsBaseType(Type type) { return(BaseTypes.Contains(type)); }