當前位置: 首頁>>代碼示例>>C#>>正文


C# Web.HttpApplicationState類代碼示例

本文整理匯總了C#中System.Web.HttpApplicationState的典型用法代碼示例。如果您正苦於以下問題:C# HttpApplicationState類的具體用法?C# HttpApplicationState怎麽用?C# HttpApplicationState使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


HttpApplicationState類屬於System.Web命名空間,在下文中一共展示了HttpApplicationState類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: HttpApplicationStateWrapper

 public HttpApplicationStateWrapper(HttpApplicationState httpApplicationState)
 {
     if (httpApplicationState == null) {
         throw new ArgumentNullException("httpApplicationState");
     }
     _application = httpApplicationState;
 }
開發者ID:frenzypeng,項目名稱:securityswitch,代碼行數:7,代碼來源:HttpApplicationStateWrapper.cs

示例2: Parent

 // 12/22/2007 Paul.  Inside the timer event, there is no current context, so we need to pass the application.
 public static DataTable Parent(HttpApplicationState Application, string sPARENT_TYPE, Guid gPARENT_ID)
 {
     DataTable dt = new DataTable();
     string sTABLE_NAME = Sql.ToString(Application["Modules." + sPARENT_TYPE + ".TableName"]);
     if ( !Sql.IsEmptyString(sTABLE_NAME) )
     {
         DbProviderFactory dbf = DbProviderFactories.GetFactory(Application);
         using ( IDbConnection con = dbf.CreateConnection() )
         {
             con.Open();
             string sSQL;
             sSQL = "select *"                + ControlChars.CrLf
                  + "  from vw" + sTABLE_NAME + ControlChars.CrLf
                  + " where ID = @ID"         + ControlChars.CrLf;
             using ( IDbCommand cmd = con.CreateCommand() )
             {
                 cmd.CommandText = sSQL;
                 Sql.AddParameter(cmd, "@ID", gPARENT_ID);
                 using ( DbDataAdapter da = dbf.CreateDataAdapter() )
                 {
                     ((IDbDataAdapter)da).SelectCommand = cmd;
                     da.Fill(dt);
                 }
             }
         }
     }
     return dt;
 }
開發者ID:NALSS,項目名稱:splendidcrm-99885,代碼行數:29,代碼來源:Crm.cs

示例3: GetRoles

        public static List<Bubis.Andika.DAL.EF.Roles> GetRoles(HttpApplicationState application)
        {
            if (!RolesIsLoaded(application))
                LoadRoles(application);

            return application[ROLES_PAGES] as List<Bubis.Andika.DAL.EF.Roles>;
        }
開發者ID:BoccaDamian,項目名稱:bubis,代碼行數:7,代碼來源:ApplicationHelper.cs

示例4: Broker

        public Broker(HttpApplicationState app)
        {
            this._app = app;
            LogUtil.Setup();
            StartSuperWebSocketByConfig();

        }
開發者ID:herohut,項目名稱:elab,代碼行數:7,代碼來源:Server.Broker.cs

示例5: HttpApplicationStateWrapper

 public HttpApplicationStateWrapper(System.Web.HttpApplicationState httpApplicationState)
 {
     if (httpApplicationState == null)
     {
         throw new ArgumentNullException("httpApplicationState");
     }
     this._application = httpApplicationState;
 }
開發者ID:netcasewqs,項目名稱:nlite.web,代碼行數:8,代碼來源:HttpApplicationStateWrapper.cs

示例6: OnStart

 public static void OnStart( HttpApplicationState appState )
 {
     // Uncomment to debug bootstrapping process.
     // Note: IIS 7 starts up far too fast for Visual Studio to attach.  If you need to
     //       Debug the bootstrapping process then you need to uncomment this line of code,
     //       connect to Rem through the browser.  This statement will force a debugger to
     //       attach to the worker process and enable you to debug.
     //System.Diagnostics.Debugger.Launch();
     new Bootstrapper().Run ( appState );
 }
開發者ID:divyang4481,項目名稱:REM,代碼行數:10,代碼來源:Global.asax.cs

