本文整理汇总了C#中SIM.Instances.Instance.GetUrl方法的典型用法代码示例。如果您正苦于以下问题:C# Instance.GetUrl方法的具体用法?C# Instance.GetUrl怎么用?C# Instance.GetUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SIM.Instances.Instance
的用法示例。
在下文中一共展示了Instance.GetUrl方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Browse
public static void Browse(Instance instance, string virtualPath, bool isFrontEnd, string browser, string[] parameters)
{
string url = instance.GetUrl();
if (!string.IsNullOrEmpty(url))
{
url += '/' + virtualPath.TrimStart('/');
CoreApp.OpenInBrowser(url, isFrontEnd, browser, parameters);
}
}
示例2: StartInstance
public static void StartInstance(Instance instance, int? timeout = null, string reason = null)
{
Assert.ArgumentNotNull(instance, "instance");
string url = instance.GetUrl(@"/sitecore/service/keepalive.aspx?ts=" + DateTime.Now.Ticks + "&reason=" + (reason ?? "default"));
Assert.IsNotNullOrEmpty(url, "url");
try
{
WebRequestHelper.DownloadString(url, timeout);
}
catch (WebException ex)
{
string text = "There is an issue with requesting '" + url + "'. ";
var webResponse = ex.Response;
if (webResponse != null)
{
using (var s = webResponse.GetResponseStream())
{
if (s != null)
{
using (StreamReader streamReader = new StreamReader(s))
{
text = streamReader.ReadToEnd();
}
}
else
{
text += "No error response stream provided.";
}
}
}
else
{
text += "No error response provided.";
}
string text2 = string.Empty;
try
{
text2 = text.Substring(text.IndexOf("<title>") + "<title>".Length);
text2 = text2.Substring(0, text2.IndexOf("</title>"));
}
catch (Exception)
{
text2 = text.Substring(0, Math.Min(text.Length, 200));
}
throw new WebException("{0} \r\nStatus: {1} \r\n{2}".FormatWith(ex.Message, ex.Status.ToString(), text2), ex);
}
}
示例3: GetUrl
public static string GetUrl(Instance instance, string pageName, string value = null, string key = null)
{
return instance.GetUrl(AgentPath + '/' + pageName) + (!string.IsNullOrEmpty(value) ? "?" + (key ?? "fileName") + "=" + HttpUtility.UrlEncode(value) : string.Empty);
}
示例4: GetWebServiceUrl
private static string GetWebServiceUrl(Instance instance)
{
return instance.GetUrl("/sitecore/shell/webservice/service.asmx");
}
示例5: ProcessInstanceClickInternal
protected override bool ProcessInstanceClickInternal(Instance instance)
{
var runParams = this.GetRunPageParams();
WindowHelper.OpenInBrowser(instance.GetUrl(runParams.Item2), !runParams.Item1);
return true;
}