mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-12-02 19:44:02 +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.
|
||||
/// </summary>
|
||||
public interface IShapeFactory : IDependency {
|
||||
IShape Create(string shapeType);
|
||||
IShape Create(string shapeType, INamedEnumerable<object> parameters);
|
||||
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;
|
||||
}
|
||||
|
||||
public IShape Create(string shapeType) {
|
||||
return Create(shapeType, Arguments.Empty(), () => new Shape());
|
||||
}
|
||||
|
||||
public IShape Create(string shapeType, INamedEnumerable<object> parameters) {
|
||||
return Create(shapeType, parameters, () => new Shape());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user