Leggere in inglese

Condividi tramite


ISupportInitialize Interfaccia

Definizione

Consente di specificare che questo oggetto supporta una semplice notifica sottoposta a transazione per l'inizializzazione batch.

C#
public interface ISupportInitialize
Derivato

Esempio

Nell'esempio di codice seguente viene illustrato come usare l'interfaccia ISupportInitialize per inizializzare tre TrackBar controlli.

C#
((System.ComponentModel.ISupportInitialize)(this.trackBar1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.trackBar2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.trackBar3)).BeginInit();
this.SuspendLayout();
// 
// trackBar1
// 
this.trackBar1.Location = new System.Drawing.Point(160, 400);
this.trackBar1.Name = "trackBar1";
this.trackBar1.TabIndex = 1;
this.trackBar1.Scroll += new System.EventHandler(this.trackBar_Scroll);
// 
// trackBar2
// 
this.trackBar2.Location = new System.Drawing.Point(608, 40);
this.trackBar2.Name = "trackBar2";
this.trackBar2.TabIndex = 2;
this.trackBar2.Scroll += new System.EventHandler(this.trackBar_Scroll);
// 
// trackBar3
// 
this.trackBar3.Location = new System.Drawing.Point(56, 40);
this.trackBar3.Name = "trackBar3";
this.trackBar3.TabIndex = 3;
this.trackBar3.Scroll += new System.EventHandler(this.trackBar_Scroll);
((System.ComponentModel.ISupportInitialize)(this.trackBar1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.trackBar2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.trackBar3)).EndInit();

Commenti

ISupportInitialize consente ai controlli di ottimizzare più assegnazioni di proprietà. Di conseguenza, è possibile inizializzare proprietà dipendenti da co-dipendenti o impostare più proprietà in fase di progettazione.

Chiamare il BeginInit metodo per segnalare l'avvio dell'inizializzazione. Chiamare il EndInit metodo per segnalare che l'inizializzazione è stata completata.

Metodi

BeginInit()

Segnala all'oggetto l'avvio dell'inizializzazione.

EndInit()

Segnala all'oggetto che l'inizializzazione è completa.

Si applica a

Prodotto Versioni
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

Vedi anche