internal LocationControl(LocationData data, Redirect parent, IEnumerable<Property> properties) { _data = data; _parent = parent; _tableFilters = new Table(); _panelEnabled = new Panel(); _panelMatchExpression = new Panel(); _panelProperty = new Panel(); _panelValue = new Panel(); _textBoxName = new TextBox(); _textBoxUrl = new TextBox(); _textBoxMatchExpression = new TextBox(); _buttonAdd = new Button(); _buttonRemove = new Button(); _buttonToggle = new Button(); _customValidatorMatchExpression = new CustomValidator(); _requiredFieldValidatorName = new RequiredFieldValidator(); _regularExpressionValidatorUrl = new RegularExpressionValidator(); _textBoxName.Text = _data.Name; _textBoxUrl.Text = _data.Url; _textBoxMatchExpression.Text = _data.MatchExpression; _requiredFieldValidatorName.EnableClientScript = _regularExpressionValidatorUrl.EnableClientScript = false; _requiredFieldValidatorName.ValidationGroup = _customValidatorMatchExpression.ValidationGroup = _regularExpressionValidatorUrl.ValidationGroup = VALIDATION_GROUP; _requiredFieldValidatorName.Display = _customValidatorMatchExpression.Display = _regularExpressionValidatorUrl.Display = ValidatorDisplay.None; _regularExpressionValidatorUrl.ValidationExpression = REGEX_URL; TableHeaderRow rowHeader = new TableHeaderRow(); rowHeader.Cells.Add(NewCell(_panelProperty)); rowHeader.Cells.Add(NewCell(_panelValue)); rowHeader.Cells.Add(NewCell(_panelMatchExpression)); rowHeader.Cells.Add(NewCell(_panelEnabled)); _tableFilters.Rows.Add(rowHeader); foreach (FilterData filter in _data) _tableFilters.Rows.Add(new FilterControl(filter, _parent, properties)); }
internal LocationsControl (RedirectData data, Redirect parent) { _data = data; _parent = parent; _panelName = new Panel(); _panelUrl = new Panel(); _panelMatchExpression = new Panel(); _panelFilters = new Panel(); _customValidatorUniqueName = new CustomValidator(); }
internal FilterControl(FilterData data, Redirect parent, IEnumerable<Property> properties) { _data = data; _parent = parent; _ddlProperties = new DropDownList(); _ddlValues = new DropDownList(); _textBoxExpression = new TextBox(); _checkBoxEnabled = new CheckBox(); _buttonDelete = new Button(); _customValidatorMatchExpression = new CustomValidator(); _ddlProperties.DataSource = properties; _ddlProperties.AutoPostBack = true; _ddlValues.AutoPostBack = true; _customValidatorMatchExpression.Display = ValidatorDisplay.None; _customValidatorMatchExpression.ValidateEmptyText = true; _customValidatorMatchExpression.ValidationGroup = VALIDATION_GROUP; // Bind the list of properties to the control. _ddlProperties.DataBind(); _ddlProperties.Items.Add(new ListItem( FiftyOne.Foundation.Mobile.Redirection.Constants.OriginalUrlSpecialProperty, FiftyOne.Foundation.Mobile.Redirection.Constants.OriginalUrlSpecialProperty)); _ddlProperties.SelectedValue = FiftyOne.Foundation.Mobile.Redirection.Constants.OriginalUrlSpecialProperty; SetValuesDataSource(properties); _textBoxExpression.Text = _data.MatchExpression; _checkBoxEnabled.Checked = _data.Enabled; }