private void RegisterBindableControl(BindableUserControl control) { if (!this.bindableUnpagedControlList.Contains(control)) { this.bindableUnpagedControlList.Add(control); this.InputValidationProvider.SetEnabled(control.BindingSource, true); this.inputValidationProvider.SetUIValidationEnabled(control, true); } }
public static ExchangePropertyPageControl WrapUserControlAsPage(BindableUserControl control) { ExchangePropertyPageControl exchangePropertyPageControl = new ExchangePropertyPageControl(); exchangePropertyPageControl.SuspendLayout(); control.Dock = DockStyle.Fill; exchangePropertyPageControl.Padding = new Padding(13, 12, 0, 12); exchangePropertyPageControl.Controls.Add(control); exchangePropertyPageControl.Text = control.Text; exchangePropertyPageControl.AutoSize = true; exchangePropertyPageControl.AutoSizeMode = AutoSizeMode.GrowAndShrink; exchangePropertyPageControl.AutoScaleDimensions = ExchangeUserControl.DefaultAutoScaleDimension; exchangePropertyPageControl.AutoScaleMode = AutoScaleMode.Font; exchangePropertyPageControl.ResumeLayout(false); exchangePropertyPageControl.PerformLayout(); exchangePropertyPageControl.HelpTopic = control.GetType().FullName; return(exchangePropertyPageControl); }
public DialogResult ShowDialog(BindableUserControl control) { return(this.ShowDialog(ExchangeUserControl.WrapUserControlAsDialog(control))); }
public static PropertyPageDialog WrapUserControlAsDialog(BindableUserControl control) { return(ExchangeUserControl.WrapPageAsDialog(ExchangeUserControl.WrapUserControlAsPage(control))); }
private void DealWithErrorForBindableUserControl(List <ValidationError> unhandledErrors, BindableUserControl control) { if (!control.Visible || !control.Enabled || !string.IsNullOrEmpty(this.GetErrorMessage(control))) { return; } foreach (ValidationError validationError in control.Validator.Validate()) { StrongTypeValidationError strongTypeValidationError = validationError as StrongTypeValidationError; if (strongTypeValidationError != null && (string.IsNullOrEmpty(strongTypeValidationError.PropertyName) || !this.InputValidationProvider.UpdateErrorProviderTextForProperty(strongTypeValidationError.Description, strongTypeValidationError.PropertyName))) { unhandledErrors.Add(validationError); } } }