Esempio n. 1
0
 public PropertyGridTraverserState(PropertyGridGroupItem group, PropertyGridItemBase item, int index, int groupIndex)
 {
     this.group      = group;
     this.item       = item;
     this.index      = index;
     this.groupIndex = groupIndex;
 }
        protected override void OnDropDownOpening(CancelEventArgs args)
        {
            PropertyGridItemBase item = this.propertyGridElement.SelectedGridItem;

            if (item != null)
            {
                if (item is PropertyGridGroupItem)
                {
                    EditMenuItem.Visibility  = ElementVisibility.Collapsed;
                    ResetMenuItem.Visibility = ElementVisibility.Collapsed;
                }
                else
                {
                    EditMenuItem.Visibility  = ElementVisibility.Visible;
                    ResetMenuItem.Visibility = ElementVisibility.Visible;
                    ResetMenuItem.Enabled    = ((PropertyGridItem)item).IsModified;
                }
            }

            showDescriptionMenuItem.IsChecked = propertyGridElement.PropertyGridElement.SplitElement.HelpVisible;
            showToolbarMenuItem.IsChecked     = propertyGridElement.PropertyGridElement.ToolbarVisible;

            noSortMenuItem.IsChecked                  = propertyGridElement.PropertySort == System.Windows.Forms.PropertySort.NoSort;
            alphabeticalMenuItem.IsChecked            = propertyGridElement.PropertySort == System.Windows.Forms.PropertySort.Alphabetical;
            categorizedMenuItem.IsChecked             = propertyGridElement.PropertySort == System.Windows.Forms.PropertySort.Categorized;
            categorizedAlphabeticalMenuItem.IsChecked = propertyGridElement.PropertySort == System.Windows.Forms.PropertySort.CategorizedAlphabetical;

            base.OnDropDownOpening(args);

            if (args.Cancel)
            {
                return;
            }
        }
Esempio n. 3
0
        public virtual void Synchronize()
        {
            PropertyGridItemBase data = this.VisualItem.Data;

            this.IsExpanded = data.Expanded;
            this.IsSelected = data.Selected;
            if (data.Expandable)
            {
                this.expanderItem.Visibility = ElementVisibility.Visible;
            }
            else
            {
                this.expanderItem.Visibility = ElementVisibility.Hidden;
            }
            PropertyGridItemElement visualItem = this.VisualItem as PropertyGridItemElement;

            if (visualItem == null)
            {
                return;
            }
            bool flag = visualItem.IsInEditMode;

            if (flag && data.Level == 0 && data.GridItems.Count > 0)
            {
                flag = false;
            }
            int num = (int)this.SetValue(PropertyGridExpanderElement.IsInEditModeProperty, (object)flag);
        }
        private void ExpandNode()
        {
            PropertyGridItemBase item = this.propertyGridElement.SelectedGridItem;

            if (item != null)
            {
                item.Expanded = !item.Expanded;
            }
        }
Esempio n. 5
0
        private void ExpandItem()
        {
            PropertyGridItemBase selectedGridItem = this.propertyTableElement.SelectedGridItem;

            if (selectedGridItem == null)
            {
                return;
            }
            selectedGridItem.Expanded = !selectedGridItem.Expanded;
        }
Esempio n. 6
0
        public override bool IsCompatible(PropertyGridItemBase data, object context)
        {
            PropertyGridItem propertyGridItem = data as PropertyGridItem;

            if (propertyGridItem != null && (object)propertyGridItem.PropertyType != (object)typeof(bool) && ((object)propertyGridItem.PropertyType != (object)typeof(bool?) && (object)propertyGridItem.PropertyType != (object)typeof(Telerik.WinControls.Enumerations.ToggleState)))
            {
                return((object)propertyGridItem.PropertyType != (object)typeof(Color));
            }
            return(false);
        }
Esempio n. 7
0
        public override bool IsCompatible(PropertyGridItemBase data, object context)
        {
            PropertyGridItem propertyGridItem = data as PropertyGridItem;

            if (propertyGridItem != null)
            {
                return((object)propertyGridItem.PropertyType == (object)typeof(Color));
            }
            return(false);
        }
Esempio n. 8
0
 public virtual T GetElement <T>(PropertyGridItemBase item) where T : PropertyGridItemElementBase
 {
     foreach (PropertyGridItemElementBase child in this.Control.PropertyGridElement.PropertyTableElement.FindDescendant <VirtualizedStackContainer <PropertyGridItemBase> >().Children)
     {
         if (child is T && ((T)child).Data == item)
         {
             return((T)child);
         }
     }
     return(default(T));
 }
