本文整理汇总了C#中ILifecycleManager类的典型用法代码示例。如果您正苦于以下问题:C# ILifecycleManager类的具体用法?C# ILifecycleManager怎么用?C# ILifecycleManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ILifecycleManager类属于命名空间,在下文中一共展示了ILifecycleManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:smmckay,项目名称:picocontainer,代码行数:13,代码来源:CachingPicoContainer.cs
示例2: CreatePicoContainer
protected override IMutablePicoContainer CreatePicoContainer(IPicoContainer parent,
ILifecycleManager lifecycleManager)
{
return
new ImplementationHidingCachingPicoContainer(
new CachingComponentAdapterFactory(new DefaultComponentAdapterFactory()), parent, lifecycleManager);
}
开发者ID:smmckay,项目名称:picocontainer,代码行数:7,代码来源:ImplementationHidingCachingPicoContainerTestCase.cs
示例3: ImplementationHidingCachingPicoContainer
private ImplementationHidingCachingPicoContainer(IPicoContainer parent, CachingComponentAdapterFactory caf,
ILifecycleManager lifecycleManager)
: base(new ImplementationHidingPicoContainer(caf, parent, lifecycleManager))
{
this.caf = caf;
this.lifecycleManager = lifecycleManager;
}
开发者ID:smmckay,项目名称:picocontainer,代码行数:7,代码来源:ImplementationHidingCachingPicoContainer.cs
示例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;
}
开发者ID:Robin--,项目名称:NakedObjectsFramework,代码行数:7,代码来源:CollectionMemento.cs
示例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;
}
开发者ID:smmckay,项目名称:picocontainer,代码行数:13,代码来源:ImplementationHidingPicoContainer.cs
示例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;
}
开发者ID:NakedObjectsGroup,项目名称:NakedObjectsFramework,代码行数:7,代码来源:TestObject.cs
示例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);
}
}
开发者ID:Robin--,项目名称:NakedObjectsFramework,代码行数:8,代码来源:PropertySetterFacetViaSetterMethod.cs
示例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);
}
}
开发者ID:Robin--,项目名称:NakedObjectsFramework,代码行数:9,代码来源:ProfileCallbackFacet.cs
示例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);
}
}
开发者ID:NakedObjectsGroup,项目名称:NakedObjectsFramework,代码行数:9,代码来源:ProfileActionInvocationFacet.cs
示例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;
}
开发者ID:Robin--,项目名称:NakedObjectsFramework,代码行数:10,代码来源:TestObjectFactory.cs
示例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);
}
开发者ID:Robin--,项目名称:NakedObjectsFramework,代码行数:10,代码来源:AuthorizationManager.cs
示例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);
}
开发者ID:smmckay,项目名称:picocontainer,代码行数:20,代码来源:DefaultPicoContainer.cs
示例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;
}
开发者ID:Robin--,项目名称:NakedObjectsFramework,代码行数:12,代码来源:TestAction.cs
示例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());
}
}
开发者ID:Robin--,项目名称:NakedObjectsFramework,代码行数:13,代码来源:AuditManager.cs
示例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;
}
开发者ID:Robin--,项目名称:NakedObjectsFramework,代码行数:16,代码来源:NakedObjectFactory.cs
示例16: Invoke
public override INakedObjectAdapter Invoke(INakedObjectAdapter inObjectAdapter, INakedObjectAdapter[] parameters, ILifecycleManager lifecycleManager, IMetamodelManager manager, ISession session, INakedObjectManager nakedObjectManager, IMessageBroker messageBroker, ITransactionManager transactionManager) {
if (parameters.Length != paramCount) {
Log.Error(actionMethod + " requires " + paramCount + " parameters, not " + parameters.Length);
}
object result;
if (actionDelegate != null) {
result = actionDelegate(inObjectAdapter.GetDomainObject(), parameters.Select(no => no.GetDomainObject()).ToArray());
}
else {
Log.WarnFormat("Invoking action via reflection as no delegate {0}.{1}", onType, actionMethod);
result = InvokeUtils.Invoke(actionMethod, inObjectAdapter, parameters);
}
INakedObjectAdapter adaptedResult = nakedObjectManager.CreateAdapter(result, null, null);
return adaptedResult;
}
开发者ID:NakedObjectsGroup,项目名称:NakedObjectsFramework,代码行数:18,代码来源:ActionInvocationFacetViaMethod.cs
示例17: GetAuthorizer
private object GetAuthorizer(INakedObjectAdapter target, ILifecycleManager lifecycleManager) {
Assert.AssertNotNull(target);
//Look for exact-fit TypeAuthorizer
string fullyQualifiedOfTarget = target.Spec.FullName;
Type authorizer = typeAuthorizers.
Where(ta => ta.Key == fullyQualifiedOfTarget).
Select(ta => ta.Value).
FirstOrDefault() ??
// already ordered OrderByDescending(x => x.Key.Length).
namespaceAuthorizers.
Where(x => fullyQualifiedOfTarget.StartsWith(x.Key)).
Select(x => x.Value).
FirstOrDefault() ??
defaultAuthorizer;
return CreateAuthorizer(authorizer, lifecycleManager);
}
开发者ID:Robin--,项目名称:NakedObjectsFramework,代码行数:18,代码来源:AuthorizationManager.cs
示例18: Invoke
public override void Invoke(INakedObjectAdapter nakedObjectAdapter, ISession session, ILifecycleManager lifecycleManager, IMetamodelManager metamodelManager) {
createdDelegate(nakedObjectAdapter.GetDomainObject());
}
开发者ID:Robin--,项目名称:NakedObjectsFramework,代码行数:3,代码来源:CreatedCallbackFacetViaMethod.cs
示例19: Invoke
public override void Invoke(INakedObjectAdapter nakedObjectAdapter, ISession session, ILifecycleManager lifecycleManager, IMetamodelManager metamodelManager) {}
开发者ID:Robin--,项目名称:NakedObjectsFramework,代码行数:1,代码来源:UpdatingCallbackFacetNull.cs
示例20: CreateAuthorizer
private object CreateAuthorizer(Type type, ILifecycleManager lifecycleManager) {
return lifecycleManager.CreateNonAdaptedInjectedObject(type);
}
开发者ID:Robin--,项目名称:NakedObjectsFramework,代码行数:3,代码来源:AuthorizationManager.cs
注:本文中的ILifecycleManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论