Last active
June 22, 2017 22:47
-
-
Save carlwoodhouse/374ba9e1e2dc430041e08b172be25f6b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.IO; | |
using Orchard; | |
using Orchard.DisplayManagement; | |
using Orchard.DisplayManagement.Descriptors; | |
using Orchard.Environment; | |
namespace Some.Namespace { | |
public class MyShapes : IShapeTableProvider { | |
private Work<IShapeFactory> _shapefactory; | |
private readonly Work<IShapeDisplay> _shapeDisplay; | |
public MyShapes(Work<IShapeFactory> shapeFactory, Work<IShapeDisplay> _shapeDisplay) { | |
_shapefactory = shapeFactory; | |
_shapeDisplay = shapeDisplay; | |
} | |
[Shape] | |
public void MyShape(TextWriter Output) { | |
var model = new Dictionary<string, object> { { "MyProperty", "MyValue" } }; | |
var shape = _shapeFactory.Create(MyShape_template, Arguments.From(model)); | |
Output.WriteLine(_shapeDisplay.Display(shape)); | |
} | |
public void Discover(ShapeTableBuilder builder) { | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment