Skip to content

Instantly share code, notes, and snippets.

@carlwoodhouse
Last active June 22, 2017 22:47
Show Gist options
  • Save carlwoodhouse/374ba9e1e2dc430041e08b172be25f6b to your computer and use it in GitHub Desktop.
Save carlwoodhouse/374ba9e1e2dc430041e08b172be25f6b to your computer and use it in GitHub Desktop.
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