本文整理汇总了C#中System.Uri.notNull方法的典型用法代码示例。如果您正苦于以下问题:C# Uri.notNull方法的具体用法?C# Uri.notNull怎么用?C# Uri.notNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Uri
的用法示例。
在下文中一共展示了Uri.notNull方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: handleUrlRewrite
public void handleUrlRewrite(Uri uri)
{
try
{
if (shouldSkipCurrentRequest())
return;
var absolutePath = uri.notNull() ? uri.AbsolutePath : context.Request.Url.AbsolutePath;
//if (absolutePath.starts("/html_pages/Gui/")) //deal with the cases where there is an relative link inside the html_pages/Gui viewer page
// absolutePath = absolutePath.replace("/html_pages/Gui/", "/article/");
handleUrlRewrite(absolutePath);
}
catch (Exception ex)
{
if (ex.Message != "Thread was being aborted.")
ex.log("[in handleUrlRewrite]");
}
}
示例2: handleUrlRewrite
public bool handleUrlRewrite(Uri uri)
{
try
{
var absolutePath = uri.notNull() ? uri.AbsolutePath
: request.Url.notNull()
? request.Url.AbsolutePath
: null;
if (absolutePath.isNull())
return false;
if (absolutePath.siteData_Handle_VirtualPath())
return true;
if (shouldSkipCurrentRequest())
return true;
return handleUrlRewrite(absolutePath);
}
catch (Exception ex)
{
if (ex.Message != "Thread was being aborted.")
{
ex.logWithStackTrace("[at handleUrlRewrite]");
return true;
}
return false;
}
}
示例3: serverOnline
public static bool serverOnline(this TM_QA_Config tmQaConfig, Uri targetServer)
{
if (targetServer.notNull())
{
if (TM_QA_Config.Force_Server_Offline)
return false;
return targetServer.append("default.htm")
.HEAD();
}
return false;
}
示例4: open
public static WatiN_IE open(this WatiN_IE watinIe, Uri uri)
{
return (watinIe.notNull() && uri.notNull())
? watinIe.open(uri.str())
: watinIe;
}
示例5: wait_For_Uri
public static WatiN_IE wait_For_Uri(this WatiN_IE watinIe, Uri expectedUri, int maxWait = 1000)
{
return (watinIe.notNull() && expectedUri.notNull())
? watinIe.wait_For_Url(expectedUri.str(),maxWait)
: watinIe;
}
示例6: assert_Uri_Is
public static WatiN_IE assert_Uri_Is(this WatiN_IE watinIe, Uri expectedUri, string message = Extra_NUnit_Messages.ASSERT_URL_IS)
{
return (watinIe.notNull() && expectedUri.notNull())
? watinIe.assert_Url_Is(expectedUri.str(),message)
: watinIe;
}