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


C# Transaction.Container方法代码示例

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


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

示例1: ForID

 public static CollectIdContext ForID(Transaction
     transaction, IdObjectCollector collector, int id)
 {
     var reader = transaction.Container().ReadStatefulBufferById(transaction
         , id);
     if (reader == null)
     {
         return null;
     }
     var oh = new ObjectHeader(transaction.Container(), reader);
     return new CollectIdContext(transaction, collector
         , oh, reader);
 }
开发者ID:masroore,项目名称:db4o,代码行数:13,代码来源:CollectIdContext.cs

示例2: QConClass

 internal QConClass(Transaction trans, QCon parent, QField field, IReflectClass claxx
     ) : base(trans, parent, field, null)
 {
     // C/S
     if (claxx != null)
     {
         var container = trans.Container();
         _classMetadata = container.ClassMetadataForReflectClass(claxx);
         if (_classMetadata == null)
         {
             // could be an aliased class, try to resolve.
             var className = claxx.GetName();
             var aliasRunTimeName = container.Config().ResolveAliasStoredName(className);
             if (!className.Equals(aliasRunTimeName))
             {
                 _classMetadata = container.ClassMetadataForName(aliasRunTimeName);
             }
         }
         if (claxx.Equals(container._handlers.IclassObject))
         {
             _classMetadata = (ClassMetadata) _classMetadata.TypeHandler();
         }
     }
     _claxx = claxx;
 }
开发者ID:masroore,项目名称:db4o,代码行数:25,代码来源:QConClass.cs

示例3: ReadSpec

 public virtual RawClassSpec ReadSpec(Transaction trans, ByteArrayBuffer reader)
 {
     var nameBytes = ReadName(trans, reader);
     var className = trans.Container().StringIO().Read(nameBytes);
     ReadMetaClassID(reader);
     // skip
     var ancestorID = reader.ReadInt();
     reader.IncrementOffset(Const4.IntLength);
     // index ID
     var numFields = reader.ReadInt();
     return new RawClassSpec(className, ancestorID, numFields);
 }
开发者ID:masroore,项目名称:db4o,代码行数:12,代码来源:ClassMarshaller.cs

示例4: AssociateYapClass

 private void AssociateYapClass(Transaction a_trans, object a_object)
 {
     if (a_object == null)
     {
     }
     else
     {
         //It seems that we need not result the following field
         //i_object = null;
         //i_comparator = Null.INSTANCE;
         //i_classMetadata = null;
         // FIXME: Setting the YapClass to null will prevent index use
         // If the field is typed we can guess the right one with the
         // following line. However this does break some SODA test cases.
         // Revisit!
         //            if(i_field != null){
         //                i_classMetadata = i_field.getYapClass();
         //            }
         _classMetadata = a_trans.Container().ProduceClassMetadata(a_trans.Reflector().ForObject
             (a_object));
         if (_classMetadata != null)
         {
             i_object = _classMetadata.GetComparableObject(a_object);
             if (a_object != i_object)
             {
                 i_attributeProvider = _classMetadata.Config().QueryAttributeProvider();
                 _classMetadata = a_trans.Container().ProduceClassMetadata(a_trans.Reflector().ForObject
                     (i_object));
             }
             if (_classMetadata != null)
             {
                 _classMetadata.CollectConstraints(a_trans, this, i_object, new _IVisitor4_84(this
                     ));
             }
             else
             {
                 AssociateYapClass(a_trans, null);
             }
         }
         else
         {
             AssociateYapClass(a_trans, null);
         }
     }
 }
开发者ID:masroore,项目名称:db4o,代码行数:45,代码来源:QConObject.cs

示例5: WriteShort

 public void WriteShort(Transaction trans, string str, ByteArrayBuffer buffer)
 {
     StringIo(trans.Container()).WriteLengthAndString(buffer, str);
 }
开发者ID:masroore,项目名称:db4o,代码行数:4,代码来源:StringHandler.cs

示例6: Unmarshall

 internal override void Unmarshall(Transaction trans)
 {
     if (i_trans != null)
     {
         return;
     }
     base.Unmarshall(trans);
     if (i_object == null)
     {
         _preparedComparison = Null.Instance;
     }
     if (i_classMetadataID != 0)
     {
         _classMetadata = trans.Container().ClassMetadataForID(i_classMetadataID);
     }
     if (i_field != null)
     {
         i_field.Unmarshall(trans);
     }
     if (i_objectID > 0)
     {
         var obj = trans.Container().TryGetByID(trans, i_objectID);
         if (obj != null)
         {
             i_object = obj;
         }
     }
 }
开发者ID:masroore,项目名称:db4o,代码行数:28,代码来源:QConObject.cs

示例7: Config

 private static Config4Impl Config(Transaction trans)
 {
     if (null == trans)
     {
         throw new ArgumentNullException();
     }
     return trans.Container().ConfigImpl;
 }
开发者ID:masroore,项目名称:db4o,代码行数:8,代码来源:BTree.cs

示例8: Container

 internal virtual ObjectContainerBase Container(Transaction trans)
 {
     return trans.Container();
 }
开发者ID:masroore,项目名称:db4o,代码行数:4,代码来源:ArrayHandler.cs

示例9: Write

 public override void Write(Transaction trans, ClassMetadata clazz, ClassAspect aspect
     , ByteArrayBuffer writer)
 {
     writer.WriteShortString(trans, aspect.GetName());
     if (!(aspect is FieldMetadata))
     {
         return;
     }
     var field = (FieldMetadata) aspect;
     field.Alive();
     if (field.IsVirtual())
     {
         return;
     }
     var handler = field.GetHandler();
     if (handler is StandardReferenceTypeHandler)
     {
         // TODO: ensure there is a test case, to make this happen 
         if (((StandardReferenceTypeHandler) handler).ClassMetadata().GetID() == 0)
         {
             trans.Container().NeedsUpdate(clazz);
         }
     }
     writer.WriteInt(field.FieldTypeID());
     var bitmap = new BitMap4(3);
     bitmap.Set(0, field.IsPrimitive());
     bitmap.Set(1, Handlers4.HandlesArray(handler));
     bitmap.Set(2, Handlers4.HandlesMultidimensionalArray(handler));
     // keep the order
     writer.WriteByte(bitmap.GetByte(0));
 }
开发者ID:masroore,项目名称:db4o,代码行数:31,代码来源:FieldMarshaller0.cs

示例10: Unmarshall

 internal virtual void Unmarshall(Transaction a_trans)
 {
     if (i_classMetadataID != 0)
     {
         var yc = a_trans.Container().ClassMetadataForID(i_classMetadataID);
         _fieldMetadata = (FieldMetadata) yc._aspects[_fieldHandle];
     }
 }
开发者ID:masroore,项目名称:db4o,代码行数:8,代码来源:QField.cs

示例11: WriteUpdate

 public override void WriteUpdate(Transaction transaction, IUpdateDepth updatedepth
     )
 {
     if (!_firstUpdate)
     {
         base.WriteUpdate(transaction, updatedepth);
         return;
     }
     _firstUpdate = false;
     var container = transaction.Container();
     SetStateClean();
     var context = new MarshallingContext(transaction, this, updatedepth
         , false);
     Handlers4.Write(ClassMetadata().TypeHandler(), context, GetObject());
     var length = Container().BlockConverter().BlockAlignedBytes(context.MarshalledLength
         ());
     var slot = context.AllocateNewSlot(length);
     var pointer = new Pointer4(GetID(), slot);
     var buffer = context.ToWriteBuffer(pointer);
     container.WriteUpdate(transaction, pointer, ClassMetadata(), ArrayType.None,
         buffer);
     if (IsActive())
     {
         SetStateClean();
     }
 }
开发者ID:masroore,项目名称:db4o,代码行数:26,代码来源:OpenTypeHandler7.cs

示例12: ReadName

 public byte[] ReadName(Transaction trans, ByteArrayBuffer reader)
 {
     return ReadName(trans.Container().StringIO(), reader);
 }
开发者ID:masroore,项目名称:db4o,代码行数:4,代码来源:ClassMarshaller.cs


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