本文整理汇总了C#中IActivationContext类的典型用法代码示例。如果您正苦于以下问题:C# IActivationContext类的具体用法?C# IActivationContext怎么用?C# IActivationContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IActivationContext类属于命名空间,在下文中一共展示了IActivationContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CascadeActivation
private void CascadeActivation(IActivationContext context)
{
IActivationDepth depth = context.Depth();
if (!depth.RequiresActivation())
{
return;
}
if (depth.Mode().IsDeactivate())
{
Container().StillToDeactivate(_transaction, context.TargetObject(), depth, false);
}
else
{
// FIXME: [TA] do we really need to check for isValueType here?
Db4objects.Db4o.Internal.ClassMetadata classMetadata = context.ClassMetadata();
if (classMetadata.IsStruct())
{
classMetadata.CascadeActivation(context);
}
else
{
Container().StillToActivate(context);
}
}
}
示例2: CascadeActivation
public void CascadeActivation(IActivationContext context)
{
ICollection collection = ((ICollection)context.TargetObject());
foreach (object item in collection)
{
context.CascadeActivationToChild(item);
}
}
示例3: Deactivate
public override void Deactivate(IActivationContext context)
{
if (context.Depth().RequiresActivation())
{
CascadeActivation(context);
}
SetOn(context.Transaction(), context.TargetObject(), null);
}
示例4: CascadeActivation
public override void CascadeActivation(IActivationContext context)
{
if (!Handlers4.IsCascading(_typeHandler))
{
return;
}
Handlers4.CascadeActivation(context, _typeHandler);
}
示例5: CascadeActivation
public void CascadeActivation(IActivationContext context)
{
var all = ((ICollection) context.TargetObject()).GetEnumerator();
while (all.MoveNext())
{
context.CascadeActivationToChild(all.Current);
}
}
示例6: CascadeActivation
public virtual void CascadeActivation(IActivationContext context)
{
object targetObject = context.TargetObject();
if (IsPlainObject(targetObject))
{
return;
}
ITypeHandler4 typeHandler = TypeHandlerForObject(targetObject);
Handlers4.CascadeActivation(context, typeHandler);
}
示例7: CascadeActivation
public void CascadeActivation(IActivationContext context)
{
var map = (IDictionary) context.TargetObject();
var keys = (map).Keys.GetEnumerator();
while (keys.MoveNext())
{
var key = keys.Current;
context.CascadeActivationToChild(key);
context.CascadeActivationToChild(map[key]);
}
}
示例8: CascadeActivation
public void CascadeActivation(IActivationContext context)
{
IEnumerable collection = ((IEnumerable)context.TargetObject());
// TODO: detect the element type
// and return immediately when it's a primitive
foreach (object item in collection)
{
context.CascadeActivationToChild(item);
}
}
示例9: CascadeActivation
public void CascadeActivation(IActivationContext context)
{
if (!Handlers4.IsCascading(_handler))
{
return;
}
ObjectContainerBase container = context.Container();
IEnumerator all = AllElements(container, context.TargetObject());
while (all.MoveNext())
{
context.CascadeActivationToChild(all.Current);
}
}
示例10: ProcessedByImmediateActivation
private bool ProcessedByImmediateActivation(IActivationContext context)
{
if (!StackIsSmall())
{
return false;
}
if (!context.Depth().RequiresActivation())
{
return true;
}
ObjectReference @ref = context.Transaction().ReferenceForObject(context.TargetObject
());
if (@ref == null)
{
return false;
}
if (HandledInCurrentTopLevelCall(@ref))
{
return true;
}
FlagAsHandled(@ref);
IncStackDepth();
try
{
@ref.ActivateInternal(context);
}
finally
{
DecStackDepth();
}
return true;
}
示例11: StillToActivate
public void StillToActivate(IActivationContext context)
{
// TODO: We don't want the simple classes to search the hc_tree
// Kick them out here.
// if (a_object != null) {
// Class clazz = a_object.getClass();
// if(! clazz.isPrimitive()){
if (ProcessedByImmediateActivation(context))
{
return;
}
_stillToActivate = StillTo1(context.Transaction(), _stillToActivate, context.TargetObject
(), context.Depth());
}
示例12: CascadeActivation
public static void CascadeActivation(IActivationContext context, ITypeHandler4 handler
)
{
if (!(handler is ICascadingTypeHandler))
{
return;
}
((ICascadingTypeHandler)handler).CascadeActivation(context);
}
示例13: EnsureObjectIsActive
private void EnsureObjectIsActive(IActivationContext context)
{
if (!context.Depth().Mode().IsActivate())
{
return;
}
if (Handlers4.IsValueType(GetHandler()))
{
return;
}
ObjectContainerBase container = context.Container();
ClassMetadata classMetadata = container.ClassMetadataForObject(context.TargetObject
());
if (classMetadata == null || !classMetadata.HasIdentity())
{
return;
}
if (container.IsActive(context.TargetObject()))
{
return;
}
container.StillToActivate(context.Descend());
}
示例14: CascadeActivation
public virtual void CascadeActivation(IActivationContext context)
{
if (!ObjectCanActivate(context.Transaction(), context.TargetObject()))
{
return;
}
TraverseAllAspects(new _ITraverseAspectCommand_162(context));
}
示例15: ReadForActivation
private void ReadForActivation(IActivationContext context)
{
Read(context.Transaction(), null, context.TargetObject(), context.Depth(), Const4
.AddMembersToIdTreeOnly, false);
}