当前位置: 首页>>代码示例>>C#>>正文


C# Services.DescribeContext类代码示例

本文整理汇总了C#中Orchard.Forms.Services.DescribeContext的典型用法代码示例。如果您正苦于以下问题:C# DescribeContext类的具体用法?C# DescribeContext怎么用?C# DescribeContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DescribeContext类属于Orchard.Forms.Services命名空间,在下文中一共展示了DescribeContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Describe

        public void Describe(DescribeContext context)
        {
            Func<IShapeFactory, object> form = shapeFactory =>
            {
                var shape = (dynamic)shapeFactory;
                var formShape = shape.Form
                (
                    Id: "Terms",
                    _Terms: shape.TextBox
                    (
                        Id: "termids", Name: "TermIds",
                        Title: T("Terms"),
                        Description: T("Enter one or more term IDs, seperated by a comma. Tip: you can use tokens such as #{Request.CurrentContent.Fields.MyTaxonomyField.Terms:0} to get the terms for the currently routed content item."),
                        Classes: "text large tokenized"
                    ),
                    _Exclusion: shape.FieldSet
                    (
                        _OperatorOneOf: shape.Radio
                        (
                            Id: "operator-is-one-of", Name: "Operator",
                            Title: T("Is one of"), Value: "0", Checked: true
                        ),
                        _OperatorIsAllOf: shape.Radio
                        (
                            Id: "operator-is-all-of", Name: "Operator",
                            Title: T("Is all of"), Value: "1"
                        )
                    )
                );

                return formShape;
            };

            context.Form("EnterTerms", form);
        }
开发者ID:IDeliverable,项目名称:IDeliverable.Bits,代码行数:35,代码来源:TermsFilterForms.cs

示例2: T

        void IFormProvider.Describe(DescribeContext context) {
            context.Form("SignInUser", factory => {
                var shape = (dynamic) factory;
                var form = shape.Form(
                    Id: "signInUser",
                    _UserName: shape.Textbox(
                        Id: "userNameOrEmail",
                        Name: "UserNameOrEmail",
                        Title: T("User Name or Email"),
                        Description: T("The user name or email of the user to sign in."),
                        Classes: new[]{"text", "large", "tokenized"}),
                    _Password: shape.Textbox(
                        Id: "password",
                        Name: "Password",
                        Title: T("Password"),
                        Description: T("The password of the user to sign in."),
                        Classes: new[] { "text", "large", "tokenized" }),
                    _CreatePersistentCookie: shape.Textbox(
                        Id: "createPersistentCookie",
                        Name: "CreatePersistentCookie",
                        Title: T("Create Persistent Cookie"),
                        Description: T("A value evaluating to 'true' to create a persistent cookie."),
                        Classes: new[]{"text", "large", "tokenized"}));

                return form;
            });
        }
开发者ID:RasterImage,项目名称:Orchard,代码行数:27,代码来源:SignInUserForm.cs

示例3: Describe

        public void Describe(DescribeContext context) {
            Func<IShapeFactory, object> form =
                shape => {
                    var operators = new List<SelectListItem> {
                        new SelectListItem {Value = Convert.ToString(StringOperator.Equals), Text = T("Is equal to").Text},
                        new SelectListItem {Value = Convert.ToString(StringOperator.NotEquals), Text = T("Is not equal to").Text},
                        new SelectListItem {Value = Convert.ToString(StringOperator.Contains), Text = T("Contains").Text},
                        new SelectListItem {Value = Convert.ToString(StringOperator.ContainsAny), Text = T("Contains any word").Text},
                        new SelectListItem {Value = Convert.ToString(StringOperator.ContainsAll), Text = T("Contains all words").Text},
                        new SelectListItem {Value = Convert.ToString(StringOperator.Starts), Text = T("Starts with").Text},
                        new SelectListItem {Value = Convert.ToString(StringOperator.NotStarts), Text = T("Does not start with").Text},
                        new SelectListItem {Value = Convert.ToString(StringOperator.Ends), Text = T("Ends with").Text},
                        new SelectListItem {Value = Convert.ToString(StringOperator.NotEnds), Text = T("Does not end with").Text},
                        new SelectListItem {Value = Convert.ToString(StringOperator.NotContains), Text = T("Does not contain").Text}
                    };

                    var f = Shape.FilterEditors_StringFilter(
                        Id: FormName,
                        Operators: operators
                        );

                    return f;
                };

            context.Form(FormName, form);
        }
