예제 #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);
            }
예제 #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);
        }