Esempio n. 9
0
        protected override void OnDropDownOpening(CancelEventArgs args)
        {
            if (ThemeResolutionService.ApplicationThemeName == null && this.ThemeName != this.propertyTableElement.ElementTree.ThemeName)
            {
                this.ThemeName = this.propertyTableElement.ElementTree.ThemeName;
            }
            PropertyGridItemBase selectedGridItem1 = this.propertyTableElement.SelectedGridItem;

            if (selectedGridItem1 != null)
            {
                if (selectedGridItem1 is PropertyGridGroupItem)
                {
                    this.EditMenuItem.Visibility  = ElementVisibility.Collapsed;
                    this.ResetMenuItem.Visibility = ElementVisibility.Collapsed;
                }
                else
                {
                    this.EditMenuItem.Visibility  = ElementVisibility.Visible;
                    this.ResetMenuItem.Visibility = ElementVisibility.Visible;
                    PropertyGridItem            selectedGridItem2 = this.propertyTableElement.SelectedGridItem as PropertyGridItem;
                    PropertyGridItemElementBase element           = this.propertyTableElement.GetElement((PropertyGridItemBase)selectedGridItem2);
                    this.ResetMenuItem.Enabled = ((PropertyGridItem)selectedGridItem1).IsModified;
                    if (element is PropertyGridCheckBoxItemElement || selectedGridItem2.ReadOnly || this.propertyTableElement.ReadOnly)
                    {
                        this.EditMenuItem.Enabled = false;
                    }
                    else
                    {
                        this.EditMenuItem.Enabled = true;
                    }
                }
            }
            this.showDescriptionMenuItem.IsChecked         = this.propertyTableElement.PropertyGridElement.SplitElement.HelpVisible;
            this.showToolbarMenuItem.IsChecked             = this.propertyTableElement.PropertyGridElement.ToolbarVisible;
            this.noSortMenuItem.IsChecked                  = this.propertyTableElement.PropertySort == PropertySort.NoSort;
            this.alphabeticalMenuItem.IsChecked            = this.propertyTableElement.PropertySort == PropertySort.Alphabetical;
            this.categorizedMenuItem.IsChecked             = this.propertyTableElement.PropertySort == PropertySort.Categorized;
            this.categorizedAlphabeticalMenuItem.IsChecked = this.propertyTableElement.PropertySort == PropertySort.CategorizedAlphabetical;
            bool rightToLeft = this.propertyTableElement.RightToLeft;

            this.EditMenuItem.RightToLeft                    = rightToLeft;
            this.ResetMenuItem.RightToLeft                   = rightToLeft;
            this.showDescriptionMenuItem.RightToLeft         = rightToLeft;
            this.showToolbarMenuItem.RightToLeft             = rightToLeft;
            this.expandCollapseMenuItem.RightToLeft          = rightToLeft;
            this.sortMenuItem.RightToLeft                    = rightToLeft;
            this.noSortMenuItem.RightToLeft                  = rightToLeft;
            this.alphabeticalMenuItem.RightToLeft            = rightToLeft;
            this.categorizedMenuItem.RightToLeft             = rightToLeft;
            this.categorizedAlphabeticalMenuItem.RightToLeft = rightToLeft;
            this.SetSortItemsVisibility();
            base.OnDropDownOpening(args);
            int num = args.Cancel ? 1 : 0;
        }
Esempio n. 10
0
        bool IReadOnlyCollection <PropertyGridItemBase> .Contains(
            PropertyGridItemBase value)
        {
            PropertyGridGroupItem propertyGridGroupItem = value as PropertyGridGroupItem;

            if (propertyGridGroupItem == null)
            {
                return(false);
            }
            return(this.IndexOf((Group <PropertyGridItem>)propertyGridGroupItem.Group) >= 0);
        }
Esempio n. 11
0
        int IReadOnlyCollection <PropertyGridItemBase> .IndexOf(
            PropertyGridItemBase value)
        {
            PropertyGridGroupItem propertyGridGroupItem = value as PropertyGridGroupItem;

            if (propertyGridGroupItem == null)
            {
                return(-1);
            }
            return(this.IndexOf((Group <PropertyGridItem>)propertyGridGroupItem.Group));
        }
