本文整理汇总了C#中this.Combine方法的典型用法代码示例。如果您正苦于以下问题:C# this.Combine方法的具体用法?C# this.Combine怎么用?C# this.Combine使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类this
的用法示例。
在下文中一共展示了this.Combine方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Type
public static TypeArgumentSpecification Type(this TypeArgumentSpecification @this, Func<Type, TypeSpecification, TypeSpecification> typeSpecification)
{
Guard.NotNull(@this, "this");
Guard.NotNull(typeSpecification, "typeSpecification");
return @this.Combine(ta => typeSpecification(ta, TypeSpecificationBuilder.Any)(ta));
}
示例2: Type
public static ParameterSpecification Type(this ParameterSpecification @this, Func<ParameterInfo, TypeSpecification, TypeSpecification> typeSpecification)
{
Guard.NotNull(@this, "this");
Guard.NotNull(typeSpecification, "typeSpecification");
return @this.Combine(p => typeSpecification(p, TypeSpecificationBuilder.Any)(p.ParameterType));
}
示例3: GetReferenceVirtualPath
public static string GetReferenceVirtualPath(this IVirtualPathProvider virtualPathProvider, string basePath, string referenceName, string hintPath) {
// Check if hint path is valid
if (!string.IsNullOrEmpty(hintPath)) {
if (virtualPathProvider.TryFileExists(virtualPathProvider.Combine(basePath, hintPath)))
return hintPath;
}
// Fall back to bin directory
string relativePath = virtualPathProvider.Combine("bin", referenceName + ".dll");
if (virtualPathProvider.TryFileExists(virtualPathProvider.Combine(basePath, relativePath)))
return relativePath;
return null;
}
示例4: IsEqualTo
public static TypeSpecification IsEqualTo(this TypeSpecification @this, Type expected)
{
Guard.NotNull(@this, "this");
Guard.NotNull(expected, "expected");
return @this.Combine(t => Outcome.FailIf(t != expected, String.Format("Not the expected type: {0}", expected.Name)));
}
示例5: Named
public static ParameterSpecification Named(this ParameterSpecification @this, string name)
{
Guard.NotNull(@this, "this");
Guard.NotNullOrWhiteSpace(name, "name");
return @this.Combine(x => Outcome.FailIf(x.Name != name, String.Format("Not named '{0}'.", name)));
}
示例6: CombineToAppPath
public static string CombineToAppPath(this IFolder folder, params string[] paths)
{
folder.ArgumentNullExceptionByNullOrEmpty("folder");
folder.Root.ArgumentNullExceptionByNullOrEmpty("folder.Root");
return PathUtility.PhysicsPathSeparatorCharConvertToVirtualPathSeparatorChar(Path.Combine(folder.Root.RootPath, folder.Combine(paths).TrimStart('/')));
}
示例7: BoundingBox
public static Ani<Rect> BoundingBox(this Ani<Rect> rect1, Ani<Rect> rect2)
{
return rect1.Combine(rect2,
(r1, r2) => new Rect(
new Point(r1.X.Min(r2.X), r1.Y.Min(r2.Y)),
new Point(r1.Right.Max(r2.Right), r1.Bottom.Max(r2.Bottom))));
}
示例8: Combine
public static Uri Combine(this Uri uri1, string[] additions)
{
foreach (var addition in additions)
{
uri1 = uri1.Combine(addition);
}
return uri1;
}
示例9: CombineAssert
/// <summary>
/// Combines two paths and makes sure the
/// DIRECTORY resulting from the combination exists
/// by creating it with default permissions if it doesn't.
/// </summary>
/// <param name = "input">The path to combine the latter with.</param>
/// <param name = "path">The latter path.</param>
/// <returns>The combined path string.</returns>
public static string CombineAssert(this string input, string path)
{
var p = input.Combine(path);
if (!Directory.Exists(p))
Directory.CreateDirectory(p);
return p;
}
示例10: Combine
/// <summary>
/// Combines the specified <paramref name="password"/> with the specified <paramref name="salt"/>.
/// </summary>
/// <param name="self">The salt combiner.</param>
/// <param name="salt">The salt.</param>
/// <param name="iterationCount">The iteration count.</param>
/// <param name="password">The password.</param>
public static byte[] Combine(this ISaltCombiner self, byte[] salt, int iterationCount, byte[] password)
{
Guard.NotNull(self, nameof(self));
Guard.NotNullOrEmpty(salt, nameof(salt));
Guard.NotZeroOrNegative(iterationCount, nameof(iterationCount));
Guard.NotNullOrEmpty(password, nameof(password));
return self.Combine(salt, iterationCount, BitConverter.ToString(password));
}
示例11: Combine
public static string Combine(this IFileStorage fileStorage, params string[] paths)
{
var path = paths[0];
for (int i = 1; i < paths.Length; i++)
{
path = fileStorage.Combine(path, paths[i]);
}
return path;
}
示例12: GetExtensionFileProvider
public static IOrchardFileSystem GetExtensionFileProvider(
this IOrchardFileSystem parentFileSystem,
ExtensionDescriptor extensionDescriptor,
ILogger logger)
{
var subPath = parentFileSystem.Combine(extensionDescriptor.Location, extensionDescriptor.Id);
return parentFileSystem
.GetSubPathFileProvider(subPath, logger);
}
示例13: GetProjectReferenceVirtualPath
public static string GetProjectReferenceVirtualPath(this IVirtualPathProvider virtualPathProvider, string projectPath, string referenceName, string hintPath) {
string basePath = virtualPathProvider.GetDirectoryName(projectPath);
string virtualPath = virtualPathProvider.GetReferenceVirtualPath(basePath, referenceName, hintPath);
if (!string.IsNullOrEmpty(virtualPath)) {
return virtualPathProvider.Combine(basePath, virtualPath);
}
return null;
}
示例14: Combine
public static string Combine(this string url, IEnumerable<SearchCriteria> searches, LogicalOperator logical, IEnumerable<SortDescription> sorting, int? pageCount)
{
var queries = new List<string>();
if (pageCount.HasValue)
queries.Add(GetPagingQueryString(pageCount.Value));
if (searches != null && searches.Count() > 0)
queries.Add(searches.ConstructFilterQueryString(logical));
if (sorting != null && sorting.Count() > 0)
queries.Add(sorting.ConstructOrderByQueryString());
return url.Combine(queries);
}
示例15: Where
public static SqlQuery Where(this SqlQuery query, ExpandoObject where, char prefix)
{
if (null != query && null != where)
{
IDictionary<string, object> dic = where;
StringBuilder sql = query.Text;
FilterCriteriaList criterias = new FilterCriteriaList(prefix);
foreach (KeyValuePair<string, object> kvp in dic)
{
criterias.Add(kvp.Key, null, ConditionOperator.Equals, kvp.Value);
}
query.Combine(criterias.ToQuery());
}
return query;
}