Control.AccessibilityNotifyClients Metoda

Definicja

Powiadamia aplikacje klienckie ułatwień dostępu dla programu AccessibleEvents.

Przeciążenia

AccessibilityNotifyClients(AccessibleEvents, Int32)

Powiadamia aplikacje klienckie ułatwień dostępu określone AccessibleEvents dla określonej kontrolki podrzędnej.

AccessibilityNotifyClients(AccessibleEvents, Int32, Int32)

Powiadamia aplikacje klienckie ułatwień dostępu określone AccessibleEvents dla określonej kontrolki podrzędnej .

AccessibilityNotifyClients(AccessibleEvents, Int32)

Powiadamia aplikacje klienckie ułatwień dostępu określone AccessibleEvents dla określonej kontrolki podrzędnej.

protected:
 void AccessibilityNotifyClients(System::Windows::Forms::AccessibleEvents accEvent, int childID);
protected public:
 void AccessibilityNotifyClients(System::Windows::Forms::AccessibleEvents accEvent, int childID);
protected void AccessibilityNotifyClients (System.Windows.Forms.AccessibleEvents accEvent, int childID);
protected internal void AccessibilityNotifyClients (System.Windows.Forms.AccessibleEvents accEvent, int childID);
member this.AccessibilityNotifyClients : System.Windows.Forms.AccessibleEvents * int -> unit
Protected Sub AccessibilityNotifyClients (accEvent As AccessibleEvents, childID As Integer)
Protected Friend Sub AccessibilityNotifyClients (accEvent As AccessibleEvents, childID As Integer)

Parametry

accEvent
AccessibleEvents

Element do powiadamiania AccessibleEvents aplikacji klienckich o ułatwieniach dostępu.

childID
Int32

Element podrzędny Control do powiadamiania o dostępnym zdarzeniu.

Przykłady

Poniższy przykład kodu przedstawia tworzenie kontrolki wykresu obsługującego ułatwienia dostępu przy użyciu AccessibleObject klas i Control.ControlAccessibleObject w celu uwidocznienia dostępnych informacji. Kontrolka wykreśli dwie krzywe wraz z legendą. Klasa ChartControlAccessibleObject , która pochodzi z ControlAccessibleObjectklasy , jest używana w metodzie CreateAccessibilityInstance w celu zapewnienia niestandardowych informacji dostępnych dla kontrolki wykresu. Ponieważ legenda wykresu nie jest rzeczywistą Control kontrolką opartą na wykresie, ale zamiast tego jest rysowana przez kontrolkę wykresu, nie zawiera żadnych wbudowanych informacji dostępnych. W związku z tym ChartControlAccessibleObject klasa zastępuje metodę GetChild , aby zwrócić CurveLegendAccessibleObject element reprezentujący dostępne informacje dla każdej części legendy. Gdy ta kontrolka jest używana przez aplikację z ułatwieniami dostępu, kontrolka może dostarczać niezbędne dostępne informacje.

Ten fragment kodu przedstawia wywołanie AccessibilityNotifyClients metody . Zobacz omówienie klasy, AccessibleObject aby zapoznać się z kompletnym przykładem kodu.

   // Gets or sets the location for the curve legend.
   Point get()
   {
      return location;
   }

   void set( Point value )
   {
      location = value;
      chart->Invalidate();
      
      // Notifies the chart of the location change. This is used for
      // the accessibility information. AccessibleEvents::LocationChange
      // tells the chart the reason for the notification.
      chart->AccessibilityNotifyClients( AccessibleEvents::LocationChange, (dynamic_cast<CurveLegendAccessibleObject^>(AccessibilityObject))->ID );
   }

}

property String^ Name 
{

   // Gets or sets the Name for the curve legend.
   String^ get()
   {
      return name;
   }

   void set( String^ value )
   {
      if ( name != value )
      {
         name = value;
         chart->Invalidate();
         
         // Notifies the chart of the name change. This is used for
         // the accessibility information. AccessibleEvents::NameChange
         // tells the chart the reason for the notification.
         chart->AccessibilityNotifyClients( AccessibleEvents::NameChange, (dynamic_cast<CurveLegendAccessibleObject^>(AccessibilityObject))->ID );
      }
   }

}

