本文整理汇总了C#中Util.GetCustomHeaderHTML方法的典型用法代码示例。如果您正苦于以下问题:C# Util.GetCustomHeaderHTML方法的具体用法?C# Util.GetCustomHeaderHTML怎么用?C# Util.GetCustomHeaderHTML使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Util
的用法示例。
在下文中一共展示了Util.GetCustomHeaderHTML方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
Util util = new Util();
Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
if (util.CheckSessionTimeout(State, Response, "../../Default.aspx")) return;
try
{
Message.Text = "";
State["CustomHeaderHTML"]= Header.Text = util.GetCustomHeaderHTML(State);
Upload.Attributes.Add("onclick", "NamedPopUp('UploadCustomHeaderHtml.aspx','UploadCustomHeaderHtmlPopup' ,'height=150, width=500, menubar=no, status=no, location=no, toolbar=no, scrollbars=yes, resizable=yes');return false;");
}
catch (Exception ex)
{
util.ProcessMainExceptions((Hashtable)HttpRuntime.Cache[Session.SessionID], Response, ex);
}
}
示例2: GetWebApp
public string GetWebApp(Hashtable State,XmlDocument xmlDoc, double x_size_factor,double y_size_factor )
{
try
{
XmlUtil x_util = new XmlUtil();
Util util = new Util();
DataSources DS = new DataSources();
HtmlDocument htmlDoc = new HtmlDocument();
//Load App Foundation
StringBuilder NewWebAppHtml = new StringBuilder( HttpRuntime.Cache["NewWebAppHtml"].ToString());
if (State["IsProduction"] == null)
State["IsProduction"] = false;
if ((bool)State["IsProduction"]== true)
{
string production_app_name = util.GetProductionAppName(State);
NewWebAppHtml.Replace("CUSTOM_TITLE", production_app_name);
}
else
{
NewWebAppHtml.Replace("CUSTOM_TITLE", State["SelectedApp"].ToString());
}
/*if(false)
{
NewWebAppHtml.Replace("ADDON_VIZIAPPS_SCRIPTS", HttpRuntime.Cache["ShareThisScripts"].ToString());
}
else*/
NewWebAppHtml.Replace("ADDON_VIZIAPPS_SCRIPTS", "");
//add custom header html
NewWebAppHtml.Replace("CUSTOM_ACCOUNT_HEADER",util.GetCustomHeaderHTML(State));
htmlDoc.LoadHtml(NewWebAppHtml.ToString());
HtmlNode root = htmlDoc.DocumentNode;
//Load Custom App Init
StringBuilder customInitScript = new StringBuilder();
string application_id = util.GetAppID(State);
customInitScript.Append("var app_id = '" + application_id + "';\n");
string app_time_stamp = null;
if ((bool)State["IsProduction"] == false)
app_time_stamp = util.GetStagingAppTimeStamp(State, application_id);
else
app_time_stamp = util.GetProductionAppTimeStamp(State, application_id);
if (State["SelectedDeviceType"] == null)
State["SelectedDeviceType"] = Constants.IPHONE;
customInitScript.Append("\tvar app_time_stamp = '" + app_time_stamp + "';\n");
customInitScript.Append("\tvar customer_id = '" + State["CustomerID"].ToString() + "';\n");
customInitScript.Append("\tvar customer = '" + State["Username"].ToString() + "';\n");
customInitScript.Append("\tvar app_name = '" + State["SelectedApp"].ToString() + "';\n");
customInitScript.Append("\tvar design_device_type = '" + State["SelectedDeviceType"].ToString().ToLower() + "';\n");
string viziapps_transition_type = null;
if(State["PageTransitionType"] != null)
viziapps_transition_type = State["PageTransitionType"].ToString();
else
viziapps_transition_type ="slide";
customInitScript.Append("\tvar viziapps_transition_type = '" + viziapps_transition_type + "';\n");
switch (State["SelectedDeviceType"].ToString())
{
case Constants.IPHONE:
case Constants.ANDROID_PHONE:
default:
customInitScript.Append("\tvar ios_landscape_width_factor = " + Constants.IPHONE_LANDSCAPE_WIDTH_FACTOR + ";\n");
customInitScript.Append("\tvar ios_landscape_height_factor = " + Constants.IPHONE_LANDSCAPE_HEIGHT_FACTOR + ";\n");
customInitScript.Append("\tvar android_landscape_width_factor = " + Constants.ANDROID_PHONE_LANDSCAPE_WIDTH_FACTOR + ";\n");
customInitScript.Append("\tvar android_landscape_height_factor = " + Constants.ANDROID_PHONE_LANDSCAPE_HEIGHT_FACTOR + ";\n");
break;
case Constants.ANDROID_TABLET:
case Constants.IPAD:
customInitScript.Append("\tvar ios_landscape_width_factor = " + Constants.IPAD_LANDSCAPE_WIDTH_FACTOR + ";\n");
customInitScript.Append("\tvar ios_landscape_height_factor = " + Constants.IPAD_LANDSCAPE_HEIGHT_FACTOR + ";\n");
customInitScript.Append("\tvar android_landscape_width_factor = " + Constants.ANDROID_TABLET_LANDSCAPE_WIDTH_FACTOR + ";\n");
customInitScript.Append("\tvar android_landscape_height_factor = " + Constants.ANDROID_TABLET_LANDSCAPE_HEIGHT_FACTOR + ";\n");
break;
}
if((bool)State["IsProduction"])
customInitScript.Append("\tvar is_production = true;\n");
else
customInitScript.Append("\tvar is_production = false;\n");
string device_type = x_util.GetAppDeviceType(State);
if (device_type == Constants.IPAD || device_type == Constants.ANDROID_TABLET)
customInitScript.Append("\tvar does_background_image_exist = false;\n");
else
customInitScript.Append("\tvar does_background_image_exist = true;\n");
if (DS.DoesAppUseGoogleSpreadsheets(State))
{
customInitScript.Append("\tvar doesAppUseGoogleSpreadsheets = true;\n");
customInitScript.Append("\tvar isGoogleDataLoaded = false;\n");
customInitScript.Append("google.load('gdata', '2.x');\n");
customInitScript.Append("google.setOnLoadCallback(onGoogleDataLoad);\n");
customInitScript.Append("function onGoogleDataLoad() {isGoogleDataLoaded=true;}\n");
}
//.........这里部分代码省略.........