MimeTextMatch::Capture Property

 

Gets or sets a value indicating the zero-based index of a MimeTextMatch within a group.

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

public:
property int Capture {
	int get();
	void set(int value);
}

Property Value

Type: System::Int32

A 32-bit signed integer. The default value is 0, indicating that the MimeTextMatch is the first instance within a group.

Exception Condition
ArgumentException

The property value is negative.

For more information, see the Group and Matches properties.

// Create an InputBinding.
InputBinding^ myInputBinding = gcnew InputBinding;
MimeTextBinding^ myMimeTextBinding = gcnew MimeTextBinding;
MimeTextMatchCollection^ myMimeTextMatchCollection1 = gcnew MimeTextMatchCollection;
array<MimeTextMatch^>^myMimeTextMatch = gcnew array<MimeTextMatch^>(3);
myMimeTextMatchCollection1 = myMimeTextBinding->Matches;

// Intialize the MimeTextMatch.
for ( myInt = 0; myInt < 3; myInt++ )
{
   // Get a new MimeTextMatch.
   myMimeTextMatch[ myInt ] = gcnew MimeTextMatch;

   // Assign values to properties of the MimeTextMatch.
   myMimeTextMatch[ myInt ]->Name = String::Format( "Title{0}", Convert::ToString( myInt ) );
   myMimeTextMatch[ myInt ]->Type = "*/*";
   myMimeTextMatch[ myInt ]->Pattern = "TITLE&gt;(.*?)&lt;";
   myMimeTextMatch[ myInt ]->IgnoreCase = true;
   myMimeTextMatch[ myInt ]->Capture = 2;
   myMimeTextMatch[ myInt ]->Group = 2;
   if ( myInt != 0 )
   {

      // Assign the Repeats property if the index is not 0.
      myMimeTextMatch[ myInt ]->Repeats = 2;
   }
   else
   {

      // Assign the RepeatsString property if the index is 0.
      myMimeTextMatch[ myInt ]->RepeatsString = "4";
   }
   myMimeTextMatchCollection1->Add( myMimeTextMatch[ myInt ] );

}

.NET Framework
Available since 1.1
Return to top
Show: