本文整理汇总了C#中Db4objects.Container方法的典型用法代码示例。如果您正苦于以下问题:C# Db4objects.Container方法的具体用法?C# Db4objects.Container怎么用?C# Db4objects.Container使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Db4objects
的用法示例。
在下文中一共展示了Db4objects.Container方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ActivateOn
public virtual void ActivateOn(Db4objects.Db4o.Internal.Transaction transaction,
ActivationPurpose purpose)
{
if (Activating())
{
return;
}
try
{
Activating(true);
ObjectContainerBase container = transaction.Container();
if (!(container.ActivationDepthProvider() is ITransparentActivationDepthProvider))
{
return;
}
ITransparentActivationDepthProvider provider = (ITransparentActivationDepthProvider
)container.ActivationDepthProvider();
if (ActivationPurpose.Write == purpose)
{
lock (container.Lock())
{
provider.AddModified(GetObject(), transaction);
}
}
if (IsActive())
{
return;
}
lock (container.Lock())
{
Activate(transaction, GetObject(), new DescendingActivationDepth(provider, ActivationMode
.Activate));
}
}
finally
{
Activating(false);
}
}
示例2: ObjectCanUpdate
protected virtual bool ObjectCanUpdate(Db4objects.Db4o.Internal.Transaction transaction
, object obj)
{
ObjectContainerBase container = transaction.Container();
return container.Callbacks().ObjectCanUpdate(transaction, this) && _class.DispatchEvent
(transaction, obj, EventDispatchers.CanUpdate);
}
示例3: VirtualAttributes
public virtual Db4objects.Db4o.Internal.VirtualAttributes VirtualAttributes(Db4objects.Db4o.Internal.Transaction
trans, bool lastCommitted)
{
if (trans == null)
{
return _virtualAttributes;
}
lock (trans.Container().Lock())
{
if (_virtualAttributes == null)
{
if (_class.HasVirtualAttributes())
{
_virtualAttributes = new Db4objects.Db4o.Internal.VirtualAttributes();
_class.ReadVirtualAttributes(trans, this, lastCommitted);
}
}
else
{
if (!_virtualAttributes.SuppliesUUID())
{
if (_class.HasVirtualAttributes())
{
_class.ReadVirtualAttributes(trans, this, lastCommitted);
}
}
}
return _virtualAttributes;
}
}
示例4: WriteUpdate
public virtual void WriteUpdate(Db4objects.Db4o.Internal.Transaction transaction,
IUpdateDepth updatedepth)
{
ContinueSet(transaction, updatedepth);
// make sure, a concurrent new, possibly triggered by objectOnNew
// is written to the file
// preventing recursive
if (!BeginProcessing())
{
return;
}
object obj = GetObject();
if (!ObjectCanUpdate(transaction, obj) || !IsActive() || obj == null || !ClassMetadata
().IsModified(obj))
{
EndProcessing();
return;
}
MarshallingContext context = new MarshallingContext(transaction, this, updatedepth
, false);
if (context.UpdateDepth().Negative())
{
EndProcessing();
return;
}
ObjectContainerBase container = transaction.Container();
LogEvent(container, "update", Const4.State);
SetStateClean();
context.PurgeFieldIndexEntriesOnUpdate(transaction, container._handlers.ArrayType
(obj));
Handlers4.Write(_class.TypeHandler(), context, obj);
if (context.UpdateDepth().CanSkip(this))
{
EndProcessing();
return;
}
Pointer4 pointer = context.AllocateSlot();
ByteArrayBuffer buffer = context.ToWriteBuffer(pointer);
container.WriteUpdate(transaction, pointer, _class, container._handlers.ArrayType
(obj), buffer);
if (IsActive())
{
SetStateClean();
}
EndProcessing();
container.Callbacks().ObjectOnUpdate(transaction, this);
ClassMetadata().DispatchEvent(transaction, obj, EventDispatchers.Update);
}
示例5: Store
internal void Store(Db4objects.Db4o.Internal.Transaction trans, Db4objects.Db4o.Internal.ClassMetadata
classMetadata, object obj)
{
_object = obj;
_class = classMetadata;
int id = trans.Container().IdForNewUserObject(trans);
SetID(id);
// will be ended in continueset()
BeginProcessing();
BitTrue(Const4.Continue);
}
示例6: Deactivate
public virtual void Deactivate(Db4objects.Db4o.Internal.Transaction trans, IActivationDepth
depth)
{
if (!depth.RequiresActivation())
{
return;
}
object obj = GetObject();
if (obj == null)
{
return;
}
ObjectContainerBase container = trans.Container();
LogActivation(container, "deactivate");
SetStateDeactivated();
_class.Deactivate(trans, this, depth);
}
示例7: ObjectOnNew
private void ObjectOnNew(Db4objects.Db4o.Internal.Transaction transaction, object
obj)
{
ObjectContainerBase container = transaction.Container();
container.Callbacks().ObjectOnNew(transaction, this);
_class.DispatchEvent(transaction, obj, EventDispatchers.New);
}
示例8: ContinueSet
/// <summary>return false if class not completely initialized, otherwise true</summary>
internal virtual bool ContinueSet(Db4objects.Db4o.Internal.Transaction trans, IUpdateDepth
updateDepth)
{
if (!BitIsTrue(Const4.Continue))
{
return true;
}
if (!_class.StateOK())
{
return false;
}
if (!_class.AspectsAreInitialized())
{
return false;
}
if (DTrace.enabled)
{
DTrace.Continueset.Log(GetID());
}
BitFalse(Const4.Continue);
MarshallingContext context = new MarshallingContext(trans, this, updateDepth, true
);
Handlers4.Write(ClassMetadata().TypeHandler(), context, GetObject());
Pointer4 pointer = context.AllocateSlot();
ByteArrayBuffer buffer = context.ToWriteBuffer(pointer);
ObjectContainerBase container = trans.Container();
container.WriteNew(trans, pointer, _class, buffer);
object obj = _object;
ObjectOnNew(trans, obj);
if (_class.HasIdentity())
{
_object = container.NewWeakReference(this, obj);
}
SetStateClean();
EndProcessing();
return true;
}
示例9: Activate
public virtual void Activate(Db4objects.Db4o.Internal.Transaction ta, object obj,
IActivationDepth depth)
{
ObjectContainerBase container = ta.Container();
ActivateInternal(container.ActivationContextFor(ta, obj, depth));
container.ActivatePending(ta);
}