public override Task OverrideInterfaceAsync(GenericUserInterfaceBag bag, GenericUserInterfaceModelBuilder <SomeType> overrider)
            {
                overrider.GetBlockBuilderForCollection(x => x.Prop1)
                .SetMultipleDropDownList <SomeDataProviderForSelectList>();

                return(Task.CompletedTask);
            }
Ejemplo n.º 2
0
        public void TestImplementingMultipleDropDownForToNotEnumerableProperty()
        {
            var builder = new GenericUserInterfaceModelBuilder <SomeType>(TestsHelper.CreateDefaultBag());

            var ex = Assert.Throws <InvalidOperationException>(() => builder.GetBlockBuilderForCollection(x => x.Prop1));

            Assert.AreEqual(ex.Message, ExceptionTexts.DontUseGetBlockBuilderForCollectionOnCollectionsOfChars);
        }
Ejemplo n.º 3
0
            public override Task OverrideInterfaceAsync(GenericUserInterfaceBag bag, GenericUserInterfaceModelBuilder <SomeModelForAutoComplete> overrider)
            {
                overrider.GetBlockBuilderForCollection(x => x.Names).SetAutoCompleteFor <SomeDataProvider>();

                return(Task.CompletedTask);
            }
Ejemplo n.º 4
0
        public override Task OverrideInterfaceAsync(GenericUserInterfaceBag bag, GenericUserInterfaceModelBuilder <TestClass> overrider)
        {
            overrider.GetBlockBuilderForCollection(x => x.Descriptions)
            .SetMultipleDropDownList(new List <SelectListItemData <string> >
            {
                new SelectListItemData <string>
                {
                    Selected = true,
                    Text     = "Описание 1",
                    Value    = "Value 1"
                },
                new SelectListItemData <string>
                {
                    Selected = false,
                    Text     = "Описание 2",
                    Value    = "Value 2"
                },
                new SelectListItemData <string>
                {
                    Selected = true,
                    Text     = "Описание 3",
                    Value    = "Value 3"
                },
                new SelectListItemData <string>
                {
                    Selected = false,
                    Text     = "Описание 4",
                    Value    = "Value 4"
                },
                new SelectListItemData <string>
                {
                    Selected = false,
                    Text     = "Описание 5",
                    Value    = "Value 5"
                }
            });
            overrider.GetBlockBuilder(x => x.Name).SetDropDownList(new List <SelectListItemData <string> >
            {
                new SelectListItemData <string>
                {
                    Value    = "someValue1",
                    Selected = true,
                    Text     = "someText1",
                },
                new SelectListItemData <string>
                {
                    Value    = "someValue2",
                    Selected = false,
                    Text     = "someText2"
                }
            });

            overrider.GetBlockBuilder(x => x.SomeTextArea).SetTextArea();

            overrider
            .GetBlockBuilderForCollection(x => x.AutoCompleteProp1)
            .SetAutoCompleteFor <TestDataProvider>();

            overrider.GetBlockBuilder(x => x.AutoCompleteProp2)
            .SetAutoCompleteFor <TestDataProvider>();

            return(Task.CompletedTask);
        }