當前位置: 首頁>>代碼示例>>C#>>正文


C# DescribeContext.Describe方法代碼示例

本文整理匯總了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);
        }
開發者ID:anycall,項目名稱:Orchard,代碼行數:17,代碼來源:DefaultFormManager.cs

示例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;
        }
開發者ID:dminik,項目名稱:voda_code,代碼行數:21,代碼來源:DefaultFormManager.cs


注:本文中的Orchard.Forms.Services.DescribeContext.Describe方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。