本文整理汇总了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;
}
示例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;
}
示例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>;
}
示例4: Broker
public Broker(HttpApplicationState app)
{
this._app = app;
LogUtil.Setup();
StartSuperWebSocketByConfig();
}
示例5: HttpApplicationStateWrapper
public HttpApplicationStateWrapper(System.Web.HttpApplicationState httpApplicationState)
{
if (httpApplicationState == null)
{
throw new ArgumentNullException("httpApplicationState");
}
this._application = httpApplicationState;
}
示例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 );
}
示例7: GetSessionId
private string GetSessionId(HttpApplicationState Application)
{
if (Application["sessionId"] == null)
{
Application.Lock();
Application["sessionId"] = opentok.CreateSession().Id;
Application.UnLock();
}
return (string)Application["sessionId"];
}
示例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;
}
示例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());
}
示例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;
}
示例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;
}
}
}
示例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);
}
示例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);
}
示例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();
}
示例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);
}
}
}