SoapNormalizedString 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
包裝 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
- 繼承
-
SoapNormalizedString
- 屬性
- 實作
範例
下列程式代碼範例示範如何使用 類別中的SoapNormalizedString成員,在物件與 XSD normalizedString
之間SoapNormalizedString轉換。
#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);
}
}
建構函式
SoapNormalizedString() |
初始化 SoapNormalizedString 類別的新執行個體。 |
SoapNormalizedString(String) |
使用標準化字串,初始化 SoapNormalizedString 類別的新執行個體。 |
屬性
Value |
取得或設定標準化字串。 |
XsdType |
取得目前 SOAP 型別的 XML 結構描述定義語言 (XSD)。 |
方法
Equals(Object) |
判斷指定的物件是否等於目前的物件。 (繼承來源 Object) |
GetHashCode() |
做為預設雜湊函式。 (繼承來源 Object) |
GetType() |
取得目前執行個體的 Type。 (繼承來源 Object) |
GetXsdType() |
傳回目前 SOAP 型別的 XML 結構描述定義語言 (XSD)。 |
MemberwiseClone() |
建立目前 Object 的淺層複製。 (繼承來源 Object) |
Parse(String) |
將指定的 String 轉換成 SoapNormalizedString 物件。 |
ToString() |
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應