예제 #1
0
        public static UIReturnKeyType GetValueFromDescription(this WEntry.ReturnKeyTypes value)
        {
            var type = typeof(UIReturnKeyType);

            if (!type.IsEnum)
            {
                throw new InvalidOperationException();
            }
            foreach (var field in type.GetFields())
            {
                var attribute = Attribute.GetCustomAttribute(field,
                                                             typeof(DescriptionAttribute)) as DescriptionAttribute;
                if (attribute != null)
                {
                    if (attribute.Description == value.ToString())
                    {
                        return((UIReturnKeyType)field.GetValue(null));
                    }
                }
                else
                {
                    if (field.Name == value.ToString())
                    {
                        return((UIReturnKeyType)field.GetValue(null));
                    }
                }
            }
            return(UIReturnKeyType.Default);

            throw new NotSupportedException($"Not supported on iOS: {value}");
        }
예제 #2
0
 public WEntryCell()
 {
     ReturnKeyType = WEntry.ReturnKeyTypes.Next;
 }
예제 #3
0
 public WEntryField()
 {
     ReturnKeyType     = WEntry.ReturnKeyTypes.Next;
     HorizontalOptions = LayoutOptions.FillAndExpand;
     HeightRequest     = 40;
 }