コード例 #1
0
 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);
     }
 }
コード例 #2
0
        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);
        }
コード例 #3
0
 public DialogResult ShowDialog(BindableUserControl control)
 {
     return(this.ShowDialog(ExchangeUserControl.WrapUserControlAsDialog(control)));
 }
コード例 #4
0
 public static PropertyPageDialog WrapUserControlAsDialog(BindableUserControl control)
 {
     return(ExchangeUserControl.WrapPageAsDialog(ExchangeUserControl.WrapUserControlAsPage(control)));
 }
コード例 #5
0
 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);
         }
     }
 }