public FeatureLauncherPropertyControl()
 {
     this.InitializeComponent();
     this.iconLibrary = new IconLibrary();
     this.iconLibrary.Icons.Add(Strings.PropertiesButtonText, Icons.Properties);
     this.iconLibrary.Icons.Add(Strings.EnableButtonText, Icons.Enable);
     this.iconLibrary.Icons.Add(Strings.DisableButtonText, Icons.Disable);
     this.featureListView.IconLibrary      = this.iconLibrary;
     this.enableButton.Text                = Strings.EnableButtonText;
     this.enableButton.ToolTipText         = ExchangeUserControl.RemoveAccelerator(Strings.EnableButtonText);
     this.disableButton.Text               = Strings.DisableButtonText;
     this.disableButton.ToolTipText        = ExchangeUserControl.RemoveAccelerator(Strings.DisableButtonText);
     this.propertiesButton.Text            = Strings.PropertiesButtonText;
     this.propertiesButton.ToolTipText     = ExchangeUserControl.RemoveAccelerator(Strings.PropertiesButtonText);
     this.itemDescriptionDividerLabel.Text = Strings.DescriptionLabelText;
     this.featureColumnHeader.Text         = Strings.FeatureColumnText;
     this.featureColumnHeader.Default      = true;
     this.statusColumnHeader.Text          = Strings.StatusColumnText;
     this.statusColumnHeader.Default       = true;
     this.itemDescriptionLabel.Text        = Strings.DefaultItemDescriptionText;
     this.InfoLabelText = string.Empty;
     this.buttonsToolStrip.ImageList         = this.iconLibrary.SmallImageList;
     this.propertiesButton.ImageKey          = Strings.PropertiesButtonText;
     this.propertiesButton.TextImageRelation = TextImageRelation.ImageBeforeText;
     this.enableButton.ImageKey           = Strings.EnableButtonText;
     this.enableButton.TextImageRelation  = TextImageRelation.ImageBeforeText;
     this.disableButton.ImageKey          = Strings.DisableButtonText;
     this.disableButton.TextImageRelation = TextImageRelation.ImageBeforeText;
 }
Ejemplo n.º 2
0
        protected override void InnerSetState(string propertyName, BulkEditorState state)
        {
            base.InnerSetState(propertyName, state);
            ExchangeUserControl exchangeUserControl = base.HostControl as ExchangeUserControl;

            foreach (BulkEditorAdapter bulkEditorAdapter in UserControlBulkEditorAdapter.GetBulkEditorAdapters(exchangeUserControl.ExposedPropertyRelatedControls[propertyName]))
            {
                bulkEditorAdapter.SetPropertiesState(state);
                bulkEditorAdapter.StateChanged += new BulkEditorAdapter.BulkEditorStateChangedEventHandler(this.BulkEditorAdapter_StateChanged);
            }
        }
Ejemplo n.º 3
0
        protected override IList <string> InnerGetManagedProperties()
        {
            IList <string>      list = base.InnerGetManagedProperties();
            ExchangeUserControl exchangeUserControl = base.HostControl as ExchangeUserControl;

            foreach (string item in exchangeUserControl.ExposedPropertyRelatedControls.Keys)
            {
                list.Add(item);
            }
            return(list);
        }
Ejemplo n.º 4
0
        private void BulkEditorAdapter_StateChanged(BulkEditorAdapter sender, BulkEditorStateEventArgs e)
        {
            ExchangeUserControl exchangeUserControl = base.HostControl as ExchangeUserControl;

            foreach (KeyValuePair <string, HashSet <Control> > keyValuePair in exchangeUserControl.ExposedPropertyRelatedControls)
            {
                if (exchangeUserControl.ExposedPropertyRelatedControls[keyValuePair.Key].Contains(sender.HostControl))
                {
                    base[keyValuePair.Key] = sender[e.PropertyName];
                }
            }
        }
