GetArrayRank() public method

public GetArrayRank ( ) : int
return int
        internal static RuntimeType AddElementTypes(SerializationInfo info, RuntimeType type)
        {
            List<int> elementTypes = new List<int>();
            while(type.HasElementType)
            {
                if (type.IsSzArray)
                {
                    elementTypes.Add(SzArray);
                }
                else if (type.IsArray)
                {
                    elementTypes.Add(type.GetArrayRank());
                    elementTypes.Add(Array);
                }
                else if (type.IsPointer)
                {
                    elementTypes.Add(Pointer);
                }
                else if (type.IsByRef)
                {
                    elementTypes.Add(ByRef);
                }
                
                type = (RuntimeType)type.GetElementType();
            }

            info.AddValue("ElementTypes", elementTypes.ToArray(), typeof(int[]));

            return type;
        }
Example #2
0
        internal static RuntimeType AddElementTypes(SerializationInfo info, RuntimeType type)
        {
            List <int> elementTypes = new List <int>();

            while (type.HasElementType)
            {
                if (type.IsSZArray)
                {
                    elementTypes.Add(SzArray);
                }
                else if (type.IsArray)
                {
                    elementTypes.Add(type.GetArrayRank());
                    elementTypes.Add(Array);
                }
                else if (type.IsPointer)
                {
                    elementTypes.Add(Pointer);
                }
                else if (type.IsByRef)
                {
                    elementTypes.Add(ByRef);
                }

                type = (RuntimeType)type.GetElementType();
            }

            info.AddValue("ElementTypes", elementTypes.ToArray(), typeof(int[]));

            return(type);
        }
Example #3
0
        internal static RuntimeType AddElementTypes(SerializationInfo info, RuntimeType type)
        {
            List <int> list = new List <int>();

            while (type.HasElementType)
            {
                if (type.IsSzArray)
                {
                    list.Add(3);
                }
                else if (type.IsArray)
                {
                    list.Add(type.GetArrayRank());
                    list.Add(2);
                }
                else if (type.IsPointer)
                {
                    list.Add(1);
                }
                else if (type.IsByRef)
                {
                    list.Add(4);
                }
                type = (RuntimeType)type.GetElementType();
            }
            info.AddValue("ElementTypes", list.ToArray(), typeof(int[]));
            return(type);
        }
		internal static RuntimeType AddElementTypes(SerializationInfo info, RuntimeType type)
		{
			List<int> list = new List<int>();
			while (type.HasElementType)
			{
				if (type.IsSzArray)
				{
					list.Add(3);
				}
				else
				{
					if (type.IsArray)
					{
						list.Add(type.GetArrayRank());
						list.Add(2);
					}
					else
					{
						if (type.IsPointer)
						{
							list.Add(1);
						}
						else
						{
							if (type.IsByRef)
							{
								list.Add(4);
							}
						}
					}
				}
				type = (RuntimeType)type.GetElementType();
			}
			info.AddValue("ElementTypes", list.ToArray(), typeof(int[]));
			return type;
		}
Example #5
0
		internal static bool IsSzArray(RuntimeType type)
		{
			// TODO: Better check
			return IsArray (type) && type.GetArrayRank () == 1;
		}
Example #6
0
 internal static bool IsSzArray(RuntimeType type)
 {
     // TODO: Better check
     return(IsArray(type) && type.GetArrayRank() == 1);
 }