예제 #1
0
 protected void ReadInto(IReadContext context, ArrayInfo info, object array)
 {
     if (array == null)
     {
         return;
     }
     if (HandleAsByteArray(array))
     {
         context.ReadBytes((byte[])array);
         // byte[] performance optimisation
         return;
     }
     if (HasNullBitmap(info))
     {
         BitMap4 nullBitMap = ReadNullBitmap(context, info.ElementCount());
         for (int i = 0; i < info.ElementCount(); i++)
         {
             object obj = nullBitMap.IsTrue(i) ? null : context.ReadObject(_handler);
             ArrayReflector(Container(context)).Set(array, i, obj);
         }
     }
     else
     {
         for (int i = 0; i < info.ElementCount(); i++)
         {
             ArrayReflector(Container(context)).Set(array, i, context.ReadObject(_handler));
         }
     }
 }
예제 #2
0
        public object Read(IReadContext context)
        {
            var      wrapper = (PSObjectWrapper)context.ReadObject(TypeHandler());
            PSObject obj     = (PSObject)((UnmarshallingContext)context).PersistentObject();

            return(wrapper.Original(obj, context.ObjectContainer()));
        }
예제 #3
0
        private static void ReadElements(IReadContext context, ICollectionInitializer initializer, ITypeHandler4 elementHandler)
        {
            int elementCount = context.ReadInt();

            for (int i = 0; i < elementCount; i++)
            {
                initializer.Add(context.ReadObject(elementHandler));
            }
        }
예제 #4
0
		public override object Read(IReadContext context)
		{
			return context.ReadObject();
		}
예제 #5
0
 public override object Read(IReadContext context)
 {
     return(context.ReadObject());
 }
예제 #6
0
		public object Read(IReadContext context)
		{
			var wrapper = (PSObjectWrapper)context.ReadObject(TypeHandler());
			PSObject obj = (PSObject) ((UnmarshallingContext) context).PersistentObject();
			return wrapper.Original(obj, context.ObjectContainer());
		}
예제 #7
0
		protected void ReadInto(IReadContext context, ArrayInfo info, object array)
		{
			if (array == null)
			{
				return;
			}
			if (HandleAsByteArray(array))
			{
				context.ReadBytes((byte[])array);
				// byte[] performance optimisation
				return;
			}
			if (HasNullBitmap(info))
			{
				BitMap4 nullBitMap = ReadNullBitmap(context, info.ElementCount());
				for (int i = 0; i < info.ElementCount(); i++)
				{
					object obj = nullBitMap.IsTrue(i) ? null : context.ReadObject(_handler);
					ArrayReflector(Container(context)).Set(array, i, obj);
				}
			}
			else
			{
				for (int i = 0; i < info.ElementCount(); i++)
				{
					ArrayReflector(Container(context)).Set(array, i, context.ReadObject(_handler));
				}
			}
		}
		private static void ReadElements(IReadContext context, ICollectionInitializer initializer, ITypeHandler4 elementHandler)
		{
			int elementCount = context.ReadInt();
			for (int i = 0; i < elementCount; i++)
			{
				initializer.Add(context.ReadObject(elementHandler));
			}
		}