using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace ETHZurich.OrigoVSIntegration.Dialogs { public partial class ReleaseDialog : Form { #region -------------------- Members ------------------------------------ private DialogResult m_Result; #endregion ----------------- End Members -------------------------------- //*********************************************************************** #region -------------------- Initialisation ----------------------------- public ReleaseDialog() { InitializeComponent(); } //----------------------------------------------------------------------- private void ReleaseDialog_Load(object sender, EventArgs e) { m_Result = DialogResult.None; } #endregion ----------------- End Initialisation ------------------------- //*********************************************************************** #region -------------------- Properties --------------------------------- public DialogResult Result { get { return m_Result; } } public string ReleaseName { get { return TxtName.Text; } } public string ReleaseVersion { get { return TxtVersion.Text; } } public string ReleaseDescription { get { return TxtDescription.Text; } } #endregion ----------------- End Properties ----------------------------- //*********************************************************************** #region -------------------- Event Handlers ----------------------------- private void BtnCancel_Click(object sender, EventArgs e) { m_Result = DialogResult.Cancel; Close(); } //----------------------------------------------------------------------- private void BtnOk_Click(object sender, EventArgs e) { TxtName.Text = TxtName.Text.Trim(); TxtVersion.Text = TxtVersion.Text.Trim(); TxtDescription.Text = TxtDescription.Text.Trim(); if (TxtName.Text.Equals(string.Empty)) { MessageBox.Show("You have to specify a release name", "Error"); return; } else if (TxtVersion.Text.Equals(string.Empty)) { MessageBox.Show("You have to specify a version", "Error"); return; } else if (TxtDescription.Text.Equals(string.Empty)) { MessageBox.Show("You have to enter a description", "Error"); return; } else if (TxtName.Text.Contains("\"") || TxtVersion.Text.Contains("\"") || TxtDescription.Text.Contains("\"")) { MessageBox.Show("There are no \" allowed here."); return; } m_Result = DialogResult.OK; Close(); } #endregion ----------------- End Event Handlers ------------------------- //*********************************************************************** } }