示例7: GetSessionId

 private string GetSessionId(HttpApplicationState Application)
 {
     if (Application["sessionId"] == null)
     {
         Application.Lock();
         Application["sessionId"] = opentok.CreateSession().Id;
         Application.UnLock();
     }
     return (string)Application["sessionId"];
 }
開發者ID:jeffswartz,項目名稱:OpenTok-DotNet,代碼行數:10,代碼來源:HomeController.cs

示例8: initAssociationManager

 // todo: serialize access to this method
 private SingularAssociationManager initAssociationManager(HttpApplicationState application)
 {
     SingularAssociationManager returnValue = (SingularAssociationManager)application["dossia.openid.associationManager"];
     if (returnValue == null)
     {
         returnValue = new SingularAssociationManager();
         application["dossia.openid.associationManager"] = returnValue;
     }
     return returnValue;
 }
開發者ID:bewest,項目名稱:dossia.org-examples,代碼行數:11,代碼來源:DossiaOpenID.cs

示例9: Term

		// 08/17/2005   Special Term function that helps with a list. 
		public static object Term(HttpApplicationState Application, string sCultureName, string sListName, object oField)
		{
			// 01/11/2008   Protect against uninitialized variables. 
			if ( String.IsNullOrEmpty(sListName) )
				return String.Empty;

			if ( oField == null || oField == DBNull.Value )
				return oField;
			// 11/28/2005   Convert field to string instead of cast.  Cast will not work for integer fields. 
			return Term(Application, sCultureName, sListName + oField.ToString());
		}
開發者ID:huamouse,項目名稱:Taoqi,代碼行數:12,代碼來源:L10n.cs

示例10: BootcampCore

        public BootcampCore([NotNull] HttpServerUtility server, [NotNull] HttpApplicationState application, [CanBeNull] HttpResponse response, BootcampMode mode, bool noisy)
        {
            Assert.ArgumentNotNull(server, "server");
              Assert.ArgumentNotNull(application, "application");

              this.Server = server;
              this.Application = application;
              this.Response = response;
              this.Mode = mode;
              this.Noisy = noisy;
        }
開發者ID:Sitecore,項目名稱:Sitecore-Bootcamp,代碼行數:11,代碼來源:BootcampCore.cs

示例11: Process

        public static void Process(HttpApplicationState Application)
        {
            if ( !bInsideWorkflow )
            {
                bInsideWorkflow = true;
                try
                {
                    //SplendidError.SystemMessage(Application, "Warning", new StackTrace(true).GetFrame(0), "WorkflowUtils.Process Begin");

                    spWORKFLOW_EVENTS_ProcessAll(Application);
                    /*
                    DbProviderFactory dbf = DbProviderFactories.GetFactory(Application);
                    using ( IDbConnection con = dbf.CreateConnection() )
                    {
                        string sSQL ;
                        sSQL = "select *                " + ControlChars.CrLf
                             + "  from vwWORKFLOW_EVENTS" + ControlChars.CrLf
                             + " order by AUDIT_VERSION " + ControlChars.CrLf;
                        using ( IDbCommand cmd = con.CreateCommand() )
                        {
                            cmd.CommandText = sSQL;
                            con.Open();

                            using ( DbDataAdapter da = dbf.CreateDataAdapter() )
                            {
                                ((IDbDataAdapter)da).SelectCommand = cmd;
                                using ( DataTable dt = new DataTable() )
                                {
                                    da.Fill(dt);
                                    if ( dt.Rows.Count > 0 )
                                        SplendidError.SystemMessage(Application, "Warning", new StackTrace(true).GetFrame(0), "Processing " + dt.Rows.Count.ToString() + " workflow events");
                                    foreach ( DataRow row in dt.Rows )
                                    {
                                        Guid gID = Sql.ToGuid(row["ID"]);
                                        // 12/30/2007 Paul.  We are not going to do anything yet, but we do need to clean up the table.
                                        spWORKFLOW_EVENTS_Delete(Application, gID);
                                    }
                                }
                            }
                        }
                    }
                    */
                }
                catch(Exception ex)
                {
                    SplendidError.SystemMessage(Application, "Error", new StackTrace(true).GetFrame(0), Utils.ExpandException(ex));
                }
                finally
                {
                    bInsideWorkflow = false;
                }
            }
        }
