Adding a new overload for IShapeFactory.Create

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2013-02-08 12:36:00 -08:00
parent 6f7190bb76
commit 006bef1de8
2 changed files with 5 additions and 6 deletions

View File

@@ -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());
}
}
}

View File

@@ -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());
}