Esempio n. 12
0
        /// <summary>
        /// Attaches a logical item to this visual element.
        /// </summary>
        /// <param name="data">The logical item.</param>
        /// <param name="context">The context.</param>
        public override void Attach(PropertyGridItemBase data, object context)
        {
            PropertyGridItem dataItem = data as PropertyGridItem;

            if (dataItem != null)
            {
                this.item = dataItem;
                this.item.PropertyChanged += new PropertyChangedEventHandler(item_PropertyChanged);
                this.Synchronize();
            }
        }
Esempio n. 13
0
        public override void Attach(PropertyGridItemBase data, object context)
        {
            PropertyGridItem propertyGridItem = data as PropertyGridItem;

            if (propertyGridItem == null)
            {
                return;
            }
            this.item = propertyGridItem;
            this.item.PropertyChanged += new PropertyChangedEventHandler(((PropertyGridItemElementBase)this).item_PropertyChanged);
            this.Synchronize();
        }
Esempio n. 14
0
        public override void Select(AccessibleSelection flags)
        {
            PropertyGridItemBase propertyGridItemBase = !(this.parent is PropertyGridGroupAccessibleObject) ? (PropertyGridItemBase)((PropertyGridItemAccessibleObject)this.parent).Item : (PropertyGridItemBase)((PropertyGridGroupAccessibleObject)this.parent).Group;

            switch (flags)
            {
            case AccessibleSelection.TakeFocus:
            case AccessibleSelection.TakeSelection:
            case AccessibleSelection.ExtendSelection:
            case AccessibleSelection.AddSelection:
                this.parent.Control.SelectedGridItem = propertyGridItemBase;
                break;
            }
            base.Select(flags);
        }
Esempio n. 15
0
        public override AccessibleObject GetChild(int index)
        {
            PropertyGridTraverser propertyGridTraverser = new PropertyGridTraverser(this.control.PropertyGridElement.PropertyTableElement);
            int num = 0;

            do
            {
                ;
            }while (propertyGridTraverser.MoveNext() && num++ < index);
            PropertyGridItemBase current = propertyGridTraverser.Current;

            if (current is PropertyGridGroupItem)
            {
                return((AccessibleObject) new PropertyGridGroupAccessibleObject((PropertyGridGroupItem)current, this));
            }
            return((AccessibleObject) new PropertyGridItemAccessibleObject((PropertyGridItem)current, this));
        }
Esempio n. 16
0
 public PropertyValidatingEventArgs(PropertyGridItemBase item, object newValue, object oldValue)
     : base(item, newValue, oldValue)
 {
 }
 public CreatePropertyGridItemElementEventArgs(PropertyGridItemBase item)
 {
     this.item = item;
 }
 public RadPropertyGridCancelEventArgs(PropertyGridItemBase item)
     : base()
 {
     this.item = item;
 }
Esempio n. 19
0
 public PropertyGridMouseEventArgs(PropertyGridItemBase item, MouseEventArgs originalArgs)
     : base(item)
 {
     this.originalEventArgs = originalArgs;
 }
Esempio n. 20
0
 public PropertyGridMouseEventArgs(PropertyGridItemBase item)
     : base(item)
 {
 }
Esempio n. 21
0
 public PropertyGridEditorRequiredEventArgs(PropertyGridItemBase item, Type editorType)
     : base(editorType)
 {
     this.item = item;
 }
 public PropertyValidatedEventArgs(PropertyGridItemBase item)
     : base(item)
 {
 }
Esempio n. 23
0
 public RadPropertyGridEventArgs(PropertyGridItemBase item)
 {
     this.item = item;
 }
Esempio n. 24
0
 public RadPropertyGridCancelEventArgs(PropertyGridItemBase item, bool cancel)
     : base(cancel)
 {
     this.item = item;
 }
Esempio n. 25
0
 /// <summary>
 /// Determines if a logical item is compatible with this visual element.
 /// </summary>
 /// <param name="data">The logical item to be checked for compatibility.</param>
 /// <param name="context">The context.</param>
 /// <returns></returns>
 public override bool IsCompatible(PropertyGridItemBase data, object context)
 {
     return(data is PropertyGridItem);
 }
Esempio n. 26
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PropertyGridTraversingEventArgs"/> class.
 /// </summary>
 /// <param name="item">The content.</param>
 public PropertyGridTraversingEventArgs(PropertyGridItemBase item)
 {
     this.item    = item;
     this.process = item != null ? item.Visible : true;
 }