Share via


SoapNormalizedString Classe

Définition

Inclut dans un wrapper un type normalizedString XML.

public ref class SoapNormalizedString sealed : System::Runtime::Remoting::Metadata::W3cXsd2001::ISoapXsd
[System.Serializable]
public sealed class SoapNormalizedString : System.Runtime.Remoting.Metadata.W3cXsd2001.ISoapXsd
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class SoapNormalizedString : System.Runtime.Remoting.Metadata.W3cXsd2001.ISoapXsd
[<System.Serializable>]
type SoapNormalizedString = class
    interface ISoapXsd
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type SoapNormalizedString = class
    interface ISoapXsd
Public NotInheritable Class SoapNormalizedString
Implements ISoapXsd
Héritage
SoapNormalizedString
Attributs
Implémente

Exemples

L’exemple de code suivant montre comment utiliser les membres de la SoapNormalizedString classe pour effectuer une conversion entre un SoapNormalizedString objet et un XSD normalizedString.

#using <System.Runtime.Remoting.dll>
using namespace System;
using namespace System::Runtime::Remoting::Metadata::W3cXsd2001;

static void TestParse( String^ testString )
{
   try
   {
      // Parse the test string.
      SoapNormalizedString^ normalized = SoapNormalizedString::Parse(
         testString );

      // Report that the parse succeeded if no exception was thrown.
      Console::WriteLine( L"Parse succeeded on the string \"{0}\".",
         testString );
      
      // Print the string representation of the object.
      Console::WriteLine( L"The normalized value of this string is \"{0}\".",
         normalized );

      // Print the XSD type of the object.
      Console::WriteLine( L"The XSD type of the SoapNormalizedString object is {0}.",
         normalized->GetXsdType() );

      // Print the value of the SoapNormalizedString object.
      Console::WriteLine( L"The value of the SoapNormalizedString object is \"{0}\".",
         normalized->Value );
   }
   catch ( System::Runtime::Remoting::RemotingException^ e ) 
   {
      // Report the details of the exception that was thrown.
      Console::WriteLine( L"Parse failed on the string \"{0}\".",
         testString );
      Console::WriteLine( e->Message );
   }
}

int main()
{
   // Create strings to test the Parse method.
   String^ stringWithSpaces = L"one two";
   String^ stringWithSpacesAndTabs = L"one two\t";
   String^ stringWithSpacesAndLineFeed = L"one two\n";
   String^ stringWithSpacesAndCarriageReturn = L"one two\r";
   
   // Test the Parse method with each string.
   TestParse( stringWithSpaces );
   TestParse( stringWithSpacesAndTabs );
   TestParse( stringWithSpacesAndLineFeed );
   TestParse( stringWithSpacesAndCarriageReturn );
   
   // Print the XSD type string of the SoapNormalizedString class.
   Console::WriteLine( L"The XSD type of the SoapNormalizedString class is {0}.",
      SoapNormalizedString::XsdType );
}
using System;
using System.Runtime.Remoting.Metadata.W3cXsd2001;

public class Demo
{
    public static void TestParse(string testString)
    {
        try
        {
            // Parse the test string.
            SoapNormalizedString normalized =
                SoapNormalizedString.Parse(testString);

            // Report that the parse succeeded if no exception was thrown.
            Console.WriteLine(
                "Parse succeeded on the string \"{0}\".",
                testString);

            // Print the string representation of the object.
            Console.WriteLine(
                "The normalized value of this string is \"{0}\".",
                normalized.ToString());

            // Print the XSD type of the object.
            Console.WriteLine(
                "The XSD type of the SoapNormalizedString " +
                "object is {0}.", normalized.GetXsdType());

            // Print the value of the SoapNormalizedString object.
            Console.WriteLine(
                "The value of the SoapNormalizedString " +
                "object is \"{0}\".",
                normalized.Value);
        }
        catch(System.Runtime.Remoting.RemotingException e)
        {
            // Report the details of the exception that was thrown.
            Console.WriteLine(
                "Parse failed on the string \"{0}\".",
                testString);
            Console.WriteLine(e.Message);
        }
    }

    public static void Main(string[] args)
    {
        // Create strings to test the Parse method.
        string stringWithSpaces = "one two";
        string stringWithSpacesAndTabs = "one two\t";
        string stringWithSpacesAndLineFeed = "one two\n";
        string stringWithSpacesAndCarriageReturn = "one two\r";

        // Test the Parse method with each string.
        TestParse(stringWithSpaces);
        TestParse(stringWithSpacesAndTabs);
        TestParse(stringWithSpacesAndLineFeed);
        TestParse(stringWithSpacesAndCarriageReturn);

        // Print the XSD type string of the SoapNormalizedString class.
        Console.WriteLine(
            "The XSD type of the SoapNormalizedString class " +
            "is {0}.", SoapNormalizedString.XsdType);
    }
}

Constructeurs

SoapNormalizedString()

Initialise une nouvelle instance de la classe SoapNormalizedString.

SoapNormalizedString(String)

Initialise une nouvelle instance de la classe SoapNormalizedString avec une chaîne normalisée.

Propriétés

Value

Obtient ou définit une chaîne normalisée.

XsdType

Obtient le langage XSD (XML Schema Definition) du type SOAP en cours.

Méthodes

Equals(Object)

Détermine si l'objet spécifié est égal à l'objet actuel.

(Hérité de Object)
GetHashCode()

Fait office de fonction de hachage par défaut.

(Hérité de Object)
GetType()

Obtient le Type de l'instance actuelle.

(Hérité de Object)
GetXsdType()

Retourne le langage XSD (XML Schema Definition) du type SOAP en cours.

MemberwiseClone()

Crée une copie superficielle du Object actuel.

(Hérité de Object)
Parse(String)

Convertit le String spécifié en un objet SoapNormalizedString.

ToString()

Retourne une Value comme String.

S’applique à