示例#1
0
        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
        }
示例#2
0
 //Является типом
 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);
 }
示例#3
0
 /// <summary>
 /// 是否基本类型
 /// </summary>
 /// <param name="type"></param>
 /// <returns></returns>
 public static bool IsBaseType(this Type type)
 {
     return(type.IsPrimitive || type.IsEnum || BaseTypes.Contains(type));
 }
示例#4
0
 /// <summary>
 /// 是否是基本类型
 /// </summary>
 /// <param name="type"></param>
 /// <returns></returns>
 public static bool IsBaseType(Type type)
 {
     return(BaseTypes.Contains(type));
 }