本文整理汇总了C#中Generator.Find方法的典型用法代码示例。如果您正苦于以下问题:C# Generator.Find方法的具体用法?C# Generator.Find怎么用?C# Generator.Find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Generator
的用法示例。
在下文中一共展示了Generator.Find方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InstantiatorWithElements
/// <summary>
/// Gets a delegate that can be used to create instances of a matrix with specified components
/// </summary>
/// <returns>The with elements.</returns>
/// <param name="generator">Generator to create the matrix</param>
public static Func<float, float, float, float, float, float, IMatrix> InstantiatorWithElements (Generator generator = null)
{
var activator = generator.Find<IMatrixHandler> ();
return (xx, yx, xy, yy, x0, y0) => {
var matrix = activator ();
matrix.Create (xx, yx, xy, yy, x0, y0);
return matrix;
};
}
示例2: Instantiator
/// <summary>
/// Creates a delegate that can be used to create instances of the <see cref="IGraphicsPath"/>
/// </summary>
/// <remarks>
/// This is useful when creating a very large number of graphics path objects
/// </remarks>
/// <param name="generator">Generator used to create the graphics path objects</param>
public static Func<IGraphicsPath> Instantiator (Generator generator = null)
{
return generator.Find<IGraphicsPathHandler>();
}
示例3: Instantiator
/// <summary>
/// Gets a delegate that can be used to create an identity matrix
/// </summary>
/// <param name="generator">Generator to create the matrix</param>
public static Func<IMatrix> Instantiator (Generator generator = null)
{
var activator = generator.Find<IMatrixHandler> ();
return () => {
var matrix = activator ();
matrix.Create ();
return matrix;
};
}
示例4: Instantiator
/// <summary>
/// Creates a delegate that can be used to create instances of the <see cref="IGraphicsPath"/>
/// </summary>
/// <remarks>
/// This is useful when creating a very large number of graphics path objects
/// </remarks>
/// <param name="generator">Generator used to create the graphics path objects</param>
public static Func<IGraphicsPath> Instantiator (Generator generator = null)
{
var instantiator = generator.Find<IGraphicsPathHandler> ();
return () => {
return instantiator ();
};
}