Freigeben über


DocumentableItem.Documentation-Eigenschaft

Ruft die Textdokumentation für die Instanz von DocumentableItem ab oder legt diese fest.

Namespace: System.Web.Services.Description
Assembly: System.Web.Services (in system.web.services.dll)

Syntax

'Declaration
Public Property Documentation As String
'Usage
Dim instance As DocumentableItem
Dim value As String

value = instance.Documentation

instance.Documentation = value
public string Documentation { get; set; }
public:
property String^ Documentation {
    String^ get ();
    void set (String^ value);
}
/** @property */
public String get_Documentation ()

/** @property */
public void set_Documentation (String value)
public function get Documentation () : String

public function set Documentation (value : String)

Eigenschaftenwert

Eine Zeichenfolge, die die Dokumentation für das DocumentableItem darstellt.

Hinweise

In einer abgeleiteten Klasse stellt diese Eigenschaft den einem Element des XML-Webdiensts hinzugefügten Textkommentar dar. Die Standardimplementierung ist eine leere Zeichenfolge ("").

Beispiel

Das folgende Codebeispiel veranschaulicht eine typische Verwendung der Documentation-Eigenschaft.

Imports System
Imports System.Web.Services.Description
Imports Microsoft.VisualBasic

Class DocumentableItemSample
   Public Shared Sub Main()
      Dim myServiceDescription As ServiceDescription = _
                           ServiceDescription.Read("MathService_vb.wsdl")
      Console.WriteLine("Documentation Element for type is ")
      PrintDocumentation(myServiceDescription.Types)
      Dim myPortType As PortType
      For Each myPortType In  myServiceDescription.PortTypes
         Console.WriteLine("Documentation Element for Port Type {0} is ", myPortType.Name)
         PrintDocumentation(myPortType)
      Next myPortType
      Dim myBinding As Binding
      For Each myBinding In  myServiceDescription.Bindings
         Console.WriteLine("Documentation Element for Port Type {0} is ", myBinding.Name)
         PrintDocumentation(myBinding)
      Next myBinding
   End Sub 'Main

   ' Prints documentation associated with a wsdl element.
   Public Shared Sub PrintDocumentation(myItem As DocumentableItem)
      Console.WriteLine(ControlChars.Tab + myItem.Documentation)
   End Sub 'PrintDocumentation
End Class 'DocumentableItemSample
using System;
using System.Web.Services.Description;

class DocumentableItemSample
{
   public static void Main()
   {
      ServiceDescription myServiceDescription = ServiceDescription.Read("MathService_cs.wsdl");
      Console.WriteLine("Documentation Element for type is ");
      PrintDocumentation(myServiceDescription.Types);
      foreach(PortType myPortType in myServiceDescription.PortTypes)
      {
         Console.WriteLine("Documentation Element for Port Type {0} is ",myPortType.Name);
         PrintDocumentation(myPortType);
      }
      foreach(Binding myBinding in myServiceDescription.Bindings)
      {
         Console.WriteLine("Documentation Element for Port Type {0} is ",myBinding.Name);
         PrintDocumentation(myBinding);
      }
   }
   // Prints documentation associated with a wsdl element.
   public static void PrintDocumentation(DocumentableItem myItem)
   {
      Console.WriteLine("\t" + myItem.Documentation);
   }
}
#using <System.dll>
#using <System.Xml.dll>
#using <System.Web.Services.dll>

using namespace System;
using namespace System::Xml;
using namespace System::Web::Services::Description;
using namespace System::Collections;

// Prints documentation associated with a wsdl element.
void PrintDocumentation( DocumentableItem^ myItem )
{
   Console::WriteLine( "\t {0}", myItem->Documentation );
}

int main()
{
   ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MathService_cpp.wsdl" );
   Console::WriteLine( "Documentation Element for type is " );
   PrintDocumentation( myServiceDescription->Types );
   IEnumerator^ myEnum = myServiceDescription->PortTypes->GetEnumerator();
   while ( myEnum->MoveNext() )
   {
      PortType^ myPortType = safe_cast<PortType^>(myEnum->Current);
      Console::WriteLine( "Documentation Element for Port Type {0} is ", myPortType->Name );
      PrintDocumentation( myPortType );
   }

   myEnum = myServiceDescription->Bindings->GetEnumerator();
   while ( myEnum->MoveNext() )
   {
      Binding^ myBinding = safe_cast<Binding^>(myEnum->Current);
      Console::WriteLine( "Documentation Element for Port Type {0} is ", myBinding->Name );
      PrintDocumentation( myBinding );
   }
}
import System.*;
import System.Web.Services.Description.*;

class DocumentableItemSample
{
    public static void main(String[] args)
    {
        ServiceDescription myServiceDescription = 
            ServiceDescription.Read("MathService_jsl.wsdl");

        Console.WriteLine("Documentation Element for type is ");
        PrintDocumentation(myServiceDescription.get_Types());
        PortType myPortType = null;
        for (int iCtr=0; iCtr< myServiceDescription.get_PortTypes().
            get_Count(); iCtr++ ) {
            myPortType = myServiceDescription.get_PortTypes().get_Item(iCtr);
            Console.WriteLine("Documentation Element for Port Type {0} is ",
                myPortType.get_Name());
            PrintDocumentation(myPortType);
        }
        Binding myBinding = null;
        for (int iCtr=0; iCtr< myServiceDescription.get_Bindings().
            get_Count(); iCtr++ ) {
            myBinding = myServiceDescription.get_Bindings().get_Item(iCtr);
            Console.WriteLine("Documentation Element for Port Type {0} is ",
                myBinding.get_Name());
            PrintDocumentation(myBinding);
        }
    } //main

    // Prints documentation associated with a wsdl element.
    public static void PrintDocumentation(DocumentableItem myItem)
    {
        Console.WriteLine("\t" + myItem.get_Documentation());
    } //PrintDocumentation
} //DocumentableItemSample

Plattformen

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

DocumentableItem-Klasse
DocumentableItem-Member
System.Web.Services.Description-Namespace