本文整理汇总了C#中Util.SavePageImage方法的典型用法代码示例。如果您正苦于以下问题:C# Util.SavePageImage方法的具体用法?C# Util.SavePageImage怎么用?C# Util.SavePageImage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Util
的用法示例。
在下文中一共展示了Util.SavePageImage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShowPage
public void ShowPage(string page_name)
{
PageName.Text = page_name;
try
{
XmlUtil x_util = new XmlUtil();
Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
if (State["SelectedDeviceType"] == null /*|| State["SelectedDeviceView"] == null*/)
{
string device_type = x_util.GetAppDeviceType(State);
State["SelectedDeviceType"] = device_type;
// State["SelectedDeviceView"] = device_type;
DeviceType.Text = State["SelectedDeviceType"].ToString();
}
if (page_name != null)
{
string html = x_util.GetAppPage(State, page_name);
if (html.StartsWith("Error:"))
{
Message.Text = html;
return;
}
State["PageHtml"] = html;
Util util = new Util();
if (State["DoSavePage"] != null)
{
State["DoSavePage"] = null;
util.SavePageImage(State, page_name, html);
}
DefaultButtonImage.Text = util.GetDefaultButton(State);
}
else
{
State["PageHtml"] = "";
DefaultButtonImage.Text = ConfigurationManager.AppSettings["DefaultWebAppButtonImage"];
}
}
catch (Exception ex)
{
Util util = new Util();
Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
util.LogError(State, ex);
Message.Text = "Internal Error: " + ex.Message + ": " + ex.StackTrace;
}
}
示例2: EncodeAppPageToAppXml
public Hashtable EncodeAppPageToAppXml(Hashtable State, string page_name, string html)
{
XmlDocument doc = GetStagingAppXml(State);
State["AppXmlDoc"] = doc;
XmlNode configuration_node = doc.SelectSingleNode("//configuration");
//save background
if (State["BackgroundImageUrl"] != null)
{
string background_image = State["BackgroundImageUrl"].ToString();
XmlNode background_image_node = configuration_node.SelectSingleNode("background_image");
if (background_image_node == null)
background_image_node = CreateNode(doc, configuration_node, "background_image", background_image);
else
background_image_node.InnerText = background_image;
}
//find page if it exists
XmlNode page_name_node = doc.SelectSingleNode("//pages/page/name[. ='" + page_name + "']");
XmlNode page_node = null;
XmlNode fields_node = null;
if (page_name_node == null) //no - create a new page
{
XmlNode pages_node = doc.SelectSingleNode("//pages");
page_node = CreateNode(doc, pages_node, "page");
CreateNode(doc, page_node, "name", page_name);
CreateNode(doc, page_node, "order", GetNextPageOrder(doc));
}
else
{
page_node = page_name_node.ParentNode;
fields_node = page_node.SelectSingleNode("fields");
if (fields_node != null)
page_node.RemoveChild(fields_node);
}
fields_node = CreateNode(doc, page_node, "fields");
State["ComputeSymbols"] = new ArrayList();
if (html.Length > 0)
{
//encode design
HtmlDocument HtmlDoc = new HtmlDocument();
if (State["Browser"].ToString() == "Opera")
html = FilterOperaHtml(html);
HtmlDoc.LoadHtml(html);
HtmlNodeCollection div_list = HtmlDoc.DocumentNode.SelectNodes("//div[starts-with(@title,'MobiFlex')]");
string ret = ProcessHtmlNodes(State, doc, page_name, fields_node, div_list);
if (ret != "OK")
{
throw new Exception(ret);
}
}
else if (State["BackgroundImageUrl"] != null) //new page with only a backbground
{
State["BackgroundHtml"] = html = "<img id=\"background_image\" src=\"" + State["BackgroundImageUrl"].ToString() + "\" style=\"position:absolute;top:0px;left:0px;\"/>";
}
Util util = new Util();
util.UpdateStagingAppXml(State);
Hashtable duplicate_IDs = CheckForDuplicateIDs(page_name, doc);
ArrayList ComputeSymbols = (ArrayList)State["ComputeSymbols"];
if (ComputeSymbols.Count > 0)
{
CheckComputeSymbols(doc,State);
}
util.SavePageImage(State, page_name,html);
return duplicate_IDs; // will return null if there are no duplicates
}