SoapNormalizedString Klasa
Ważne
Niektóre informacje odnoszą się do produktu w wersji wstępnej, który może zostać znacząco zmodyfikowany przed wydaniem. Firma Microsoft nie udziela żadnych gwarancji, jawnych lub domniemanych, w odniesieniu do informacji podanych w tym miejscu.
Opakowuje typ XML normalizedString
.
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
- Dziedziczenie
-
SoapNormalizedString
- Atrybuty
- Implementuje
Poniższy przykład kodu pokazuje, jak używać składowych w SoapNormalizedString klasie do konwersji między obiektem SoapNormalizedString a 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);
}
}
Soap |
Inicjuje nowe wystąpienie klasy SoapNormalizedString. |
Soap |
Inicjuje SoapNormalizedString nowe wystąpienie klasy z znormalizowanym ciągiem. |
Value |
Pobiera lub ustawia znormalizowany ciąg. |
Xsd |
Pobiera język definicji schematu XML (XSD) bieżącego typu SOAP. |
Equals(Object) |
Określa, czy dany obiekt jest taki sam, jak bieżący obiekt. (Odziedziczone po Object) |
Get |
Służy jako domyślna funkcja skrótu. (Odziedziczone po Object) |
Get |
Type Pobiera bieżące wystąpienie. (Odziedziczone po Object) |
Get |
Zwraca język definicji schematu XML (XSD) bieżącego typu SOAP. |
Memberwise |
Tworzy płytkią kopię bieżącego Objectelementu . (Odziedziczone po Object) |
Parse(String) |
Konwertuje określony String obiekt na SoapNormalizedString obiekt. |
To |
Produkt | Wersje |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Opinia o produkcie .NET
.NET to projekt typu open source. Wybierz link, aby przekazać opinię: