本文整理汇总了C#中Db4objects.Db4o.Internal.ObjectReference.Store方法的典型用法代码示例。如果您正苦于以下问题:C# ObjectReference.Store方法的具体用法?C# ObjectReference.Store怎么用?C# ObjectReference.Store使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Db4objects.Db4o.Internal.ObjectReference
的用法示例。
在下文中一共展示了ObjectReference.Store方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Store2
public int Store2(Transaction trans, object obj, IUpdateDepth updateDepth, bool checkJustSet
)
{
if (obj == null || (obj is ITransientClass))
{
return 0;
}
ObjectAnalyzer analyzer = new ObjectAnalyzer(this, obj);
analyzer.Analyze(trans);
if (analyzer.NotStorable())
{
return 0;
}
ObjectReference @ref = analyzer.ObjectReference();
if (@ref == null)
{
ClassMetadata classMetadata = analyzer.ClassMetadata();
if (!ObjectCanNew(trans, classMetadata, obj))
{
return 0;
}
@ref = new ObjectReference();
@ref.Store(trans, classMetadata, obj);
trans.AddNewReference(@ref);
if (obj is IDb4oTypeImpl)
{
((IDb4oTypeImpl)obj).SetTrans(trans);
}
if (ConfigImpl.MessageLevel() > Const4.State)
{
Message(string.Empty + @ref.GetID() + " new " + @ref.ClassMetadata().GetName());
}
FlagAsHandled(@ref);
StillToSet(trans, @ref, updateDepth);
}
else
{
if (@ref.IsFlaggedAsHandled(_topLevelCallId))
{
AssertNotInCallback();
}
if (CanUpdate())
{
if (checkJustSet)
{
if (([email protected]()) && HandledInCurrentTopLevelCall(@ref))
{
return @ref.GetID();
}
}
if (updateDepth.SufficientDepth())
{
FlagAsHandled(@ref);
@ref.WriteUpdate(trans, updateDepth);
}
}
}
ProcessPendingClassUpdates();
return @ref.GetID();
}