System.Xml.XmlConverter.ToGuid C# (CSharp) Méthode

ToGuid() static public méthode

static public ToGuid ( string value ) : System.Guid
value string
Résultat System.Guid
        static public Guid ToGuid(string value)
        {
            try
            {
                return new Guid(Trim(value));
            }
            catch (FormatException exception)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlExceptionHelper.CreateConversionException(value, "Guid", exception));
            }
            catch (ArgumentException exception)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlExceptionHelper.CreateConversionException(value, "Guid", exception));
            }
            catch (OverflowException exception)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlExceptionHelper.CreateConversionException(value, "Guid", exception));
            }
        }

Same methods

XmlConverter::ToGuid ( byte buffer, int offset, int count ) : System.Guid

Usage Example

Exemple #1
0
 public Guid ToGuid()
 {
     if (_type == ValueHandleType.Guid)
     {
         return(GetGuid());
     }
     if (_type == ValueHandleType.UTF8)
     {
         return(XmlConverter.ToGuid(_bufferReader.Buffer, _offset, _length));
     }
     return(XmlConverter.ToGuid(GetString()));
 }
All Usage Examples Of System.Xml.XmlConverter::ToGuid