property bool Selected 
{

   // Gets or sets the Selected state for the curve legend.
   bool get()
   {
      return selected;
   }

   void set( bool value )
   {
      if ( selected != value )
      {
         selected = value;
         chart->Invalidate();
         
         // Notifies the chart of the selection value change. This is used for
         // the accessibility information. The AccessibleEvents value depends upon
         // if the selection is true (AccessibleEvents::SelectionAdd) or
         // false (AccessibleEvents::SelectionRemove).
         chart->AccessibilityNotifyClients( selected ? AccessibleEvents::SelectionAdd : AccessibleEvents::SelectionRemove, (dynamic_cast<CurveLegendAccessibleObject^>(AccessibilityObject))->ID );
      }
   }
    // Gets or sets the location for the curve legend.
    public Point Location
    {   
        get {
            return location;
        }
        set {
            location = value;
            chart.Invalidate();

            // Notifies the chart of the location change. This is used for
            // the accessibility information. AccessibleEvents.LocationChange
            // tells the chart the reason for the notification.

            chart.AccessibilityNotifyClients(AccessibleEvents.LocationChange, 
                ((CurveLegendAccessibleObject)AccessibilityObject).ID);
        }
    }            

    // Gets or sets the Name for the curve legend.
    public string Name
    {   
        get {
            return name;
        }
        set {
            if (name != value) 
            {
                name = value;
                chart.Invalidate();

                // Notifies the chart of the name change. This is used for
                // the accessibility information. AccessibleEvents.NameChange
                // tells the chart the reason for the notification.

                chart.AccessibilityNotifyClients(AccessibleEvents.NameChange, 
                    ((CurveLegendAccessibleObject)AccessibilityObject).ID);
            }
        }
    }

    // Gets or sets the Selected state for the curve legend.
    public bool Selected
    {   
        get {
            return selected;
        }
        set {
            if (selected != value) 
            {
                selected = value;
                chart.Invalidate();

                // Notifies the chart of the selection value change. This is used for
                // the accessibility information. The AccessibleEvents value depends upon
                // if the selection is true (AccessibleEvents.SelectionAdd) or 
                // false (AccessibleEvents.SelectionRemove).
                chart.AccessibilityNotifyClients(
                    selected ? AccessibleEvents.SelectionAdd : AccessibleEvents.SelectionRemove, 
                    ((CurveLegendAccessibleObject)AccessibilityObject).ID);
            }
        }
    }
' Gets or sets the location for the curve legend.            
Public Property Location() As Point
    Get
        Return m_location
    End Get
    Set
        m_location = value
        chart.Invalidate()

        ' Notifies the chart of the location change. This is used for
        ' the accessibility information. AccessibleEvents.LocationChange
        ' tells the chart the reason for the notification.
        chart.ExposeAccessibilityNotifyClients(AccessibleEvents.LocationChange, _
                CType(AccessibilityObject, CurveLegendAccessibleObject).ID)
    End Set
End Property

' Gets or sets the Name for the curve legend.            
Public Property Name() As String
    Get
        Return m_name
    End Get
    Set
        If m_name <> value Then
            m_name = value
            chart.Invalidate()

            ' Notifies the chart of the name change. This is used for
            ' the accessibility information. AccessibleEvents.NameChange
            ' tells the chart the reason for the notification. 
            chart.ExposeAccessibilityNotifyClients(AccessibleEvents.NameChange, _
                    CType(AccessibilityObject, CurveLegendAccessibleObject).ID)
        End If
    End Set
End Property

' Gets or sets the Selected state for the curve legend.            
Public Property Selected() As Boolean
    Get
        Return m_selected
    End Get
    Set
        If m_selected <> value Then
            m_selected = value
            chart.Invalidate()

            ' Notifies the chart of the selection value change. This is used for
            ' the accessibility information. The AccessibleEvents value varies
            ' on whether the selection is true (AccessibleEvents.SelectionAdd) or 
            ' false (AccessibleEvents.SelectionRemove). 
            If m_selected Then
                chart.ExposeAccessibilityNotifyClients(AccessibleEvents.SelectionAdd, _
                        CType(AccessibilityObject, CurveLegendAccessibleObject).ID) 
            Else
                chart.ExposeAccessibilityNotifyClients(AccessibleEvents.SelectionRemove, _
                        CType(AccessibilityObject, CurveLegendAccessibleObject).ID) 
            End If
        End If
    End Set
End Property

Uwagi

Należy wywołać metodę Control.ControlAccessibleObject.NotifyClients dla każdej AccessibleEvents aplikacji klienckiej ułatwień dostępu, które mają być powiadamiane. Metoda NotifyClients jest zwykle wywoływana, gdy właściwość jest ustawiona lub z poziomu programu obsługi zdarzeń. Można na przykład wywołać metodę NotifyClients i przekazać AccessibleEvents wartość Hide z poziomu programu obsługi zdarzeń dla zdarzenia Control.VisibleChanged .

Zobacz też

Dotyczy

AccessibilityNotifyClients(AccessibleEvents, Int32, Int32)

Powiadamia aplikacje klienckie ułatwień dostępu określone AccessibleEvents dla określonej kontrolki podrzędnej .

protected:
 void AccessibilityNotifyClients(System::Windows::Forms::AccessibleEvents accEvent, int objectID, int childID);
protected void AccessibilityNotifyClients (System.Windows.Forms.AccessibleEvents accEvent, int objectID, int childID);
member this.AccessibilityNotifyClients : System.Windows.Forms.AccessibleEvents * int * int -> unit
Protected Sub AccessibilityNotifyClients (accEvent As AccessibleEvents, objectID As Integer, childID As Integer)

Parametry

accEvent
AccessibleEvents

Element do powiadamiania AccessibleEvents aplikacji klienckich o ułatwieniach dostępu.

objectID
Int32

Identyfikator obiektu AccessibleObject.

childID
Int32

Element podrzędny Control do powiadamiania o dostępnym zdarzeniu.

Dotyczy