SoapNormalizedString Класс
Определение
Важно!
Некоторые сведения относятся к предварительной версии продукта, в которую до выпуска могут быть внесены существенные изменения. Майкрософт не предоставляет никаких гарантий, явных или подразумеваемых, относительно приведенных здесь сведений.
Заключает в оболочку тип 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 для преобразования между SoapNormalizedString объектом и 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. |
SoapNormalizedString(String) |
Инициализирует новый экземпляр класса SoapNormalizedString с нормализованной строкой. |
Свойства
Value |
Получает или задает нормализованную строку. |
XsdType |
Получает язык определения XML-схемы (XSD) текущего типа SOAP. |
Методы
Equals(Object) |
Определяет, равен ли указанный объект текущему объекту. (Унаследовано от Object) |
GetHashCode() |
Служит хэш-функцией по умолчанию. (Унаследовано от Object) |
GetType() |
Возвращает объект Type для текущего экземпляра. (Унаследовано от Object) |
GetXsdType() |
Возвращает язык определения XML-схемы (XSD) текущего типа SOAP. |
MemberwiseClone() |
Создает неполную копию текущего объекта Object. (Унаследовано от Object) |
Parse(String) |
Преобразует заданный String в объект SoapNormalizedString. |
ToString() |
Применяется к
Обратная связь
https://aka.ms/ContentUserFeedback.
Ожидается в ближайшее время: в течение 2024 года мы постепенно откажемся от GitHub Issues как механизма обратной связи для контента и заменим его новой системой обратной связи. Дополнительные сведения см. в разделеОтправить и просмотреть отзыв по