开发者ID:wezmag,项目名称:Coevery,代码行数:26,代码来源:StringFilterForm.cs

示例4: Describe

        public void Describe(DescribeContext context) {
            Func<IShapeFactory, dynamic> form =
                shape => {

                    var f = Shape.Form(
                        Id: "AnyOfRoles",
                        _Parts: Shape.SelectList(
                            Id: "role", Name: "Roles",
                            Title: T("Roles"),
                            Description: T("Select some roles."),
                            Size: 10,
                            Multiple: true
                            ),
                        _Message: Shape.Textbox(
                            Id: "actions", Name: "Actions",
                            Title: T("Available actions."),
                            Description: T("A comma separated list of actions."),
                            Classes: new[] { "text medium" })
                        );

                    f._Parts.Add(new SelectListItem { Value = "", Text = T("Any").Text });

                    foreach (var role in _roleService.GetRoles().OrderBy(x => x.Name)) {
                        f._Parts.Add(new SelectListItem { Value = role.Name, Text = role.Name });
                    }

                    return f;
                };

            context.Form("ActivityUserTask", form);

        }
开发者ID:jdages,项目名称:AndrewsHouse,代码行数:32,代码来源:UserTaskForms.cs

示例5: Describe

        public void Describe(DescribeContext context) {
            Func<IShapeFactory, dynamic> form =
                shape => {

                    var f = Shape.Form(
                        Id: "AnyOfCustomForms",
                        _Parts: Shape.SelectList(
                            Id: "customforms", Name: "CustomForms",
                            Title: T("Custom Forms"),
                            Description: T("Select some custom forms."),
                            Size: 10,
                            Multiple: true
                            )
                        );

                    f._Parts.Add(new SelectListItem { Value = "", Text = T("Any").Text });

                    var query = _contentManager.Query().ForType("CustomForm", "CustomFormWidget");
                    var customForms = query.List().Select(x => new { ContentItem = x, Metadata = _contentManager.GetItemMetadata(x)});

                    foreach (var customForm in customForms.OrderBy(x => x.Metadata.DisplayText)) {
                        
                        f._Parts.Add(new SelectListItem { Value = customForm.Metadata.Identity.ToString(), Text = customForm.Metadata.DisplayText });
                    }

                    return f;
                };

            context.Form("SelectCustomForms", form);

        }
开发者ID:RasterImage,项目名称:Orchard,代码行数:31,代码来源:SelectCustomForm.cs

示例6: Describe

        public void Describe(DescribeContext context) {
            Func<IShapeFactory, object> form =
                shape => {

                    var f = Shape.Form(
                        Id: "AnyOfContentTypes",
                        _Parts: Shape.SelectList(
                            Id: "contenttypes", Name: "ContentTypes",
                            Title: T("Content types"),
                            Description: T("Select some content types."),
                            Size: 10,
                            Multiple: true
                            )
                        );

                    f._Parts.Add(new SelectListItem { Value = "", Text = T("Any").Text });

                    foreach (var contentType in _contentDefinitionManager.ListTypeDefinitions().OrderBy(x => x.DisplayName)) {
                        f._Parts.Add(new SelectListItem { Value = contentType.Name, Text = contentType.DisplayName });
                    }

                    return f;
                };

            context.Form("ContentTypesFilter", form);

        }
开发者ID:anycall,项目名称:Orchard,代码行数:27,代码来源:ContentTypesFilter.cs

