当前位置: 首页>>代码示例>>C#>>正文


C# ArrayInfo.ElementCount方法代码示例

本文整理汇总了C#中Db4objects.Db4o.Reflect.ArrayInfo.ElementCount方法的典型用法代码示例。如果您正苦于以下问题:C# ArrayInfo.ElementCount方法的具体用法?C# ArrayInfo.ElementCount怎么用?C# ArrayInfo.ElementCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Db4objects.Db4o.Reflect.ArrayInfo的用法示例。


在下文中一共展示了ArrayInfo.ElementCount方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: NewInstance

		public virtual object NewInstance(IReflectClass componentType, ArrayInfo info)
		{
			componentType = componentType.GetDelegate();
			if (componentType is GenericClass)
			{
				int length = info.ElementCount();
				return new GenericArray(((GenericClass)componentType).ArrayClass(), length);
			}
			return _delegate.NewInstance(componentType, info);
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:10,代码来源:GenericArrayReflector.cs

示例2: ReadDimensions

 private void ReadDimensions(ArrayInfo info, IReadBuffer buffer, int dimensionCount
     )
 {
     var dim = new int[dimensionCount];
     for (var i = 0; i < dim.Length; i++)
     {
         dim[i] = buffer.ReadInt();
     }
     ((MultidimensionalArrayInfo) info).Dimensions(dim);
     info.ElementCount(ElementCount(dim));
 }
开发者ID:masroore,项目名称:db4o,代码行数:11,代码来源:MultidimensionalArrayHandler.cs

示例3: ReadElements

		protected override void ReadElements(IReadContext context, ArrayInfo info, object
			 array)
		{
			if (array == null)
			{
				return;
			}
			object[] objects = new object[info.ElementCount()];
			ReadInto(context, info, objects);
			ArrayReflector(Container(context)).Shape(objects, 0, array, ((MultidimensionalArrayInfo
				)info).Dimensions(), 0);
		}
开发者ID:Galigator,项目名称:db4o,代码行数:12,代码来源:MultidimensionalArrayHandler.cs

示例4: NewInstance

		public virtual object NewInstance(IReflectClass componentType, ArrayInfo info)
		{
			// TODO: implement multidimensional arrays.
			int length = info.ElementCount();
			return NewInstance(componentType, length);
		}
开发者ID:erdincay,项目名称:db4o,代码行数:6,代码来源:SelfArray.cs

示例5: AnalyzeDimensions

		protected virtual void AnalyzeDimensions(ObjectContainerBase container, object obj
			, ArrayInfo info)
		{
			info.ElementCount(ArrayReflector(container).GetLength(obj));
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:5,代码来源:ArrayHandler.cs

示例6: WriteDimensions

		protected virtual void WriteDimensions(IWriteContext context, ArrayInfo info)
		{
			context.WriteInt(info.ElementCount());
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:4,代码来源:ArrayHandler.cs

示例7: WriteElements

		protected virtual void WriteElements(IWriteContext context, object obj, ArrayInfo
			 info)
		{
			if (HandleAsByteArray(obj))
			{
				context.WriteBytes((byte[])obj);
			}
			else
			{
				// byte[] performance optimisation
				if (HasNullBitmap(info))
				{
					BitMap4 nullItems = NullItemsMap(ArrayReflector(Container(context)), obj);
					WriteNullBitmap(context, nullItems);
					for (int i = 0; i < info.ElementCount(); i++)
					{
						if (!nullItems.IsTrue(i))
						{
							context.WriteObject(_handler, ArrayReflector(Container(context)).Get(obj, i));
						}
					}
				}
				else
				{
					for (int i = 0; i < info.ElementCount(); i++)
					{
						context.WriteObject(_handler, ArrayReflector(Container(context)).Get(obj, i));
					}
				}
			}
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:31,代码来源:ArrayHandler.cs

示例8: ReadInto

		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));
				}
			}
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:29,代码来源:ArrayHandler.cs

示例9: ReadDimensions

		protected virtual void ReadDimensions(ArrayInfo info, IReadBuffer buffer)
		{
			info.ElementCount(buffer.ReadInt());
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:4,代码来源:ArrayHandler.cs

示例10: ReadInfo

		protected virtual void ReadInfo(Transaction trans, IReadBuffer buffer, ArrayInfo 
			info)
		{
			int classID = buffer.ReadInt();
			if (IsPreVersion0Format(classID))
			{
				throw new UnsupportedOldFormatException();
			}
			else
			{
				_versionHelper.ReadTypeInfo(trans, buffer, info, classID);
				ReflectClassFromElementsEntry(Container(trans), info, classID);
				ReadDimensions(info, buffer);
			}
			if (Debug4.ExceedsMaximumArrayEntries(info.ElementCount(), _usePrimitiveClassReflector
				))
			{
				info.ElementCount(0);
			}
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:20,代码来源:ArrayHandler.cs

示例11: ReducedCountForNullBitMap

		private int ReducedCountForNullBitMap(ArrayInfo info, IReadBuffer context)
		{
			if (!HasNullBitmap(info))
			{
				return 0;
			}
			return ReducedCountForNullBitMap(info.ElementCount(), ReadNullBitmap(context, info
				.ElementCount()));
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:9,代码来源:ArrayHandler.cs

示例12: AnalyzeDimensions

 protected override void AnalyzeDimensions(ObjectContainerBase container, object obj
     , ArrayInfo info)
 {
     var dim = ArrayReflector(container).Dimensions(obj);
     ((MultidimensionalArrayInfo) info).Dimensions(dim);
     info.ElementCount(ElementCount(dim));
 }
开发者ID:masroore,项目名称:db4o,代码行数:7,代码来源:MultidimensionalArrayHandler.cs

示例13: WriteElements

 protected override void WriteElements(IWriteContext context, object obj, ArrayInfo
     info)
 {
     var objects = AllElements(Container(context), obj);
     if (HasNullBitmap(info))
     {
         var nullBitMap = new BitMap4(info.ElementCount());
         var nullBitMapBuffer = context.Reserve(nullBitMap.MarshalledLength());
         var currentElement = 0;
         while (objects.MoveNext())
         {
             var current = objects.Current;
             if (current == null)
             {
                 nullBitMap.SetTrue(currentElement);
             }
             else
             {
                 context.WriteObject(DelegateTypeHandler(), current);
             }
             currentElement++;
         }
         nullBitMapBuffer.WriteBytes(nullBitMap.Bytes());
     }
     else
     {
         while (objects.MoveNext())
         {
             context.WriteObject(DelegateTypeHandler(), objects.Current);
         }
     }
 }
开发者ID:masroore,项目名称:db4o,代码行数:32,代码来源:MultidimensionalArrayHandler.cs


注:本文中的Db4objects.Db4o.Reflect.ArrayInfo.ElementCount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。