Exemplo n.º 1
0
        public static T Select <T>(string message, int?pageSize = null, T?defaultValue = null, Func <T, string> valueSelector = null) where T : struct, Enum
        {
            var items = (T[])Enum.GetValues(typeof(T));

            using var form = new Select <T>(message, items, pageSize, defaultValue, valueSelector ?? (x => x.GetDisplayName()));

            return(form.Start());
        }
Exemplo n.º 2
0
        public static T Select <T>(string message, int?pageSize = null, T?defaultValue = null) where T : struct, Enum
        {
            var items = EnumValue <T> .GetValues();

            using var form = new Select <EnumValue <T> >(message, items, pageSize, (EnumValue <T>)defaultValue, x => x.DisplayName);

            return(form.Start().Value);
        }
Exemplo n.º 3
0
        public static T Select <T>(string message, IEnumerable <T> items, int?pageSize = null, object defaultValue = null, Func <T, string> valueSelector = null)
        {
            using var form = new Select <T>(message, items, pageSize, defaultValue, valueSelector ?? (x => x.ToString()));

            return(form.Start());
        }
Exemplo n.º 4
0
        public static T Select <T>(SelectOptions <T> options)
        {
            using var form = new Select <T>(options);

            return(form.Start());
        }