Esempio n. 1
0
        public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
        {
            object result;

            if (value is string s && !string.IsNullOrEmpty(s))
            {
                result = UserTuple.Parse(s);
            }
Esempio n. 2
0
        public static bool TryParse(string s, out UserTuple result)
        {
            bool success;

            try
            {
                result  = UserTuple.Parse(s);
                success = true;
            }
            catch
            {
                success = false;
                result  = default;
            }

            return(success);
        }