private void OnFormVisiblityChangeAndClose() { if (backgroundWorker1.IsBusy == true) { backgroundWorker1.CancelAsync(); } this.axWindowsMediaPlayer1.URL = ""; try { for (int i = 0; i < tempFileList.Count; i++) { File.Delete(tempFileList[i]); } } // if file is already decrypting and we are trying to delete it. catch (Exception) { } if (_hiddenSourceControl == null) { this.ParentFormControl.Show(); return; } switch (_hiddenSourceControl.Name.ToLower()) { case "treeview1": if (this.ParentFormControl.Name == "frmVideoLibrary") { (this.ParentFormControl as frmVideoLibrary).SelectedNode = this.treeView1.SelectedNode; (this.ParentFormControl as frmVideoLibrary).UpdateTreeSelectedNode = true; this.ParentFormControl.Show(); } else { frmVideoLibrary frmVideoLibrary = new frmVideoLibrary(); frmVideoLibrary.ParentFormControl = this.DashboardFormControl; frmVideoLibrary.DashboardFormControl = this.DashboardFormControl; frmVideoLibrary.ClientInfoObject = this.ClientInfoObject; frmVideoLibrary.SelectedNode = this.treeView1.SelectedNode; frmVideoLibrary.Show(); } break; case "pnllogo": this.DashboardFormControl.Show(); break; case "frmUpCommingVideo": this.ParentFormControl.Show(); break; default: this.Visible = true; break; } }
private void OpenVideoLibrary(TreeNode selectedNode) { frmVideoLibrary frmVideoLibrary = new frmVideoLibrary(); frmVideoLibrary.ParentFormControl = this; frmVideoLibrary.DashboardFormControl = this; frmVideoLibrary.ClientInfoObject = this.ClientInfoObject; frmVideoLibrary.SelectedNode = selectedNode; frmVideoLibrary.Show(); CommonAppStateDataHelper.AddForm(this); this.Hide(); }