Exemplo n.º 1
0
 /// <summary>
 /// 读取下一个数据
 /// </summary>
 /// <param name="scanner"></param>
 internal void Next(ref ReflectionScanner scanner)
 {
     while (enumerator.MoveNext())
     {
         object elementValue = enumerator.Current;
         if (elementValue != null)
         {
             Type fieldType = elementValue.GetType();
             if (fieldType != objectType.Type)
             {
                 objectType = scanner.Scanner.GetObjectType(fieldType);
             }
             if (objectType.IsScan != 0)
             {
                 if (fieldType.IsClass)
                 {
                     if (scanner.AddObject(elementValue))
                     {
                         if (objectType.Append(ref scanner, elementValue, true) != 2)
                         {
                             return;
                         }
                     }
                     else if (scanner.IsLimitExceeded)
                     {
                         return;
                     }
                 }
                 else if (objectType.Append(ref scanner, elementValue, true) != 2)
                 {
                     return;
                 }
             }
         }
     }
     --scanner.Arrays.Length;
 }
Exemplo n.º 2
0
        /// <summary>
        /// 对象扫描
        /// </summary>
        /// <param name="value"></param>
        /// <param name="objectType"></param>
        internal void Scan(object value, ReflectionType objectType)
        {
            switch (objectType.Append(ref this, value, false))
            {
            case 0: scan(); return;

            case 1:
                do
                {
                    Arrays.Array[Arrays.Length - 1].Next(ref this);
                    if (Objects.Length != 0)
                    {
                        scan();
                        return;
                    }
                }while (Arrays.Length != 0);
                return;
            }
        }