EventDescriptorCollection.Find(String, Boolean) Yöntem

Tanım

Koleksiyonda belirtilen ada sahip olayın açıklamasını alır.

public:
 virtual System::ComponentModel::EventDescriptor ^ Find(System::String ^ name, bool ignoreCase);
public virtual System.ComponentModel.EventDescriptor Find (string name, bool ignoreCase);
public virtual System.ComponentModel.EventDescriptor? Find (string name, bool ignoreCase);
abstract member Find : string * bool -> System.ComponentModel.EventDescriptor
override this.Find : string * bool -> System.ComponentModel.EventDescriptor
Public Overridable Function Find (name As String, ignoreCase As Boolean) As EventDescriptor

Parametreler

name
String

Koleksiyondan alınacak olayın adı.

ignoreCase
Boolean

true olayın büyük/küçük harf durumunu yoksaymak istiyorsanız; aksi takdirde , false.

Döndürülenler

EventDescriptor belirtilen ada sahip veya null olay yoksa.

Örnekler

Aşağıdaki kod örneği belirli EventDescriptorbir bulur. Bunun için EventDescriptor bileşen türünü bir metin kutusuna yazdırır. Bunun için bir textBox1 formda örnek oluşturulması gerekirbutton1.

private:
   void FindEvent()
   {
      // Creates a new collection and assigns it the events for button1.
      EventDescriptorCollection^ events = TypeDescriptor::GetEvents( button1 );
      
      // Sets an EventDescriptor to the specific event.
      EventDescriptor^ myEvent = events->Find( "Resize", false );
      
      // Prints the event name and event description.
      textBox1->Text = String::Concat( myEvent->Name, ": ", myEvent->Description );
   }
private void FindEvent() {
    // Creates a new collection and assigns it the events for button1.
    EventDescriptorCollection events = TypeDescriptor.GetEvents(button1);
 
    // Sets an EventDescriptor to the specific event.
    EventDescriptor myEvent = events.Find("Resize", false);
 
    // Prints the event name and event description.
    textBox1.Text = myEvent.Name + ": " + myEvent.Description;
 }
Private Sub FindEvent()
    ' Creates a new collection and assigns it the events for button1.
    Dim events As EventDescriptorCollection = TypeDescriptor.GetEvents(button1)
    
    ' Sets an EventDescriptor to the specific event.
    Dim myEvent As EventDescriptor = events.Find("Resize", False)
    
    ' Prints the event name and event description.
    textBox1.Text = myEvent.Name & ": " & myEvent.Description
End Sub

Açıklamalar

Not

Bu HostProtectionAttribute sınıfa uygulanan özniteliğin şu Resources özellik değeri vardır: Synchronization. HostProtectionAttribute masaüstü uygulamalarını etkilemez (bunlar normalde bir simge tıklatılarak, komut yazılarak veya tarayıcıya URL girilerek başlatılır). Daha fazla bilgi için bkzHostProtectionAttribute. Programlama ve Konak Koruması Öznitelikleri sınıfı veya SQL Server.

Şunlara uygulanır

Ayrıca bkz.