mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Adding a new overload for IShapeFactory.Create
--HG-- branch : 1.x
This commit is contained in:
@@ -6,14 +6,9 @@ namespace Orchard.DisplayManagement {
|
|||||||
/// This may be used directly, or through the IShapeHelperFactory.
|
/// This may be used directly, or through the IShapeHelperFactory.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IShapeFactory : IDependency {
|
public interface IShapeFactory : IDependency {
|
||||||
|
IShape Create(string shapeType);
|
||||||
IShape Create(string shapeType, INamedEnumerable<object> parameters);
|
IShape Create(string shapeType, INamedEnumerable<object> parameters);
|
||||||
IShape Create(string shapeType, INamedEnumerable<object> parameters, Func<dynamic> createShape);
|
IShape Create(string shapeType, INamedEnumerable<object> parameters, Func<dynamic> createShape);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class ShapeFactoryExtensions {
|
|
||||||
public static IShape Create(this IShapeFactory factory, string shapeType) {
|
|
||||||
return factory.Create(shapeType, Arguments.Empty());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,10 @@ namespace Orchard.DisplayManagement.Implementation {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IShape Create(string shapeType) {
|
||||||
|
return Create(shapeType, Arguments.Empty(), () => new Shape());
|
||||||
|
}
|
||||||
|
|
||||||
public IShape Create(string shapeType, INamedEnumerable<object> parameters) {
|
public IShape Create(string shapeType, INamedEnumerable<object> parameters) {
|
||||||
return Create(shapeType, parameters, () => new Shape());
|
return Create(shapeType, parameters, () => new Shape());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user