/// <summary> /// Creates a new instance of <see cref="ReggieBasicViewModel"/>. /// </summary> /// <param name="windowManager"></param> public ReggieBasicViewModel(IWindowManager windowManager, IHelperFactory helperFactory) { if (windowManager == null) { throw new ArgumentNullException("windowManager"); } if (helperFactory == null) { throw new ArgumentNullException("helperFactory"); } m_windowManager = windowManager; m_helperFactory = helperFactory; m_fileAdapter = helperFactory.BuildFileAdapter(); m_assemblyAdapter = helperFactory.BuildAssemblyAdapter(); m_persistence = helperFactory.BuildPersistenceService(); base.DisplayName = m_displayName; }
/// <summary> /// Enable Stateful authentication mode using supplied /// association and session persistence plug-ins. /// </summary> /// <param name="associationManager">IAssociationPersistence object to use while persisting associations from OpenID Providers.</param> /// <param name="sessionManager">ISessionPersistence object to use while persisting user session state.</param> public void EnableStatefulMode(IAssociationPersistence associationManager, ISessionPersistence sessionManager) { if (associationManager == null) { throw new ArgumentNullException("associationManager"); } if (sessionManager == null) { throw new ArgumentNullException("sessionManager"); } StateContainer.AssociationManager = associationManager; StateContainer.SessionManager = sessionManager; StateContainer.AuthMode = AuthenticationMode.Stateful; StateContainer.AssociationManager.Cleanup(); }
/// <summary> /// Dispose all resources. /// </summary> /// <param name="disposing">If true, dispose both managed and unmanaged resources.</param> protected virtual void Dispose(bool disposing) { if (disposing) { openid = null; _SessionManager = null; _AssociationManager = null; } if (listener != null) { listener.Close(); } }
/// <summary> /// Enable Stateful authentication using default (volatile) persistence objects. /// </summary> /// <remarks> /// Uses <see cref="SingularAssociationManager"/> and <see cref="SingularSessionManager"/> /// objects. These are volatile, and all contained data will be destroyed when /// the <see cref="OpenIdDesktopClient"/> object is disposed. /// </remarks> public void EnableStatefulMode() { _StatefulMode = true; _AssociationManager = new SingularAssociationManager(); _SessionManager = new SingularSessionManager(); openid.EnableStatefulMode(_AssociationManager, _SessionManager); }
/// <summary> /// Enable Stateful authentication using supplied persistence objects. /// </summary> /// <param name="associationManager">IAssociationPersistence object to use when persisting associations.</param> /// <param name="sessionManager">ISessionPersistence object to use when persisting per-user data.</param> public void EnableStatefulMode(IAssociationPersistence associationManager, ISessionPersistence sessionManager) { if (associationManager == null) { throw new ArgumentNullException("associationManager"); } if (sessionManager == null) { throw new ArgumentNullException("sessionManager"); } _StatefulMode = true; _AssociationManager = associationManager; _SessionManager = sessionManager; openid.EnableStatefulMode(_AssociationManager, _SessionManager); }
/// <summary> /// Creates a new StateContainer. /// </summary> /// <param name="associationManager">Association persistence manager.</param> /// <param name="sessionManager">Session persistence manager.</param> public StateContainer(IAssociationPersistence associationManager, ISessionPersistence sessionManager) { AssociationManager = associationManager; SessionManager = sessionManager; }