Ejemplo n.º 5
0
 protected override void OnStateChanged(BulkEditorAdapter sender, BulkEditorStateEventArgs e)
 {
     base.OnStateChanged(sender, e);
     if (base[e.PropertyName] == 2 || base[e.PropertyName] == 3)
     {
         ExchangeUserControl exchangeUserControl = base.HostControl as ExchangeUserControl;
         foreach (Control control in exchangeUserControl.ExposedPropertyRelatedControls[e.PropertyName])
         {
             control.Enabled = false;
         }
     }
 }
        private void Bindings_CollectionChanged(object sender, CollectionChangeEventArgs e)
        {
            if (CollectionChangeAction.Refresh != e.Action)
            {
                Binding binding = (Binding)e.Element;
                if (binding.BindableComponent != null)
                {
                    PropertyDescriptor propertyDescriptor = TypeDescriptor.GetProperties(binding.BindableComponent)[binding.PropertyName];
                    EventHandler       handler            = new EventHandler(this.RaiseDataBoundPropertyChanged);
                    switch (e.Action)
                    {
                    case CollectionChangeAction.Add:
                        binding.FormattingEnabled = true;
                        propertyDescriptor.AddValueChanged(binding.BindableComponent, handler);
                        this.AddRemoveEnabledChangedHandler(binding, true);
                        if (binding.Control is ExchangeUserControl)
                        {
                            this.SetUIValidationEnabled(binding.Control as ExchangeUserControl, true);
                            return;
                        }
                        break;

                    case CollectionChangeAction.Remove:
                    {
                        propertyDescriptor.RemoveValueChanged(binding.BindableComponent, handler);
                        this.AddRemoveEnabledChangedHandler(binding, false);
                        ExchangeUserControl exchangeUserControl = binding.Control as ExchangeUserControl;
                        if (exchangeUserControl != null && exchangeUserControl.DataBindings.Count == 1)
                        {
                            this.SetUIValidationEnabled(exchangeUserControl, false);
                        }
                        break;
                    }

                    default:
                        return;
                    }
                }
            }
        }
 public void SetUIValidationEnabled(ExchangeUserControl userControl, bool enabled)
 {
     if (enabled)
     {
         if (!this.validatingControls.ContainsKey(userControl))
         {
             ExchangeErrorProvider exchangeErrorProvider = new ExchangeErrorProvider(this.components);
             ((ISupportInitialize)exchangeErrorProvider).BeginInit();
             exchangeErrorProvider.BlinkStyle       = ErrorBlinkStyle.NeverBlink;
             exchangeErrorProvider.ContainerControl = this.ContainerControl;
             ((ISupportInitialize)exchangeErrorProvider).EndInit();
             this.validatingControls.Add(userControl, exchangeErrorProvider);
             userControl.ValidationErrorsChanging += this.UpdateUserControlUIErrorProvider;
             return;
         }
     }
     else if (this.validatingControls.ContainsKey(userControl))
     {
         this.validatingControls.Remove(userControl);
         userControl.ValidationErrorsChanging -= this.UpdateUserControlUIErrorProvider;
     }
 }
        private void SetUserControlErrorProvider(object sender, ICollection <UIValidationError> errors)
        {
            ExchangeUserControl             exchangeUserControl = (ExchangeUserControl)sender;
            ICollection <UIValidationError> collection          = exchangeUserControl.ValidationErrors ?? ((ICollection <UIValidationError>)UIValidationError.None);

            foreach (UIValidationError uivalidationError in collection)
            {
                bool flag = true;
                foreach (UIValidationError uivalidationError2 in errors)
                {
                    if (uivalidationError.ErrorProviderAnchor == uivalidationError2.ErrorProviderAnchor)
                    {
                        this.validatingControls[exchangeUserControl].SetError(uivalidationError2.ErrorProviderAnchor, uivalidationError2.Description);
                        flag = false;
                        break;
                    }
                }
                if (flag)
                {
                    this.validatingControls[exchangeUserControl].SetError(uivalidationError.ErrorProviderAnchor, string.Empty);
                }
            }
            foreach (UIValidationError uivalidationError3 in errors)
            {
                bool flag2 = true;
                foreach (UIValidationError uivalidationError4 in collection)
                {
                    if (uivalidationError4.ErrorProviderAnchor == uivalidationError3.ErrorProviderAnchor)
                    {
                        flag2 = false;
                        break;
                    }
                }
                if (flag2)
                {
                    this.validatingControls[exchangeUserControl].SetError(uivalidationError3.ErrorProviderAnchor, uivalidationError3.Description);
                }
            }
        }
        protected override void OnSetActive(EventArgs e)
        {
            base.ElapsedTimeText = string.Empty;
            string text = base.ShortDescription.Trim();

            if (string.IsNullOrEmpty(text))
            {
                if (base.Wizard != null && base.Wizard.ParentForm is WizardForm)
                {
                    string action = ExchangeUserControl.RemoveAccelerator(base.NextButtonText);
                    text = Strings.WizardWillUseConfigurationBelow(action);
                }
                else
                {
                    text = base.DataHandler.InProgressDescription.Trim();
                }
                base.ShortDescription = text;
            }
            base.WorkUnitsPanel.TaskState = 0;
            this.scenario = this.GetPageScenario();
            if (base.CheckReadOnlyAndDisablePage())
            {
                base.CanGoForward           = false;
                this.allowTaskToRun         = false;
                base.CanCancel              = true;
                base.InformationDescription = string.Empty;
                base.Status = string.Empty;
                if (base.Context != null)
                {
                    base.ShortDescription = Strings.WizardCannotEditObject(base.DataHandler.ObjectReadOnlyReason);
                }
                base.WorkUnitsPanel.Visible = false;
            }
            else if (base.DataHandler != null && this.NeedToRunTask)
            {
                CollapsiblePanel.Animate = false;
                base.WorkUnitsPanel.SuspendLayout();
                base.DataHandler.WorkUnits.RaiseListChangedEvents = false;
                try
                {
                    base.DataHandler.UpdateWorkUnits();
                    WizardForm wizardForm = (WizardForm)base.FindForm();
                    if (wizardForm != null && wizardForm.Icon != null)
                    {
                        foreach (WorkUnit workUnit in base.WorkUnits)
                        {
                            if (workUnit.Icon == null)
                            {
                                workUnit.Icon = wizardForm.Icon;
                            }
                            workUnit.Status = WorkUnitStatus.NotStarted;
                        }
                    }
                }
                finally
                {
                    base.Status = base.DataHandler.WorkUnits.Description;
                    base.WorkUnitsPanel.ResumeLayout(false);
                    base.DataHandler.WorkUnits.RaiseListChangedEvents = true;
                    base.DataHandler.WorkUnits.ResetBindings();
                    CollapsiblePanel.Animate = true;
                }
            }
            base.OnSetActive(e);
            if ((this.RunTaskOnSetActive || this.scenario.RunTaskOnSetActive) && this.NeedToRunTask)
            {
                this.StartTheTask();
            }
        }
