static private void ShowForm() { loadingForm = new LoadingForm(); Application.Run(loadingForm); }
static private void closeFormInternal() { loadingForm.Close(); loadingForm = null; }
private void uploadBtn_Click(object sender, EventArgs e) /* Updating a version button click. * * The function checks the selected version from the version list, * and acts accordingly (weather a branch is selected or a version). */ { try { bool Done = true; if (versionList.SelectedIndex > -1 && versionList.SelectedItem.ToString().Contains(".")) { DialogResult result = openFileDialogU.ShowDialog(); if (result == DialogResult.OK) { string ver = versionList.SelectedItem.ToString().Split('.')[0]; string lastBranch = Get_lastBranch(ver); if (lastBranch == versionList.SelectedItem.ToString()) { this.File = openFileDialogU.FileName; string fileInfo = this.File.Split('.')[this.File.Split('.').Length - 1]; string project = projectList.GetItemText(projectList.SelectedItem); bool valiable = false; foreach (string ext in this.text_extensions) { if (fileInfo == ext) { valiable = true; break; } } if (!valiable) { successMessage1.Visible = false; errorMessage1.Set_Message("File Type Not Supported"); errorMessage1.Visible = true; successMessage1.BringToFront(); return; } LoadingForm.ShowLoadingScreen(); this.cSock.Manage_Branch(projectList.SelectedItem.ToString(), this.File, fileInfo, lastBranch.Replace(" ", string.Empty)); //Sending File To Server Method } else { successMessage1.Visible = false; errorMessage1.Set_Message("Newer Version Available"); errorMessage1.Visible = true; successMessage1.BringToFront(); Done = false; } } } else { DialogResult result = openFileDialogU.ShowDialog(); if (result == DialogResult.OK && projectList.SelectedIndex > -1) { this.File = openFileDialogU.FileName; string fileInfo = this.File.Split('.')[this.File.Split('.').Length - 1]; string project = projectList.GetItemText(projectList.SelectedItem); int lastVersion = Get_lastVersion(); if (versionList.SelectedItem.ToString() == lastVersion.ToString()) { bool valiable = false; foreach (string ext in this.text_extensions) { if (fileInfo == ext) { valiable = true; break; } } if (!valiable) { successMessage1.Visible = false; errorMessage1.Set_Message("File Type Not Supported"); errorMessage1.Visible = true; successMessage1.BringToFront(); return; } LoadingForm.ShowLoadingScreen(); this.cSock.Update_Project(projectList.SelectedItem.ToString(), this.File, fileInfo); //Sending File To Server Method } else { LoadingForm.CloseForm(); successMessage1.Visible = false; errorMessage1.Set_Message("Newer Version Available"); errorMessage1.Visible = true; successMessage1.BringToFront(); Done = false; } } } if (Done) { LoadingForm.CloseForm(); errorMessage1.Visible = false; successMessage1.Set_Message("Project Updated!"); successMessage1.Visible = true; successMessage1.BringToFront(); projectList_SelectedIndexChanged(null, null); } } catch { } }