Example #1
0
        /// <summary>
        /// Handles the Click event of the AddDimension control. Button, Menu or Tree Node.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        private void AddDimension_Click(object sender, EventArgs e)
        {
            string          businessProcess = this.tabControlArea.SelectedTab.Text;
            BusinessProcess b = this.cmodel.GetBusinessProcess(businessProcess);

            using (AddDimension am = new AddDimension(b))
            {
                Point location = new Point((this.Left + (this.Width / 2)) - am.Width / 2, (this.Top + (this.Height / 2)) - am.Height / 2);
                am.StartPosition = FormStartPosition.Manual;
                am.Location      = location;
                var result = am.ShowDialog();
                if (result == DialogResult.OK)
                {
                    Dimension d = new Dimension();
                    d.Name = am.DimensionName.Text;

                    b.AddDimension(d);
                    this.Draw();
                    tabControlArea.SelectTab(businessProcess);
                }
            }
        }