コード例 #1
0
        public CswSessionResourcesNbt(HttpApplicationState HttpApplicationState, HttpRequest HttpRequest, HttpResponse HttpResponse, HttpContext Context, string LoginAccessId, CswEnumSetupMode SetupMode)
        {
            //SuperCycleCache configuraiton has to happen here because here is where we can stash the cache,
            //so to speak, in the wrapper class -- the resource factory is agnostic with respect to cache type
            CswSetupVbls SetupVbls = new CswSetupVbls(CswEnumSetupMode.NbtWeb);

            ICswSuperCycleCache CswSuperCycleCache = new CswSuperCycleCacheWeb(Context.Cache);

            // Set the cache to drop anything 10 minutes old
            CswSuperCycleCache.CacheDirtyThreshold = DateTime.Now.Subtract(new TimeSpan(0, 10, 0));


            CswDbCfgInfo CswDbCfgInfo = new CswDbCfgInfo(CswEnumSetupMode.NbtWeb);

            CswResourcesMaster = new CswResources(CswEnumAppType.Nbt, SetupVbls, CswDbCfgInfo, new CswSuperCycleCacheDefault(), null);
            CswResourcesMaster.SetDbResources(ChemSW.RscAdo.CswEnumPooledConnectionState.Open);
            CswResourcesMaster.AccessId = CswDbCfgInfo.MasterAccessId;

            CswNbtResources = CswNbtResourcesFactory.makeCswNbtResources(CswEnumAppType.Nbt, SetupMode, true, CswSuperCycleCache, RscAdo.CswEnumPooledConnectionState.Open, CswResourcesMaster, CswResourcesMaster.CswLogger);

            bool RecordStatistics = CswConvert.ToBoolean(CswNbtResources.SetupVbls[CswEnumSetupVariableNames.RecordUserStatistics]);

            //Dictionary<string, string> Cookies = new Dictionary<string, string>();
            //foreach( string CookieName in Context.Request.Cookies )
            //{
            //    Cookies[CookieName] = Context.Request.Cookies[CookieName].Value;
            //}

            CswNbtSchemaAuthenticatorFactory AuthenticatorFactory = new CswNbtSchemaAuthenticatorFactory(CswNbtResources);
            ICswSchemaAuthenticater          Authenticator        = AuthenticatorFactory.Make(CswNbtResources.SetupVbls);

            CswSessionManager = new CswSessionManager(CswEnumAppType.Nbt,
                                                      new CswWebClientStorageHttpHeader(HttpRequest, HttpResponse),
                                                      //new CswWebClientStorageCookies( HttpRequest, HttpResponse ),
                                                      LoginAccessId,
                                                      CswNbtResources.SetupVbls,
                                                      CswNbtResources.CswDbCfgInfo,
                                                      CswNbtResources,
                                                      CswResourcesMaster,
                                                      Authenticator,
                                                      //Cookies,
                                                      _CswNbtStatistics = new CswNbtStatistics(new CswNbtStatisticsStorageDb(CswNbtResources),
                                                                                               new CswNbtStatisticsStorageStateServer(),
                                                                                               RecordStatistics));
            CswNbtResources.CswSessionManager = CswSessionManager;
            CswNbtStatisticsEvents            = _CswNbtStatistics.CswNbtStatisticsEvents;

            CswSessionManager.OnDeauthenticate += new CswSessionManager.DeathenticationHandler(OnDeauthenticate);

            CswNbtResources.AccessId = CswSessionManager.AccessId;
        }//ctor()
コード例 #2
0
 public void MyTestInitialize()
 {
     _CswResources = CswResourceFactory.make(AppType.Nbt, SetupMode.TestProject, false, false);
 }
コード例 #3
0
 public void MyTestInitialize()
 {
     _CswResources = CswResourceFactory.make(CswEnumAppType.Nbt, CswEnumSetupMode.TestProject);
 }