示例7: Describe

        public void Describe(DescribeContext context) {
            context.Form("ActivityTimer",
                shape => {
                    var form = Shape.Form(
                        Id: "ActionDelay",
                        _Amount: Shape.Textbox(
                            Id: "Amount", Name: "Amount",
                            Title: T("Amount"),
                            Description: T("Amount of time units to add."),
                            Classes: new[] { "text small tokenized" }),
                        _Type: Shape.SelectList(
                            Id: "Unity", Name: "Unity",
                            Title: T("Amount type"))
                            .Add(new SelectListItem { Value = "Minute", Text = T("Minutes").Text, Selected = true })
                            .Add(new SelectListItem { Value = "Hour", Text = T("Hours").Text })
                            .Add(new SelectListItem { Value = "Day", Text = T("Days").Text })
                            .Add(new SelectListItem { Value = "Week", Text = T("Weeks").Text })
                            .Add(new SelectListItem { Value = "Month", Text = T("Months").Text }),
                        _Date: Shape.Textbox(
                            Id: "Date", Name: "Date",
                            Title: T("Date"),
                            Description: T("Optional. Starting date/time to calculate difference from. Leave blank to use current date/time."),
                            Classes: new[] {"text medium tokenized"}));

                    return form;
                }
            );
        }
开发者ID:anycall,项目名称:Orchard,代码行数:28,代码来源:TimerForms.cs

示例8: Describe

        public void Describe(DescribeContext context) {
            Func<IShapeFactory, object> form =
                shape => {

                    var f = Shape.Form(
                        Id: "AnyOfContentPartRecords",
                        _Parts: Shape.SelectList(
                            Id: "contentpartrecordss", Name: "ContentPartRecords",
                            Title: T("Content part records"),
                            Description: T("Select some content part records."),
                            Size: 10,
                            Multiple: true
                            )
                        );

                    foreach (var recordBluePrint in _shellBlueprint.Records.OrderBy(x => x.Type.Name)) {
                        if (typeof(ContentPartRecord).IsAssignableFrom(recordBluePrint.Type) || typeof(ContentPartVersionRecord).IsAssignableFrom(recordBluePrint.Type)) {
                            f._Parts.Add(new SelectListItem { Value = recordBluePrint.Type.Name, Text = recordBluePrint.Type.Name });
                        }
                    }

                    return f;
                };

            context.Form("ContentPartRecordsForm", form);

        }
开发者ID:RasterImage,项目名称:Orchard,代码行数:27,代码来源:ContentPartRecordsForm.cs

示例9: Describe

        public void Describe(DescribeContext context) {
            Func<IShapeFactory, object> form =
                shape => {
                    var f = Shape.Form(
                        Id: "BooleanFilter",
                        _Options: Shape.Fieldset(
                            _ValueUndefined: Shape.Radio(
                                Id: "value-undefined", Name: "Value",
                                Title: T("Undefined"), Value: "undefined"
                                ),
                            _LabelTrue: Shape.InputLabel(
                                Title: T("Yes"),
                                For: "value-true"
                                ),
                            _ValueTrue: Shape.Radio(
                                Id: "value-true", Name: "Value",
                                Title: T("Yes"), Value: "true", Checked: true
                                ),
                            _ValueFalse: Shape.Radio(
                                Id: "value-false", Name: "Value",
                                Title: T("No"), Value: "false"
                                ),
                            Description: T("Enter the value the string should be.")
                            ));

                    return f;
                };

            context.Form(FormName, form);
        }
开发者ID:jgtaveras,项目名称:Coevery,代码行数:30,代码来源:BooleanFilterForm.cs

