Example #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));
         }
     }
 }
Example #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()));
        }
Example #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));
            }
        }
Example #4
0
		public override object Read(IReadContext context)
		{
			return context.ReadObject();
		}
Example #5
0
 public override object Read(IReadContext context)
 {
     return(context.ReadObject());
 }
Example #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());
		}
		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));
			}
		}