本文整理匯總了C#中System.Web.VirtualPath.CopyFlagsFrom方法的典型用法代碼示例。如果您正苦於以下問題:C# VirtualPath.CopyFlagsFrom方法的具體用法?C# VirtualPath.CopyFlagsFrom怎麽用?C# VirtualPath.CopyFlagsFrom使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Web.VirtualPath
的用法示例。
在下文中一共展示了VirtualPath.CopyFlagsFrom方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: SimpleCombine
private VirtualPath SimpleCombine(string filename, bool addTrailingSlash) {
// The left part should always be a directory
Debug.Assert(HasTrailingSlash);
// The right part should not start or end with a slash
Debug.Assert(filename[0] != '/' && !UrlPath.HasTrailingSlash(filename));
// Use either _appRelativeVirtualPath or _virtualPath
string virtualPath = VirtualPathStringWhicheverAvailable + filename;
if (addTrailingSlash)
virtualPath += "/";
// Set the appropriate virtual path in the new object
VirtualPath combinedVirtualPath = new VirtualPath(virtualPath);
// Copy some flags over to avoid having to recalculate them
combinedVirtualPath.CopyFlagsFrom(this, isWithinAppRootComputed | isWithinAppRoot | appRelativeAttempted);
#if DBG
combinedVirtualPath.ValidateState();
#endif
return combinedVirtualPath;
}