public object ShapeExecute(object shape) { var context = new DisplayContext { Display = this, Value = shape, ViewContext = ViewContext, ViewDataContainer = ViewDataContainer }; return(_displayManager.Execute(context)); }
public object ShapeExecute(object shape) { if (shape == null) { return(new HtmlString(string.Empty)); } var context = new DisplayContext { Display = this, Value = shape, ViewContext = ViewContext, ViewDataContainer = ViewDataContainer }; return(_displayManager.Execute(context)); }
//https://core.trac.wordpress.org/browser/tags/3.8.1/src/wp-includes/shortcodes.php public string ProcessContent(string text, string flavor) { //dynamic foo = factory.Create("Foo", ArgsUtility.Named(new { one = 1, two = "dos" })); var args = new RouteValueDictionary(new Dictionary <string, object> { }); var shape = _shapeFactory.Create("ShortCodeName", Arguments.FromT(args.Values, args.Keys)); var context = new DisplayContext { Value = shape, ViewContext = new ViewContext() }; var shortCodeText = _displayManager.Execute(context); }