System.Xml.XmlConvert.TryToGuid C# (CSharp) Méthode

TryToGuid() static private méthode

static private TryToGuid ( string s, System.Guid &result ) : Exception
s string
result System.Guid
Résultat System.Exception
        internal static Exception TryToGuid(string s, out Guid result)
        {
            Exception exception = null;

            result = Guid.Empty;

            try
            {
                result = new Guid(s);
            }
            catch (ArgumentException)
            {
                exception = new FormatException(SR.Format(SR.XmlConvert_BadFormat, s, "Guid"));
            }
            catch (FormatException)
            {
                exception = new FormatException(SR.Format(SR.XmlConvert_BadFormat, s, "Guid"));
            }
            return exception;
        }