本文整理汇总了C#中IInternalObjectContainer类的典型用法代码示例。如果您正苦于以下问题:C# IInternalObjectContainer类的具体用法?C# IInternalObjectContainer怎么用?C# IInternalObjectContainer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IInternalObjectContainer类属于命名空间,在下文中一共展示了IInternalObjectContainer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EnableTransparentPersistenceSupportFor
public virtual void EnableTransparentPersistenceSupportFor(IInternalObjectContainer
container, IRollbackStrategy rollbackStrategy)
{
FlushOnQueryStarted(container);
_rollbackStrategy = rollbackStrategy;
_transparentPersistenceIsEnabled = true;
}
示例2: Apply
public void Apply(IInternalObjectContainer container)
{
#if NET_3_5
My<LinqQueryMonitor>.Instance.Initialize();
#endif
IEventRegistry eventRegistry = EventRegistryFactory.ForObjectContainer(container);
PerformanceCounter unoptimizedNativeQueriesPerSec = Db4oPerformanceCounters.CounterFor(PerformanceCounterSpec.UnoptimizedNativeQueriesPerSec, false);
PerformanceCounter nativeQueriesPerSec = Db4oPerformanceCounters.CounterFor(PerformanceCounterSpec.NativeQueriesPerSec, false);
container.GetNativeQueryHandler().QueryExecution += delegate(object sender, QueryExecutionEventArgs args)
{
if (args.ExecutionKind == QueryExecutionKind.Unoptimized)
unoptimizedNativeQueriesPerSec.Increment();
nativeQueriesPerSec.Increment();
};
eventRegistry.Closing += delegate
{
nativeQueriesPerSec.RemoveInstance();
nativeQueriesPerSec.Dispose();
unoptimizedNativeQueriesPerSec.Dispose();
#if NET_3_5
container.WithEnvironment(delegate
{
My<LinqQueryMonitor>.Instance.Dispose();
});
#endif
};
}
示例3: Apply
// Nothing to do...
/// <summary>internal method, public for implementation reasons.</summary>
/// <remarks>internal method, public for implementation reasons.</remarks>
public virtual void Apply(IInternalObjectContainer objectContainer)
{
if (objectContainer.IsClient)
{
throw new InvalidOperationException(GetType().FullName + " should be configured on the server."
);
}
EventRegistryFactory.ForObjectContainer(objectContainer).Committing += new System.EventHandler<Db4objects.Db4o.Events.CommitEventArgs>
(new _IEventListener4_46(this, objectContainer).OnEvent);
}
示例4: Apply
public void Apply(IInternalObjectContainer container)
{
PerformanceCounter storedObjectsPerSec =
Db4oPerformanceCounters.CounterFor(PerformanceCounterSpec.ObjectsStoredPerSec, false);
PerformanceCounter activatedObjectsPerSec =
Db4oPerformanceCounters.CounterFor(PerformanceCounterSpec.ObjectsActivatedPerSec, false);
PerformanceCounter deactivatedObjectsPerSec =
Db4oPerformanceCounters.CounterFor(PerformanceCounterSpec.ObjectsDeactivatedPerSec, false);
IEventRegistry eventRegistry = EventRegistryFactory.ForObjectContainer(container);
EventHandler<ObjectInfoEventArgs> eventHandler = delegate
{
storedObjectsPerSec.Increment();
};
eventRegistry.Created += eventHandler;
eventRegistry.Updated += eventHandler;
eventRegistry.Activated += delegate
{
activatedObjectsPerSec.Increment();
};
eventRegistry.Deactivated += delegate
{
deactivatedObjectsPerSec.Increment();
};
eventRegistry.Closing += delegate
{
storedObjectsPerSec.Dispose();
activatedObjectsPerSec.Dispose();
deactivatedObjectsPerSec.Dispose();
storedObjectsPerSec.RemoveInstance();
};
if (container.IsClient)
{
return;
}
PerformanceCounter deletedObjectsPerSec =
Db4oPerformanceCounters.CounterFor(PerformanceCounterSpec.ObjectsDeletedPerSec, false);
eventRegistry.Deleted += delegate
{
deletedObjectsPerSec.Increment();
};
eventRegistry.Closing += delegate
{
deletedObjectsPerSec.Dispose();
};
}
示例5: Apply
// Nothing to do...
/// <summary>
/// Configures the just opened ObjectContainer by setting event listeners,
/// which will be triggered when activation or de-activation is required.
/// </summary>
/// <remarks>
/// Configures the just opened ObjectContainer by setting event listeners,
/// which will be triggered when activation or de-activation is required.
/// </remarks>
/// <param name="container">the ObjectContainer to configure</param>
/// <seealso cref="TransparentPersistenceSupport.Apply(Db4objects.Db4o.Internal.IInternalObjectContainer)
/// ">
/// TransparentPersistenceSupport.Apply(Db4objects.Db4o.Internal.IInternalObjectContainer)
/// </seealso>
public virtual void Apply(IInternalObjectContainer container)
{
if (IsTransparentActivationEnabledOn(container))
{
return;
}
var provider = new TransparentActivationDepthProviderImpl
();
SetActivationDepthProvider(container, provider);
var registry = EventRegistryFor(container);
registry.Instantiated += new _IEventListener4_45(this).OnEvent;
registry.Created += new _IEventListener4_50(this).OnEvent;
registry.Closing += new _IEventListener4_56(this).OnEvent;
var processor = new TADiagnosticProcessor
(this, container);
registry.ClassRegistered += new _IEventListener4_67(processor).OnEvent;
}
示例6: Apply
public void Apply(IInternalObjectContainer container)
{
if (!(container is LocalObjectContainer) || container.ConfigImpl.IsReadOnly())
{
return;
}
var localObjectContainer = (LocalObjectContainer) container;
var freespaceManager = localObjectContainer.FreespaceManager();
var freespaceListener = new FreespaceListener(localObjectContainer);
freespaceManager.Traverse(new FreespaceInitializingVisitor(freespaceListener));
var eventRegistry = EventRegistryFactory.ForObjectContainer(container);
eventRegistry.Closing += delegate
{
freespaceListener.Dispose();
freespaceManager.Listener(NullFreespaceListener.Instance);
};
freespaceManager.Listener(freespaceListener);
}
示例7: Apply
// Nothing to do...
/// <summary>
/// Configures the just opened ObjectContainer by setting event listeners,
/// which will be triggered when activation or de-activation is required.
/// </summary>
/// <remarks>
/// Configures the just opened ObjectContainer by setting event listeners,
/// which will be triggered when activation or de-activation is required.
/// </remarks>
/// <param name="container">the ObjectContainer to configure</param>
/// <seealso cref="TransparentPersistenceSupport.Apply(Db4objects.Db4o.Internal.IInternalObjectContainer)
/// ">TransparentPersistenceSupport.Apply(Db4objects.Db4o.Internal.IInternalObjectContainer)
/// </seealso>
public virtual void Apply(IInternalObjectContainer container)
{
if (IsTransparentActivationEnabledOn(container))
{
return;
}
TransparentActivationDepthProviderImpl provider = new TransparentActivationDepthProviderImpl
();
SetActivationDepthProvider(container, provider);
IEventRegistry registry = EventRegistryFor(container);
registry.Instantiated += new System.EventHandler<Db4objects.Db4o.Events.ObjectInfoEventArgs>
(new _IEventListener4_45(this).OnEvent);
registry.Created += new System.EventHandler<Db4objects.Db4o.Events.ObjectInfoEventArgs>
(new _IEventListener4_50(this).OnEvent);
registry.Closing += new System.EventHandler<Db4objects.Db4o.Events.ObjectContainerEventArgs>
(new _IEventListener4_56(this).OnEvent);
TransparentActivationSupport.TADiagnosticProcessor processor = new TransparentActivationSupport.TADiagnosticProcessor
(this, container);
registry.ClassRegistered += new System.EventHandler<Db4objects.Db4o.Events.ClassEventArgs>
(new _IEventListener4_67(processor).OnEvent);
}
示例8: SetActivationDepthProvider
private void SetActivationDepthProvider(IInternalObjectContainer container, IActivationDepthProvider
provider)
{
container.ConfigImpl.ActivationDepthProvider(provider);
}
示例9: Db4oSignatureMap
internal Db4oSignatureMap(IInternalObjectContainer stream)
{
_stream = stream;
_identities = new Hashtable4();
}
示例10: Apply
public void Apply(IInternalObjectContainer container)
{
Assert.IsNotNull(container);
_container = container;
}
示例11: Apply
public void Apply(IInternalObjectContainer container)
{
}
示例12: WriteToBuffer
public static ByteArrayBuffer WriteToBuffer(IInternalObjectContainer container, string
str)
{
var buffer = new ByteArrayBuffer(StringIo(container).Length(str));
InternalWrite(container, buffer, str);
return buffer;
}
示例13: ApplyConfigurationItems
public void ApplyConfigurationItems(IInternalObjectContainer container)
{
Hashtable4 items = ConfigurationItems();
if (items == null)
{
return;
}
IEnumerator i = items.Iterator();
while (i.MoveNext())
{
IEntry4 entry = (IEntry4)i.Current;
IConfigurationItem item = (IConfigurationItem)entry.Value();
item.Apply(container);
}
}
示例14: ActivationProvider
protected static IActivationDepthProvider ActivationProvider(IInternalObjectContainer
container)
{
return container.ConfigImpl.ActivationDepthProvider();
}
示例15: Apply
public void Apply(IInternalObjectContainer container)
{
Assert.AreEqual(ObjectContainerCustomNameTestCase.CustomName, container.ToString(
));
}