MimePartCollection 클래스
정의
public ref class MimePartCollection sealed : System::Collections::CollectionBase
public sealed class MimePartCollection : System.Collections.CollectionBase
type MimePartCollection = class
inherit CollectionBase
Public NotInheritable Class MimePartCollection
Inherits CollectionBase
- 상속
예제
다음 예제 에서는에 의해 노출 되는 메서드와 속성의 사용을 보여 줍니다.는 MimePartCollection
클래스입니다.The following example demonstrates the use of the properties and methods exposed by the MimePartCollection
class.
#using <System.dll>
#using <System.Xml.dll>
#using <System.Web.Services.dll>
using namespace System;
using namespace System::Collections;
using namespace System::Xml;
using namespace System::Web::Services::Description;
int main()
{
ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MimePartCollection_1_Input_cpp.wsdl" );
ServiceDescriptionCollection^ myServiceDescriptionCol = gcnew ServiceDescriptionCollection;
myServiceDescriptionCol->Add( myServiceDescription );
XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "MimeServiceHttpPost","http://tempuri.org/" );
// Create a 'Binding' object.
Binding^ myBinding = myServiceDescriptionCol->GetBinding( myXmlQualifiedName );
OperationBinding^ myOperationBinding = nullptr;
for ( int i = 0; i < myBinding->Operations->Count; i++ )
if ( myBinding->Operations[ i ]->Name->Equals( "AddNumbers" ) )
myOperationBinding = myBinding->Operations[ i ];
OutputBinding^ myOutputBinding = myOperationBinding->Output;
MimeMultipartRelatedBinding^ myMimeMultipartRelatedBinding = nullptr;
IEnumerator^ myIEnumerator = myOutputBinding->Extensions->GetEnumerator();
while ( myIEnumerator->MoveNext() )
myMimeMultipartRelatedBinding = dynamic_cast<MimeMultipartRelatedBinding^>(myIEnumerator->Current);
// Create an instances of 'MimePartCollection'.
MimePartCollection^ myMimePartCollection = gcnew MimePartCollection;
myMimePartCollection = myMimeMultipartRelatedBinding->Parts;
Console::WriteLine( "Total number of mimepart elements initially is: {0}", myMimePartCollection->Count );
// Create an instance of 'MimePart'.
MimePart^ myMimePart = gcnew MimePart;
// Create an instance of 'MimeXmlBinding'.
MimeXmlBinding^ myMimeXmlBinding = gcnew MimeXmlBinding;
myMimeXmlBinding->Part = "body";
myMimePart->Extensions->Add( myMimeXmlBinding );
// Insert a mimepart at first position.
myMimePartCollection->Insert( 0, myMimePart );
Console::WriteLine( "Inserting a mimepart object..." );
if ( myMimePartCollection->Contains( myMimePart ) )
{
Console::WriteLine( "'MimePart' is succesffully added at position: {0}", myMimePartCollection->IndexOf( myMimePart ) );
Console::WriteLine( "Total number of mimepart elements after inserting is: {0}", myMimePartCollection->Count );
}
myServiceDescription->Write( "MimePartCollection_1_Output_cpp.wsdl" );
Console::WriteLine( "MimePartCollection_1_Output_cpp.wsdl has been generated successfully." );
}
using System;
using System.Collections;
using System.Xml;
using System.Web.Services.Description;
public class MyMimePartCollection
{
public static void Main()
{
ServiceDescription myServiceDescription =
ServiceDescription.Read("MimePartCollection_1_Input_cs.wsdl");
ServiceDescriptionCollection myServiceDescriptionCol =
new ServiceDescriptionCollection();
myServiceDescriptionCol.Add(myServiceDescription);
XmlQualifiedName myXmlQualifiedName =
new XmlQualifiedName("MimeServiceHttpPost","http://tempuri.org/");
// Create a 'Binding' object.
Binding myBinding = myServiceDescriptionCol.GetBinding(myXmlQualifiedName);
OperationBinding myOperationBinding= null;
for(int i=0; i<myBinding.Operations.Count; i++)
{
if(myBinding.Operations[i].Name.Equals("AddNumbers"))
{
myOperationBinding =myBinding.Operations[i];
}
}
OutputBinding myOutputBinding = myOperationBinding.Output;
MimeMultipartRelatedBinding myMimeMultipartRelatedBinding = null;
IEnumerator myIEnumerator = myOutputBinding.Extensions.GetEnumerator();
while(myIEnumerator.MoveNext())
{
myMimeMultipartRelatedBinding=(MimeMultipartRelatedBinding)myIEnumerator.Current;
}
// Create an instances of 'MimePartCollection'.
MimePartCollection myMimePartCollection = new MimePartCollection();
myMimePartCollection= myMimeMultipartRelatedBinding.Parts;
Console.WriteLine("Total number of mimepart elements initially is: "
+myMimePartCollection.Count);
// Create an instance of 'MimePart'.
MimePart myMimePart=new MimePart();
// Create an instance of 'MimeXmlBinding'.
MimeXmlBinding myMimeXmlBinding = new MimeXmlBinding();
myMimeXmlBinding.Part = "body";
myMimePart.Extensions.Add(myMimeXmlBinding);
// Insert a mimepart at first position.
myMimePartCollection.Insert(0,myMimePart);
Console.WriteLine("Inserting a mimepart object...");
if(myMimePartCollection.Contains(myMimePart))
{
Console.WriteLine("'MimePart' is succesffully added at position: "
+myMimePartCollection.IndexOf(myMimePart));
Console.WriteLine("Total number of mimepart elements after inserting is: "
+ myMimePartCollection.Count);
}
myServiceDescription.Write("MimePartCollection_1_Output_CS.wsdl");
Console.WriteLine("MimePartCollection_1_Output_CS.wsdl has been generated successfully.");
}
}
Imports System.Collections
Imports System.Xml
Imports System.Web.Services.Description
Public Class MyMimePartCollection
Public Shared Sub Main()
Dim myServiceDescription As ServiceDescription = ServiceDescription.Read _
("MimePartCollection_1_Input_vb.wsdl")
Dim myServiceDescriptionCol As New ServiceDescriptionCollection()
myServiceDescriptionCol.Add(myServiceDescription)
Dim myXmlQualifiedName As New XmlQualifiedName("MimeServiceHttpPost", "http://tempuri.org/")
' Create a 'Binding' object.
Dim myBinding As Binding = myServiceDescriptionCol.GetBinding(myXmlQualifiedName)
Dim myOperationBinding As OperationBinding = Nothing
Dim i As Integer
For i = 0 To myBinding.Operations.Count - 1
If myBinding.Operations(i).Name.Equals("AddNumbers") Then
myOperationBinding = myBinding.Operations(i)
End If
Next i
Dim myOutputBinding As OutputBinding = myOperationBinding.Output
Dim myMimeMultipartRelatedBinding As MimeMultipartRelatedBinding = Nothing
Dim myIEnumerator As IEnumerator = myOutputBinding.Extensions.GetEnumerator()
While myIEnumerator.MoveNext()
myMimeMultipartRelatedBinding = CType(myIEnumerator.Current, MimeMultipartRelatedBinding)
End While
' Create an instances of 'MimePartCollection'.
Dim myMimePartCollection As New MimePartCollection()
myMimePartCollection = myMimeMultipartRelatedBinding.Parts
Console.WriteLine("Total number of mimepart elements initially is: " + _
myMimePartCollection.Count.ToString())
' Create an instance of 'MimePart'.
Dim myMimePart As New MimePart()
' Create an instance of 'MimeXmlBinding'.
Dim myMimeXmlBinding As New MimeXmlBinding()
myMimeXmlBinding.Part = "body"
myMimePart.Extensions.Add(myMimeXmlBinding)
' Insert a mimepart at first position.
myMimePartCollection.Insert(0, myMimePart)
Console.WriteLine("Inserting a mimepart object...")
If myMimePartCollection.Contains(myMimePart) Then
Console.WriteLine("'MimePart' is succesffully added at position: " + _
myMimePartCollection.IndexOf(myMimePart).ToString())
Console.WriteLine("Total number of mimepart elements after inserting is: " + _
myMimePartCollection.Count.ToString())
End If
myServiceDescription.Write("MimePartCollection_1_Output_VB.wsdl")
Console.WriteLine("MimePartCollection_1_Output_VB.wsdl has been generated successfully.")
End Sub
End Class
설명
각 MimePart 컬렉션 내에 추가 되는 확장성 요소를 나타냅니다는 MimeMultipartRelatedBinding에 해당 하는 것에 대 한 MIME 형식을 지정 하 고 MessagePart합니다.Each MimePart within the collection represents an extensibility element added to a MimeMultipartRelatedBinding, and specifies the MIME type for a corresponding MessagePart.
XML Web services에 대 한 프로토콜을 지정 하는 방법에 대 한 자세한 내용은 Xml Web Services Using ASP.NET을 참조 하십시오.For more information about specifying protocols for XML Web services, see XML Web Services Using ASP.NET. WSDL (웹 서비스 기술 언어)에 대 한 자세한 내용은 wsdl 사양을 참조 하십시오.For more information about Web Services Description Language (WSDL), see the WSDL specification.
생성자
MimePartCollection() |
MimePartCollection 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the MimePartCollection class. |
속성
Capacity |
CollectionBase에 포함될 수 있는 요소의 수를 가져오거나 설정합니다.Gets or sets the number of elements that the CollectionBase can contain. (다음에서 상속됨 CollectionBase) |
Count |
에 포함 된 요소의 수를 가져옵니다는 CollectionBase 인스턴스.Gets the number of elements contained in the CollectionBase instance. 이 속성은 재정의할 수 없습니다.This property cannot be overridden. (다음에서 상속됨 CollectionBase) |
InnerList |
가져옵니다는 ArrayList 의 요소 목록을 포함 하는 CollectionBase 인스턴스.Gets an ArrayList containing the list of elements in the CollectionBase instance. (다음에서 상속됨 CollectionBase) |
Item[Int32] |
지정된 인덱스(0부터 시작)에서 MimePart의 값을 가져오거나 설정합니다.Gets or sets the value of a MimePart at the specified zero-based index. |
List |
가져옵니다는 IList 의 요소 목록을 포함 하는 CollectionBase 인스턴스.Gets an IList containing the list of elements in the CollectionBase instance. (다음에서 상속됨 CollectionBase) |
메서드
Add(MimePart) |
지정된 MimePart을 MimePartCollection 끝에 추가합니다.Adds the specified MimePart to the end of the MimePartCollection. |
Clear() |
개체를 모두 제거 된 CollectionBase 인스턴스.Removes all objects from the CollectionBase instance. 이 메서드는 재정의할 수 없습니다.This method cannot be overridden. (다음에서 상속됨 CollectionBase) |
Contains(MimePart) |
지정된 MimePart이 MimePartCollection의 멤버인지 여부를 나타내는 값을 반환합니다.Returns a value indicating whether the specified MimePart is a member of the MimePartCollection. |
CopyTo(MimePart[], Int32) |
대상 배열의 지정된 인덱스(0부터 시작)에서 시작하여 전체 MimePartCollection을 MimePart 형식의 호환되는 1차원 배열에 복사합니다.Copies the entire MimePartCollection to a compatible one-dimensional array of type MimePart, starting at the specified zero-based index of the target array. |
Equals(Object) |
지정한 개체와 현재 개체가 같은지 여부를 확인합니다.Determines whether the specified object is equal to the current object. (다음에서 상속됨 Object) |
GetEnumerator() |
반복 하는 열거자를 반환 합니다 CollectionBase 인스턴스.Returns an enumerator that iterates through the CollectionBase instance. (다음에서 상속됨 CollectionBase) |
GetHashCode() |
기본 해시 함수로 작동합니다.Serves as the default hash function. (다음에서 상속됨 Object) |
GetType() |
현재 인스턴스의 Type을 가져옵니다.Gets the Type of the current instance. (다음에서 상속됨 Object) |
IndexOf(MimePart) |
컬렉션에서 지정된 MimePart을 검색하여 처음 나오는 항목의 인덱스(0부터 시작)를 반환합니다.Searches for the specified MimePart and returns the zero-based index of the first occurrence within the collection. |
Insert(Int32, MimePart) |
지정된 MimePart를 MimePartCollection의 지정된 인덱스 위치에 추가합니다.Adds the specified MimePart to the MimePartCollection at the specified index. |
MemberwiseClone() |
현재 Object의 단순 복사본을 만듭니다.Creates a shallow copy of the current Object. (다음에서 상속됨 Object) |
OnClear() |
CollectionBase 인스턴스의 콘텐츠를 지운 후에 추가로 사용자 지정 프로세스를 수행합니다.Performs additional custom processes when clearing the contents of the CollectionBase instance. (다음에서 상속됨 CollectionBase) |
OnClearComplete() |
내용을 지운 후 사용자 지정 프로세스를 추가로 수행 합니다 CollectionBase 인스턴스.Performs additional custom processes after clearing the contents of the CollectionBase instance. (다음에서 상속됨 CollectionBase) |
OnInsert(Int32, Object) |
새 요소를 삽입 하기 전에 추가로 사용자 지정 프로세스를 수행 합니다 CollectionBase 인스턴스.Performs additional custom processes before inserting a new element into the CollectionBase instance. (다음에서 상속됨 CollectionBase) |
OnInsertComplete(Int32, Object) |
새 요소를 삽입 한 후 추가 사용자 지정 프로세스를 수행 합니다 CollectionBase 인스턴스.Performs additional custom processes after inserting a new element into the CollectionBase instance. (다음에서 상속됨 CollectionBase) |
OnRemove(Int32, Object) |
요소를 제거 하는 경우 추가 사용자 지정 프로세스를 수행 합니다 CollectionBase 인스턴스.Performs additional custom processes when removing an element from the CollectionBase instance. (다음에서 상속됨 CollectionBase) |
OnRemoveComplete(Int32, Object) |
요소를 제거한 후 추가 사용자 지정 프로세스를 수행 합니다 CollectionBase 인스턴스.Performs additional custom processes after removing an element from the CollectionBase instance. (다음에서 상속됨 CollectionBase) |
OnSet(Int32, Object, Object) |
에 값을 설정 하기 전에 추가로 사용자 지정 프로세스를 수행 합니다 CollectionBase 인스턴스.Performs additional custom processes before setting a value in the CollectionBase instance. (다음에서 상속됨 CollectionBase) |
OnSetComplete(Int32, Object, Object) |
값을 설정한 후 추가 사용자 지정 프로세스를 수행 합니다 CollectionBase 인스턴스.Performs additional custom processes after setting a value in the CollectionBase instance. (다음에서 상속됨 CollectionBase) |
OnValidate(Object) |
값 유효성을 검사할 때 추가로 사용자 지정 프로세스를 수행 합니다.Performs additional custom processes when validating a value. (다음에서 상속됨 CollectionBase) |
Remove(MimePart) |
MimePart에서 맨 처음 발견되는 지정된 MimePartCollection을 제거합니다.Removes the first occurrence of the specified MimePart from the MimePartCollection. |
RemoveAt(Int32) |
지정된 된 인덱스에서 요소를 제거 합니다 CollectionBase 인스턴스.Removes the element at the specified index of the CollectionBase instance. 이 메서드는 재정의할 수 없습니다.This method is not overridable. (다음에서 상속됨 CollectionBase) |
ToString() |
현재 개체를 나타내는 문자열을 반환합니다.Returns a string that represents the current object. (다음에서 상속됨 Object) |
명시적 인터페이스 구현
ICollection.CopyTo(Array, Int32) |
대상 배열의 지정된 인덱스에서 시작하여 전체 CollectionBase을 호환되는 1차원 Array에 복사합니다.Copies the entire CollectionBase to a compatible one-dimensional Array, starting at the specified index of the target array. (다음에서 상속됨 CollectionBase) |
ICollection.IsSynchronized |
CollectionBase에 대한 액세스가 동기화되어 스레드로부터 안전하게 보호되는지를 나타내는 값을 가져옵니다.Gets a value indicating whether access to the CollectionBase is synchronized (thread safe). (다음에서 상속됨 CollectionBase) |
ICollection.SyncRoot |
CollectionBase에 대한 액세스를 동기화하는 데 사용할 수 있는 개체를 가져옵니다.Gets an object that can be used to synchronize access to the CollectionBase. (다음에서 상속됨 CollectionBase) |
IList.Add(Object) |
개체를 CollectionBase의 끝 부분에 추가합니다.Adds an object to the end of the CollectionBase. (다음에서 상속됨 CollectionBase) |
IList.Contains(Object) |
CollectionBase에 특정 요소가 들어 있는지 여부를 확인합니다.Determines whether the CollectionBase contains a specific element. (다음에서 상속됨 CollectionBase) |
IList.IndexOf(Object) |
지정한 Object를 검색하고, 전체 CollectionBase 내에서 처음 나오는 0부터 시작하는 인덱스를 반환합니다.Searches for the specified Object and returns the zero-based index of the first occurrence within the entire CollectionBase. (다음에서 상속됨 CollectionBase) |
IList.Insert(Int32, Object) |
CollectionBase의 지정된 인덱스에 요소를 삽입합니다.Inserts an element into the CollectionBase at the specified index. (다음에서 상속됨 CollectionBase) |
IList.IsFixedSize |
CollectionBase의 크기가 고정되어 있는지를 나타내는 값을 가져옵니다.Gets a value indicating whether the CollectionBase has a fixed size. (다음에서 상속됨 CollectionBase) |
IList.IsReadOnly |
CollectionBase가 읽기 전용인지 여부를 나타내는 값을 가져옵니다.Gets a value indicating whether the CollectionBase is read-only. (다음에서 상속됨 CollectionBase) |
IList.Item[Int32] |
지정한 인덱스에 있는 요소를 가져오거나 설정합니다.Gets or sets the element at the specified index. (다음에서 상속됨 CollectionBase) |
IList.Remove(Object) |
CollectionBase에서 맨 처음 발견되는 특정 개체를 제거합니다.Removes the first occurrence of a specific object from the CollectionBase. (다음에서 상속됨 CollectionBase) |
확장 메서드
Cast<TResult>(IEnumerable) |
IEnumerable의 요소를 지정된 형식으로 캐스팅합니다.Casts the elements of an IEnumerable to the specified type. |
OfType<TResult>(IEnumerable) |
지정된 형식에 따라 IEnumerable의 요소를 필터링합니다.Filters the elements of an IEnumerable based on a specified type. |
AsParallel(IEnumerable) |
쿼리를 병렬화할 수 있도록 합니다.Enables parallelization of a query. |
AsQueryable(IEnumerable) |
IEnumerable을 IQueryable로 변환합니다.Converts an IEnumerable to an IQueryable. |