Esempio n. 1
0
        /// <summary>
        /// Validates the form.
        /// </summary>
        /// <returns></returns>
        private bool ValidateForm()
        {
            if (this.process != null && process.GetMeasure(this.MeasureName.Text) != null)
            {
                return(false);
            }
            if (this.MeasureName.Text == "")
            {
                return(false);
            }
            Regex r = new Regex(@"\\");

            if (r.IsMatch(MeasureName.Text))
            {
                return(false);
            }
            return(true);
        }
Esempio n. 2
0
        private void AddAggregation_Click(object sender, EventArgs e, TreeNode t)
        {
            string          businessProcess = this.tabControlArea.SelectedTab.Text;
            BusinessProcess b = this.cmodel.GetBusinessProcess(businessProcess);
            Measure         m = b.GetMeasure(t.Text);

            using (AddAggregation am = new AddAggregation(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)
                {
                    Aggregation a = new Aggregation();
                    a.AggType       = am.AggType.Text;
                    a.AssocLevelUID = am.Level.SelectedValue.ToString();
                    m.AddAggregation(a);
                    this.Draw();
                    tabControlArea.SelectTab(businessProcess);
                }
            }
        }