示例10: Describe

        public void Describe(DescribeContext context) {
            Func<IShapeFactory, object> form =
                shape => {
                    var f = Shape.Form(
                        Id: "StringFilter",
                        _Operator: Shape.SelectList(
                            Id: "operator", Name: "Operator",
                            Size: 1,
                            //Classes: new[] { "show-tick" },
                            Multiple: false
                        ),
                        _Value: Shape.TextBox(
                            Id: "value", Name: "Value",
                            Classes: new[] { "filterInput" }
                            )
                        );

                    f._Operator.Add(new SelectListItem { Value = Convert.ToString(StringOperator.Equals), Text = T("Is equal to").Text });
                    f._Operator.Add(new SelectListItem { Value = Convert.ToString(StringOperator.NotEquals), Text = T("Is not equal to").Text });
                    f._Operator.Add(new SelectListItem { Value = Convert.ToString(StringOperator.Contains), Text = T("Contains").Text });
                    f._Operator.Add(new SelectListItem { Value = Convert.ToString(StringOperator.ContainsAny), Text = T("Contains any word").Text });
                    f._Operator.Add(new SelectListItem { Value = Convert.ToString(StringOperator.ContainsAll), Text = T("Contains all words").Text });
                    f._Operator.Add(new SelectListItem { Value = Convert.ToString(StringOperator.Starts), Text = T("Starts with").Text });
                    f._Operator.Add(new SelectListItem { Value = Convert.ToString(StringOperator.NotStarts), Text = T("Does not start with").Text });
                    f._Operator.Add(new SelectListItem { Value = Convert.ToString(StringOperator.Ends), Text = T("Ends with").Text });
                    f._Operator.Add(new SelectListItem { Value = Convert.ToString(StringOperator.NotEnds), Text = T("Does not end with").Text });
                    f._Operator.Add(new SelectListItem { Value = Convert.ToString(StringOperator.NotContains), Text = T("Does not contain").Text });

                    return f;
                };

            context.Form(FormName, form);
        }
开发者ID:jgtaveras,项目名称:Coevery,代码行数:33,代码来源:StringFilterForm.cs

示例11: T

        void IFormProvider.Describe(DescribeContext context) {
            context.Form("CreateUser", factory => {
                var shape = (dynamic) factory;
                var form = shape.Form(
                    Id: "createUser",
                    _UserName: shape.Textbox(
                        Id: "userName",
                        Name: "UserName",
                        Title: T("User Name"),
                        Description: T("The user name of the user to be created."),
                        Classes: new[]{"text", "large", "tokenized"}),
                    _Email: shape.Textbox(
                        Id: "email",
                        Name: "Email",
                        Title: T("Email"),
                        Description: T("The email address of the user to be created."),
                        Classes: new[] { "text", "large", "tokenized" }),
                    _Password: shape.Textbox(
                        Id: "password",
                        Name: "Password",
                        Title: T("Password"),
                        Description: T("The password of the user to be created."),
                        Classes: new[] { "text", "large", "tokenized" }),
                    _Approved: shape.Checkbox(
                        Id: "approved",
                        Name: "Approved",
                        Title: T("Approved"),
                        Description: T("Check to approve the created user."),
                        Value: true));

                return form;
            });
        }
开发者ID:RasterImage,项目名称:Orchard,代码行数:33,代码来源:CreateUserForm.cs

示例12: Describe

        public void Describe(DescribeContext context)
        {
            Func<IShapeFactory, dynamic> form =
                shape => {

                    var f = Shape.Form(
                        Id: "AnyOfRoles",
                        _Parts: Shape.SelectList(
                            Id: "role", Name: "Roles",
                            Title: T("Roles"),
                            Description: T("Select some roles."),
                            Size: 10,
                            Multiple: true
                            )
                        );

                    f._Parts.Add(new SelectListItem { Value = "", Text = T("Any").Text });

                    foreach (var role in _roleService.GetRoles().OrderBy(x => x.Name)) {
                        f._Parts.Add(new SelectListItem { Value = role.Name, Text = role.Name });
                    }

                    return f;
                };

            context.Form("SelectRoles", form);
        }
开发者ID:Timbioz,项目名称:SciGitAzure,代码行数:27,代码来源:SelectRolesForms.cs

