SoapNormalizedString 类
定义
包装 XML normalizedString 类型。Wraps an XML normalizedString type.
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 SoapNormalizedString 对象和 XSD 之间进行转换 normalizedString 。The following code example shows how to use the members in the SoapNormalizedString class to convert between a SoapNormalizedString object and an 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);
}
}
构造函数
| SoapNormalizedString() |
初始化 SoapNormalizedString 类的新实例。Initializes a new instance of the SoapNormalizedString class. |
| SoapNormalizedString(String) |
用正常化的字符串初始化 SoapNormalizedString 类的新实例。Initializes a new instance of the SoapNormalizedString class with a normalized string. |
属性
| Value |
获取或设置规范化的字符串。Gets or sets a normalized string. |
| XsdType |
获取当前 SOAP 类型的 XML 架构定义语言 (XSD)。Gets the XML Schema definition language (XSD) of the current SOAP type. |
方法
| Equals(Object) |
确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object. (继承自 Object) |
| GetHashCode() |
作为默认哈希函数。Serves as the default hash function. (继承自 Object) |
| GetType() |
获取当前实例的 Type。Gets the Type of the current instance. (继承自 Object) |
| GetXsdType() |
返回当前 SOAP 类型的 XML 架构定义语言 (XSD)。Returns the XML Schema definition language (XSD) of the current SOAP type. |
| MemberwiseClone() |
创建当前 Object 的浅表副本。Creates a shallow copy of the current Object. (继承自 Object) |
| Parse(String) |
将指定的 String 转换为 SoapNormalizedString 对象。Converts the specified String into a SoapNormalizedString object. |
| ToString() |