Rsdn.Janus.FavoritesLinkForm._okButton_Click C# (CSharp) Method

_okButton_Click() private method

private _okButton_Click ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
		private void _okButton_Click(object sender, EventArgs e)
		{
			if (_urlTextBox.Text.Trim().Length == 0)
			{
				MessageBox.Show(this, SR.Favorites.EmptyLink,
					ApplicationInfo.ApplicationName,
					MessageBoxButtons.OK, MessageBoxIcon.Information);
				return;
			}
			//TODO оптимизировать проверку
			if (!(_urlTextBox.Text.Trim().StartsWith("janus://") 
				|| _urlTextBox.Text.Trim().StartsWith("http://")))
			{
				MessageBox.Show(this, SR.Favorites.BadProtocol,
					ApplicationInfo.ApplicationName,
					MessageBoxButtons.OK, MessageBoxIcon.Information);
				return;
			}

			DialogResult = DialogResult.OK;
		}