internal void RaiseContentPanelStateChange(object sender, MainApplicationWindow.ContentPanelStateChangeEventArgs e) { ContentPanelStateChange(sender, e); }
private void MainApplicationWindow_ContentPanelStateChange(object sender, MainApplicationWindow.ContentPanelStateChangeEventArgs e) { //Check we are on the UI thread if (this.contentPanel.InvokeRequired) { this.contentPanel.Invoke(new MethodInvoker(delegate { MainApplicationWindow_ContentPanelStateChange(sender, e); })); return; } //Remove the current state of the content panel this.contentPanel.Controls.Clear(); switch (e.ContentPanelState) { case ContentPanelStates.EjectingCard: this.contentPanel.Controls.Add(new ContentPanels.EjectingCardContentPanel(this, e.ConnectedCard)); break; case ContentPanelStates.ConnectionQuestions: this.contentPanel.Controls.Add(new ContentPanels.ConnectionQuestionsContentPanel(this)); break; case ContentPanelStates.CardNotFound: this.contentPanel.Controls.Add(new ContentPanels.ConnectionErrorContentPanel(this, e.PotentiallyConnectedCards)); break; case ContentPanelStates.CardFound: this.contentPanel.Controls.Add(new ContentPanels.EditingCardContentPanel(this, e.ConnectedCard, false)); break; case ContentPanelStates.CardSaved: this.contentPanel.Controls.Add(new ContentPanels.EditingCardContentPanel(this, e.ConnectedCard, true)); break; case ContentPanelStates.SavingCard: this.contentPanel.Controls.Add(new ContentPanels.SavingCardContentPanel(this, e.ConnectedCard)); break; case ContentPanelStates.Waiting: default: this.contentPanel.Controls.Add(new ContentPanels.WaitingContentPanel(this)); break; } }