本文整理匯總了C#中Orchard.Forms.Services.DescribeContext.Describe方法的典型用法代碼示例。如果您正苦於以下問題:C# DescribeContext.Describe方法的具體用法?C# DescribeContext.Describe怎麽用?C# DescribeContext.Describe使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Orchard.Forms.Services.DescribeContext
的用法示例。
在下文中一共展示了DescribeContext.Describe方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Import
public string Import(string formName, string state, ImportContentContext importContext) {
var describeContext = new DescribeContext();
foreach (var provider in _formProviders) {
provider.Describe(describeContext);
}
var descriptor = describeContext.Describe().FirstOrDefault(x => x.Name == formName);
if (descriptor == null || descriptor.Import == null) {
return state;
}
var dynamicState = FormParametersHelper.ToDynamic(state);
descriptor.Import(dynamicState, importContext);
return FormParametersHelper.ToString(dynamicState);
}
示例2: Build
public dynamic Build(string formName, string prefix = "") {
var context = new DescribeContext();
foreach (var provider in _formProviders) {
provider.Describe(context);
}
var descriptor = context.Describe().FirstOrDefault(x => x.Name == formName);
if (descriptor == null) {
return null;
}
var shape = descriptor.Shape(_shapeFactory);
var buildingContext = new BuildingContext { Shape = shape };
_formEventHandlers.Invoke(dispatch => dispatch.Building(buildingContext), Logger);
// alter the shapes tree (validation, ajax, ...));
_formEventHandlers.Invoke(dispatch => dispatch.Built(buildingContext), Logger);
return shape;
}