private void btnRegister_Click(object sender, EventArgs e) { switch (this.gablarski.ServerInfo.RegistrationMode) { case UserRegistrationMode.WebPage: Uri url; if (Uri.TryCreate(this.gablarski.ServerInfo.RegistrationContent, UriKind.Absolute, out url) && !url.IsFile) { Process.Start(url.AbsolutePath); } break; case UserRegistrationMode.Message: if (TaskDialog.IsPlatformSupported) { TaskDialog d = new TaskDialog(); d.Caption = "Registration"; d.Text = this.gablarski.ServerInfo.RegistrationContent; d.Icon = TaskDialogStandardIcon.Information; d.Show(); } else { MessageBox.Show(this.gablarski.ServerInfo.RegistrationContent, "Registration", MessageBoxButtons.OK, MessageBoxIcon.Information); } break; case UserRegistrationMode.Approved: case UserRegistrationMode.Normal: case UserRegistrationMode.PreApproved: var register = new RegisterForm(this.gablarski); if (register.ShowDialog(this) == DialogResult.Abort) { this.btnRegister.Visible = false; } break; } }
private void btnRegister_Click (object sender, EventArgs e) { switch (this.gablarski.ServerInfo.RegistrationMode) { case UserRegistrationMode.WebPage: Uri url; if (Uri.TryCreate (this.gablarski.ServerInfo.RegistrationContent, UriKind.Absolute, out url) && !url.IsFile) Process.Start (url.AbsolutePath); break; case UserRegistrationMode.Message: if (TaskDialog.IsPlatformSupported) { TaskDialog d = new TaskDialog(); d.Caption = "Registration"; d.Text = this.gablarski.ServerInfo.RegistrationContent; d.Icon = TaskDialogStandardIcon.Information; d.Show(); } else { MessageBox.Show (this.gablarski.ServerInfo.RegistrationContent, "Registration", MessageBoxButtons.OK, MessageBoxIcon.Information); } break; case UserRegistrationMode.Approved: case UserRegistrationMode.Normal: case UserRegistrationMode.PreApproved: var register = new RegisterForm (this.gablarski); if (register.ShowDialog (this) == DialogResult.Abort) this.btnRegister.Visible = false; break; } }