示例13: Describe

        public void Describe(DescribeContext context)
        {
            Func<IShapeFactory, object> form =
                shape =>
                {
                    var f = _shapeFactory.Form(
                        Id: "FromShoutboxWidget",
                        _Parts: _shapeFactory.SelectList(
                            Id: "shoutbox-widget", Name: "ShoutboxWidget",
                            Title: T("Shoutbox Widget"),
                            Description: T("Select a Shoutbox widget."),
                            Size: 10,
                            Multiple: false
                            )
                        );

                    foreach (var widget in _contentManager.Query<WidgetPart, WidgetPartRecord>("ShoutboxWidget").List())
                    {
                        f._Parts.Add(new SelectListItem { Value = widget.Id.ToString(), Text = widget.Title });
                    }

                    return f;
                };

            context.Form("ShoutboxMessagesFilter", form);
        }
开发者ID:Lombiq,项目名称:Orchard-Shoutbox,代码行数:26,代码来源:ShoutboxFilter.cs

示例14: Describe

        public void Describe(DescribeContext context) {
            Func<IShapeFactory, dynamic> form =
                shape => Shape.Form(
                Id: "ActionTemplatedMessage",
                _Recipient: Shape.TextBox(
                    Id: "Recipient", Name: "Recipient",
                    Title: T("Recipient"),
                    Description: "The recipient's address"),
                    Classes: new[] { "textMedium", "tokenized" },
                _TemplateId: Shape.SelectList(
                    Id: "TemplateId", Name: "TemplateId",
                    Title: T("Template"),
                    Description: T("The template of the e-mail."),
                    Items: _messageTemplateService.GetTemplates().Select(x => new SelectListItem { Text = x.Title, Value = x.Id.ToString()})
                    ),
                _Channel: Shape.SelectList(
                    Id: "Channel", Name: "Channel",
                    Title: T("Channel"),
                    Description: T("The channel through which to send the message."),
                    Items: _messageManager.GetAvailableChannelServices().Select(x => new SelectListItem { Text = x, Value = x })
                    ),
                _DataTokens: Shape.TextArea(
                    Id: "DataTokens", Name: "DataTokens",
                    Title: T("Data Tokens"),
                    Description: T("Enter a key:value pair per line. Each key will become available as a property on the ViewBag of the Razor template. E.g. \"Order:{Order.OrderNumber}\" will create a \"Order\" property on the ViewBag"),
                    Classes: new[] { "textMedium" }
                    )
                );

            context.Form("ActionTemplatedMessage", form);
        }
开发者ID:KeesSchouten-Znowman,项目名称:DarkSky.Messaging,代码行数:31,代码来源:TemplatedMessageForm.cs

示例15: Describe

        public void Describe(DescribeContext context) {
            Func<IShapeFactory, object> form =
                shape => {
                    var f = Shape.Form(
                        Id: "FormatFilter",
                        _Format: Shape.SelectList(
                            Id: "format", Name: "Format",
                            Title: T("Format"),
                            Description: T("The target format of the image."),
                            Size: 1,
                            Multiple: false),
                        _Quality: Shape.Textbox(
                            Id: "quality", Name: "Quality",
                            Title: T("Quality"),
                            Value: 90,
                            Description: T("JPeg compression quality, from 0 to 100."),
                            Classes: new[] { "text small" })
                        );

                    f._Format.Add(new SelectListItem { Value = "jpg", Text = T("Jpeg").Text });
                    f._Format.Add(new SelectListItem { Value = "gif", Text = T("Gif").Text });
                    f._Format.Add(new SelectListItem { Value = "png", Text = T("Png").Text });

                    return f;
                };

            context.Form("FormatFilter", form);
        }
开发者ID:anycall,项目名称:Orchard,代码行数:28,代码来源:FormatFilter.cs


注:本文中的Orchard.Forms.Services.DescribeContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。