Ejemplo n.º 10
0
 public UserControlBulkEditorAdapter(ExchangeUserControl control) : base(control)
 {
 }
Ejemplo n.º 11
0
 public DialogResult ShowDialog(BindableUserControl control)
 {
     return(this.ShowDialog(ExchangeUserControl.WrapUserControlAsDialog(control)));
 }
Ejemplo n.º 12
0
 public static PropertyPageDialog WrapUserControlAsDialog(BindableUserControl control)
 {
     return(ExchangeUserControl.WrapPageAsDialog(ExchangeUserControl.WrapUserControlAsPage(control)));
 }
Ejemplo n.º 13
0
 public DialogResult ShowDialog(ExchangePropertyPageControl propertyPage)
 {
     return(this.ShowDialog(ExchangeUserControl.WrapPageAsDialog(propertyPage)));
 }
Ejemplo n.º 14
0
 private void InitializeComponent()
 {
     this.incompleteItems                = new ArrayList();
     this.items                          = new Panel();
     this.buttons                        = new TabbableToolStrip();
     this.createFilterButton             = new ToolStripButton(Strings.CreateFilter.ToString());
     this.createFilterButton.ToolTipText = ExchangeUserControl.RemoveAccelerator(Strings.CreateFilter);
     this.addNewFilterButton             = new ToolStripButton(Strings.AddFilter.ToString());
     this.addNewFilterButton.ToolTipText = ExchangeUserControl.RemoveAccelerator(Strings.AddFilter);
     this.removeFilterButton             = new ToolStripButton(Strings.RemoveFilter.ToString());
     this.removeFilterButton.ToolTipText = ExchangeUserControl.RemoveAccelerator(Strings.RemoveFilter);
     this.applyFilterButton              = new ToolStripButton(Strings.ApplyFilter.ToString());
     this.applyFilterButton.ToolTipText  = ExchangeUserControl.RemoveAccelerator(Strings.ApplyFilter);
     this.stopFilterButton               = new ToolStripButton(Strings.StopFilter.ToString());
     this.stopFilterButton.ToolTipText   = ExchangeUserControl.RemoveAccelerator(Strings.StopFilter);
     this.progressIndicator              = new ToolStripLabel();
     this.buttons.SuspendLayout();
     base.SuspendLayout();
     this.items.Name            = "filterItemsPanel";
     this.items.AutoScroll      = true;
     this.items.AutoSize        = true;
     this.items.AutoSizeMode    = AutoSizeMode.GrowAndShrink;
     this.items.ControlRemoved += this.FilterItemRemoved;
     this.items.Dock            = DockStyle.Top;
     this.items.Margin          = new Padding(0);
     this.items.TabIndex        = 0;
     this.items.TabStop         = true;
     this.buttons.Items.AddRange(new ToolStripItem[]
     {
         this.createFilterButton,
         this.addNewFilterButton,
         this.removeFilterButton,
         this.applyFilterButton,
         this.stopFilterButton,
         this.progressIndicator
     });
     this.buttons.GripStyle = ToolStripGripStyle.Hidden;
     this.buttons.Name      = "toolstripButtons";
     this.buttons.Dock      = DockStyle.Bottom;
     this.buttons.TabStop   = true;
     this.buttons.TabIndex  = 1;
     this.iconLibrary       = new IconLibrary();
     this.iconLibrary.Icons.Add("Create", Icons.CreateFilter);
     this.iconLibrary.Icons.Add("Add", Icons.Add);
     this.iconLibrary.Icons.Add("Remove", Icons.RemoveFilter);
     this.iconLibrary.Icons.Add("Move", Icons.Move);
     this.buttons.ImageList             = this.iconLibrary.SmallImageList;
     this.createFilterButton.ImageIndex = 0;
     this.createFilterButton.Name       = "createFilterButton";
     this.createFilterButton.Click     += this.createFilterButton_Click;
     this.addNewFilterButton.ImageIndex = 1;
     this.addNewFilterButton.Name       = "addNewFilterButton";
     this.addNewFilterButton.Click     += this.addNewFilter_Click;
     this.removeFilterButton.ImageIndex = 2;
     this.removeFilterButton.Name       = "removeFilterButton";
     this.removeFilterButton.Click     += this.removeFilterButton_Click;
     this.applyFilterButton.ImageIndex  = 3;
     this.applyFilterButton.Name        = "applyFilterButton";
     this.applyFilterButton.Click      += this.applyFilterButton_Click;
     this.applyFilterButton.Alignment   = ToolStripItemAlignment.Right;
     this.stopFilterButton.Name         = "stopFilterButton";
     this.stopFilterButton.Click       += this.stopFilterButton_Click;
     this.stopFilterButton.Alignment    = ToolStripItemAlignment.Right;
     this.progressIndicator.Name        = "progressIndicator";
     this.progressIndicator.Alignment   = ToolStripItemAlignment.Right;
     this.progressIndicator.Image       = Icons.Progress;
     base.Controls.Add(this.buttons);
     base.Controls.Add(this.items);
     this.AutoSize           = true;
     this.Dock               = DockStyle.Top;
     base.DockPadding.Top    = 2;
     base.DockPadding.Bottom = 6;
     this.TabStop            = true;
     this.buttons.ResumeLayout(false);
     this.buttons.PerformLayout();
     base.ResumeLayout(false);
     base.PerformLayout();
 }