Пример #1
0
 public PublicFolderPermissionLevelComboBoxAdapter(ExchangeComboBox comboBox)
 {
     this.comboBox               = comboBox;
     this.comboBox.DataSource    = new PublicFolderPermissionLevelListSource();
     this.comboBox.DisplayMember = "Text";
     this.comboBox.ValueMember   = "Value";
     this.comboBox.DropDownStyle = ComboBoxStyle.DropDownList;
     this.comboBox.Painted      += this.DrawAppearance;
     this.comboBox.FocusSetted  += this.DrawAppearance;
     this.comboBox.FocusKilled  += this.DrawAppearance;
 }
Пример #2
0
        private void DrawBulkEditorLockedState(Icon icon)
        {
            ExchangeComboBox exchangeComboBox = base.HostControl as ExchangeComboBox;

            using (Graphics graphics = exchangeComboBox.CreateGraphics())
            {
                Rectangle rectangle = new Rectangle(exchangeComboBox.ClientRectangle.Right - 8, exchangeComboBox.ClientRectangle.Top, 8, 8);
                Color     color     = exchangeComboBox.Enabled ? exchangeComboBox.BackColor : SystemColors.Control;
                using (new SolidBrush(color))
                {
                    graphics.DrawIcon(icon, LayoutHelper.MirrorRectangle(rectangle, base.HostControl));
                }
            }
            exchangeComboBox.Enabled = false;
        }
Пример #3
0
        private Control GetComboBoxEditor(FilterablePropertyDescription filterableProperty)
        {
            ExchangeComboBox exchangeComboBox;

            if (!this.valueTypeEditors.ContainsKey(FilterablePropertyValueEditor.ComboBox))
            {
                exchangeComboBox               = new ExchangeComboBox();
                exchangeComboBox.Name          = "comboBoxValue";
                exchangeComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
                exchangeComboBox.FlatStyle     = FlatStyle.System;
                exchangeComboBox.Dock          = DockStyle.Fill;
                exchangeComboBox.TabIndex      = 2;
                this.valueTypeEditors.Add(FilterablePropertyValueEditor.ComboBox, exchangeComboBox);
            }
            else
            {
                exchangeComboBox = (this.valueTypeEditors[FilterablePropertyValueEditor.ComboBox] as ExchangeComboBox);
                exchangeComboBox.DataBindings.Clear();
            }
            ObjectListSource filterableListSource = filterableProperty.FilterableListSource;

            exchangeComboBox.DataSource    = new ArrayList(filterableListSource.GetList());
            exchangeComboBox.DisplayMember = "Text";
            exchangeComboBox.ValueMember   = "Value";
            Binding binding   = new Binding("SelectedValue", this.BindingSource, "Value", true, DataSourceUpdateMode.OnPropertyChanged);
            Type    valueType = filterableProperty.ValueType;

            if (typeof(Enum).IsAssignableFrom(valueType))
            {
                binding.Format += delegate(object sender, ConvertEventArgs e)
                {
                    if (e.Value != null && e.Value.GetType() != valueType)
                    {
                        e.Value = Enum.Parse(valueType, e.Value.ToString());
                    }
                };
            }
            exchangeComboBox.DataBindings.Add(binding);
            return(exchangeComboBox);
        }
Пример #4
0
 public ComboBoxBulkEditorAdapter(ExchangeComboBox comboBox) : base(comboBox)
 {
     comboBox.Painted     += this.OnAppearancePainted;
     comboBox.FocusSetted += this.OnAppearancePainted;
     comboBox.FocusKilled += this.OnAppearancePainted;
 }