開發者ID:NALSS,項目名稱:splendidcrm-99885,代碼行數:53,代碼來源:WorkflowUtils.cs

示例12: Culture

 // 12/22/2007 Paul.  Inside the timer event, there is no current context, so we need to pass the application.
 public static string Culture(HttpApplicationState Application)
 {
     string sCulture = Sql.ToString(Application["CONFIG.default_language"]);
     // 12/22/2007 Paul.  The cache is not available when we are inside the timer event.
     if ( HttpContext.Current != null && HttpContext.Current.Cache != null )
     {
         DataView vwLanguages = new DataView(SplendidCache.Languages());
         vwLanguages.RowFilter = "NAME = '" + sCulture +"'";
         if ( vwLanguages.Count > 0 )
             sCulture = Sql.ToString(vwLanguages[0]["NAME"]);
     }
     if ( Sql.IsEmptyString(sCulture) )
         sCulture = "en-US";
     return L10N.NormalizeCulture(sCulture);
 }
開發者ID:NALSS,項目名稱:splendidcrm-99885,代碼行數:16,代碼來源:SplendidDefaults.cs

示例13: Culture

		// 12/22/2007   Inside the timer event, there is no current context, so we need to pass the application. 
		public static string Culture(HttpApplicationState Application)
		{
			string sCulture = Sql.ToString(Application["CONFIG.default_language"]);
			// 12/22/2007   The cache is not available when we are inside the timer event. 
			// 02/18/2008   The Languages function is now thread safe, so it can be called from the timer. 
			//if ( HttpContext.Current != null && HttpContext.Current.Cache != null )
			{
				DataView vwLanguages = new DataView(SplendidCache.Languages(Application));
				// 05/20/2008   Normalize culture before lookup. 
				vwLanguages.RowFilter = "NAME = '" + L10N.NormalizeCulture(sCulture) +"'";
				if ( vwLanguages.Count > 0 )
					sCulture = Sql.ToString(vwLanguages[0]["NAME"]);
			}
			if ( Sql.IsEmptyString(sCulture) )
				sCulture = "en-US";
			return L10N.NormalizeCulture(sCulture);
		}
開發者ID:huamouse,項目名稱:Taoqi,代碼行數:18,代碼來源:SplendidDefaults.cs

示例14: CompileApplication

 private void CompileApplication()
 {
     this._theApplicationType = BuildManager.GetGlobalAsaxType();
     BuildResultCompiledGlobalAsaxType globalAsaxBuildResult = BuildManager.GetGlobalAsaxBuildResult();
     if (globalAsaxBuildResult != null)
     {
         if (globalAsaxBuildResult.HasAppOrSessionObjects)
         {
             this.GetAppStateByParsingGlobalAsax();
         }
         this._fileDependencies = globalAsaxBuildResult.VirtualPathDependencies;
     }
     if (this._state == null)
     {
         this._state = new HttpApplicationState();
     }
     this.ReflectOnApplicationType();
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:18,代碼來源:HttpApplicationFactory.cs

示例15: CheckForUpdates

        internal static async void CheckForUpdates(HttpApplicationState application)
        {
            bool autoSuggestUpdate =
                Conversion.TryCastBoolean(ConfigurationHelper.GetUpdaterParameter("AutoSuggestUpdate"));

            if (autoSuggestUpdate)
            {
                try
                {
                    Updater.UpdateManager updater = new Updater.UpdateManager();
                    Release release = await updater.GetLatestReleaseAsync();

                    if (release != null)
                    {
                        application["UpdateAvailable"] = true;
                    }
                }
                catch (Exception ex)
                {
                    Log.Error("Exception occurred. {Exception}.", ex);
                }
            }
        }
開發者ID:njmube,項目名稱:mixerp,代碼行數:23,代碼來源:UpdateManager.cs


注:本文中的System.Web.HttpApplicationState類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。