public ucDesign(clsDesign designSelected) { InitializeComponent(); designClass = designSelected; //templateId = Guid.NewGuid(); templateId = designSelected.designId; countSaveClick = 1; rvm = new rightMenuViewModel(); controlCreator = new createControl(); listViewDesignBgClass = new clsListViewDesignBackground(); controlCollection = new clsControls(); textBlockCollection = new clsTextblocks(); imageCollection = new clsImages(); buttonCollection = new clsButtons(); textBoxCollection = new clsTextBoxes(); comboboxCollection = new clsComboBoxes(); datePickerCollection = new clsDatePickers(); buttonActionClass = new clsButtonAction(); Switcher.pageSwitcher = this; dictionaryForFieldNameAndInputType = new Dictionary <string, string>(); dictionaryForComboboxItem = new Dictionary <string, List <string> >(); dictionaryInputDatatype = new Dictionary <string, string>(); dictionaryForFieldNameAndId = new Dictionary <string, int>(); //clsXmlInteraction.createFirstXml(templateId); loadDesignedTemplate(); tbDescription.Text = designSelected.description; DataContext = this; }
public clsXmlInteraction(Guid templateId) { this.templateId = templateId.ToString(); controlCreator = new createControl(); objectCollection = new clsObjects(); }
public TestInterfaceContainerPanel() { _currentInControlDAO = CreateAppropriateDAO(); createControl createUpDown = new createControl((string name, int inLambdaCount) => { NumericUpDown locUpDown = new NumericUpDown(); locUpDown.Value = _rnd.Next((int)locUpDown.Minimum, (int)locUpDown.Maximum); locUpDown.Tag = count; locUpDown.Width = 50; if (inLambdaCount == 0) { locUpDown.Enabled = false; } Label propName = new Label(); propName.Tag = -2; propName.AutoSize = true; propName.Text = name; propName.Location = new Point(5, 5 + 25 * count); propName.Width = propName.Text.Length * 10; locUpDown.Location = new Point(propName.Location.X + propName.Width + 10, 5 + 25 * count); count++; this.Controls.Add(propName); this.Controls.Add(locUpDown); }); _typeControlPair.Add(typeof(long), createUpDown); _typeControlPair.Add(typeof(int), createUpDown); createControl createTextBox = new createControl((string name, int inLambdaCount) => { TextBox locTextBox = new TextBox(); locTextBox.Text = Statics.GetUniqueKeyOriginal_BIASED(_rnd.Next(5, 10)).FirstLetterToupper(); locTextBox.Tag = count; Label propName = new Label(); propName.Tag = -2; propName.AutoSize = true; propName.Text = name; if (name == "Password") { _txtPasswprd = locTextBox; } if (name == "UserName") { _txtUserName = locTextBox; } propName.Location = new Point(5, 5 + 25 * count); propName.Width = propName.Text.Length * 10; locTextBox.Location = new Point(propName.Location.X + propName.Width + 10, 5 + 25 * count); count++; this.Controls.Add(propName); this.Controls.Add(locTextBox); }); _typeControlPair.Add(typeof(string), createTextBox); createControl createDateTimePicker = new createControl((string name, int inLambdaCount) => { DateTimePicker locPicker = new DateTimePicker(); locPicker.Tag = count; locPicker.Value = new DateTime(_rnd.Next(locPicker.MinDate.Year, locPicker.MaxDate.Year), _rnd.Next(locPicker.MinDate.Month, locPicker.MaxDate.Month), _rnd.Next(locPicker.MinDate.Day, locPicker.MaxDate.Day)); Label propName = new Label(); propName.Tag = -2; propName.AutoSize = true; propName.Text = name; propName.Location = new Point(5, 5 + 25 * count); propName.Width = propName.Text.Length * 10; locPicker.Location = new Point(propName.Location.X + propName.Width + 10, 5 + 25 * count); count++; this.Controls.Add(propName); this.Controls.Add(locPicker); }); _typeControlPair.Add(typeof(DateTime), createDateTimePicker); AddingToMyself(); }