本文整理汇总了C#中ILifecycleManager类的典型用法代码示例。如果您正苦于以下问题:C# ILifecycleManager类的具体用法?C# ILifecycleManager怎么用?C# ILifecycleManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ILifecycleManager类属于命名空间,在下文中一共展示了ILifecycleManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CachingPicoContainer
/// <summary>
/// Creates a new container with a parent container.
/// </summary>
/// <param name="caf"></param>
/// <param name="parent"></param>
/// <param name="lifecycleManager"></param>
public CachingPicoContainer(CachingComponentAdapterFactory caf, IPicoContainer parent,
ILifecycleManager lifecycleManager)
: base(new DefaultPicoContainer(caf, parent, lifecycleManager))
{
this.lifecycleManager = lifecycleManager;
this.caf = caf;
}
示例2: CreatePicoContainer
protected override IMutablePicoContainer CreatePicoContainer(IPicoContainer parent,
ILifecycleManager lifecycleManager)
{
return
new ImplementationHidingCachingPicoContainer(
new CachingComponentAdapterFactory(new DefaultComponentAdapterFactory()), parent, lifecycleManager);
}
示例3: ImplementationHidingCachingPicoContainer
private ImplementationHidingCachingPicoContainer(IPicoContainer parent, CachingComponentAdapterFactory caf,
ILifecycleManager lifecycleManager)
: base(new ImplementationHidingPicoContainer(caf, parent, lifecycleManager))
{
this.caf = caf;
this.lifecycleManager = lifecycleManager;
}
示例4: CollectionMemento
private CollectionMemento(ILifecycleManager lifecycleManager, INakedObjectManager nakedObjectManager, IMetamodelManager metamodel) {
Assert.AssertNotNull(lifecycleManager);
Assert.AssertNotNull(nakedObjectManager);
this.lifecycleManager = lifecycleManager;
this.nakedObjectManager = nakedObjectManager;
this.metamodel = metamodel;
}
示例5: ImplementationHidingPicoContainer
/// <summary>
/// Creates a new container with a parent container.
/// </summary>
/// <param name="caf"></param>
/// <param name="parent"></param>
/// <param name="lifecycleManager"></param>
public ImplementationHidingPicoContainer(IComponentAdapterFactory caf, IPicoContainer parent,
ILifecycleManager lifecycleManager)
: base(new DefaultPicoContainer(caf, parent, lifecycleManager))
{
this.caf = caf;
this.lifecycleManager = lifecycleManager;
}
示例6: TestObject
public TestObject(ILifecycleManager lifecycleManager, IObjectPersistor persistor, INakedObjectAdapter nakedObjectAdapter, ITestObjectFactory factory, ITransactionManager transactionManager)
: base(factory) {
this.lifecycleManager = lifecycleManager;
this.persistor = persistor;
this.transactionManager = transactionManager;
NakedObject = nakedObjectAdapter;
}
示例7: SetProperty
public override void SetProperty(INakedObjectAdapter nakedObjectAdapter, INakedObjectAdapter value, ITransactionManager transactionManager, ISession session, ILifecycleManager lifecycleManager) {
try {
property.SetValue(nakedObjectAdapter.GetDomainObject(), value.GetDomainObject(), null);
}
catch (TargetInvocationException e) {
InvokeUtils.InvocationException("Exception executing " + property, e);
}
}
示例8: Invoke
public override void Invoke(INakedObjectAdapter nakedObjectAdapter, ISession session, ILifecycleManager lifecycleManager, IMetamodelManager metamodelManager) {
profileManager.Begin(session, associatedEvent, "", nakedObjectAdapter, lifecycleManager);
try {
underlyingFacet.Invoke(nakedObjectAdapter, session, lifecycleManager, metamodelManager);
}
finally {
profileManager.End(session, associatedEvent, "", nakedObjectAdapter, lifecycleManager);
}
}
示例9: Invoke
public override INakedObjectAdapter Invoke(INakedObjectAdapter nakedObjectAdapter, INakedObjectAdapter[] parameters, int resultPage, ILifecycleManager lifecycleManager, IMetamodelManager manager, ISession session, INakedObjectManager nakedObjectManager, IMessageBroker messageBroker, ITransactionManager transactionManager) {
profileManager.Begin(session, ProfileEvent.ActionInvocation, identifier.MemberName, nakedObjectAdapter, lifecycleManager);
try {
return underlyingFacet.Invoke(nakedObjectAdapter, parameters, resultPage, lifecycleManager, manager, session, nakedObjectManager, messageBroker, transactionManager);
}
finally {
profileManager.End(session, ProfileEvent.ActionInvocation, identifier.MemberName, nakedObjectAdapter, lifecycleManager);
}
}
示例10: TestObjectFactory
public TestObjectFactory(IMetamodelManager metamodelManager, ISession session, ILifecycleManager lifecycleManager, IObjectPersistor persistor, INakedObjectManager manager, ITransactionManager transactionManager, IServicesManager servicesManager, IMessageBroker messageBroker) {
this.metamodelManager = metamodelManager;
Session = session;
this.lifecycleManager = lifecycleManager;
this.persistor = persistor;
this.manager = manager;
this.transactionManager = transactionManager;
this.servicesManager = servicesManager;
this.messageBroker = messageBroker;
}
示例11: IsEditable
public bool IsEditable(ISession session, ILifecycleManager lifecycleManager, INakedObjectAdapter target, IIdentifier identifier) {
object authorizer = GetAuthorizer(target, lifecycleManager);
Type authType = authorizer.GetType();
if ((typeof(INamespaceAuthorizer)).IsAssignableFrom(authType)) {
var nameAuth = (INamespaceAuthorizer) authorizer;
return nameAuth.IsEditable(session.Principal, target.Object, identifier.MemberName);
}
return isEditableDelegates[authType](authorizer, session.Principal, target.GetDomainObject(), identifier.MemberName);
}
示例12: DefaultPicoContainer
/// <summary>
/// Creates a new container with a custom ComponentAdapterFactory and a parent container.
/// Important note about caching: If you intend the components to be cached, you should pass
/// in a factory that creates CachingComponentAdapter instances, such as for example
/// other ComponentAdapterFactories.
/// </summary>
/// <param name="componentAdapterFactory">the factory to use for creation of ComponentAdapters.</param>
/// <param name="parent">the parent container (used for component dependency lookups).</param>
/// <param name="lifecycleManager">the lifecycle manager to manage start/stop/dispose calls on the container.</param>
public DefaultPicoContainer(IComponentAdapterFactory componentAdapterFactory, IPicoContainer parent,
ILifecycleManager lifecycleManager)
{
this.lifecycleManager = lifecycleManager;
if (componentAdapterFactory == null)
{
throw new NullReferenceException("componentAdapterFactory");
}
this.componentAdapterFactory = componentAdapterFactory;
this.parent = parent; // == null ? null : new ImmutablePicoContainer(parent);
}
示例13: TestAction
public TestAction(IMetamodelManager metamodelManager, ISession session, ILifecycleManager lifecycleManager, ITransactionManager transactionManager, string contributor, IActionSpec actionSpec, ITestHasActions owningObject, ITestObjectFactory factory, INakedObjectManager manager, IMessageBroker messageBroker) {
SubMenu = contributor;
this.metamodelManager = metamodelManager;
this.session = session;
this.lifecycleManager = lifecycleManager;
this.transactionManager = transactionManager;
this.messageBroker = messageBroker;
this.owningObject = owningObject;
this.factory = factory;
this.manager = manager;
this.actionSpec = actionSpec;
}
示例14: Invoke
public void Invoke(INakedObjectAdapter nakedObjectAdapter, INakedObjectAdapter[] parameters, bool queryOnly, IIdentifier identifier, ISession session, ILifecycleManager lifecycleManager) {
IAuditor auditor = GetAuditor(nakedObjectAdapter, lifecycleManager);
IPrincipal byPrincipal = session.Principal;
string memberName = identifier.MemberName;
if (nakedObjectAdapter.Spec is IServiceSpec) {
string serviceName = nakedObjectAdapter.Spec.GetTitle(nakedObjectAdapter);
auditor.ActionInvoked(byPrincipal, memberName, serviceName, queryOnly, parameters.Select(no => no.GetDomainObject()).ToArray());
}
else {
auditor.ActionInvoked(byPrincipal, memberName, nakedObjectAdapter.GetDomainObject(), queryOnly, parameters.Select(no => no.GetDomainObject()).ToArray());
}
}
示例15: Initialize
// ReSharper disable ParameterHidesMember
public void Initialize(IMetamodelManager metamodelManager, ISession session, ILifecycleManager lifecycleManager, IObjectPersistor persistor, INakedObjectManager nakedObjectManager) {
// ReSharper restore ParameterHidesMember
Assert.AssertNotNull(metamodelManager);
Assert.AssertNotNull(session);
Assert.AssertNotNull(lifecycleManager);
Assert.AssertNotNull(persistor);
Assert.AssertNotNull(nakedObjectManager);
this.metamodelManager = metamodelManager;
this.session = session;
this.lifecycleManager = lifecycleManager;
this.persistor = persistor;
this.nakedObjectManager = nakedObjectManager;
isInitialized = true;
}