コード例 #1
0
        protected void BuildGroup()
        {
            this.galleryItems.Owner = null;

            if (this.groups.Count == 0)
            {
                RadGalleryGroupItem groupItem = new RadGalleryGroupItem(string.Empty);
                groupItem.ShowCaption = false;

                groupItem.Items.AddRange(this.galleryItems);
                groupItem.Items.Owner = groupItem.ItemsLayoutPanel;
                this.GroupHolderStackLayout.Children.Add(groupItem);
                this.InvalidateAndUpdate(groupItem.ItemsLayoutPanel);
            }
            else
            {
                foreach (RadGalleryGroupItem groupItem in this.groups)
                {
                    groupItem.Items.Owner = groupItem.ItemsLayoutPanel;
                    this.GroupHolderStackLayout.Children.Add(groupItem);
                    this.InvalidateAndUpdate(groupItem.ItemsLayoutPanel);
                }
            }

            this.InvalidateAndUpdate(this.GroupHolderStackLayout);
        }
コード例 #2
0
 public InstanceItem(
     RadGalleryGroupItem instance,
     RadGalleryGroupFilter filter,
     RadGalleryElement owner)
 {
     this.instance = instance;
     this.filter   = filter;
     this.owner    = owner;
 }
コード例 #3
0
 public void End()
 {
     this.host           = (IDesignerHost)null;
     this.edSvc          = (IWindowsFormsEditorService)null;
     this.typeSvc        = (ITypeDiscoveryService)null;
     this.defaultGroup   = (RadGalleryGroupItem)null;
     this.defaultElement = (RadGalleryElement)null;
     this.originalValue  = (RadItemOwnerCollection)null;
     this.Reset();
 }
コード例 #4
0
 public void End()
 {
     this.host           = null;
     this.edSvc          = null;
     this.typeSvc        = null;
     this.defaultGroup   = null;
     this.defaultElement = null;
     this.originalValue  = null;
     this.Reset();
 }
コード例 #5
0
 public void Start(IWindowsFormsEditorService edSvc, ITypeDiscoveryService typeSvc, IDesignerHost host,
                   RadItemOwnerCollection collection, RadGalleryGroupItem group, RadGalleryElement owner)
 {
     this.host           = host;
     this.edSvc          = edSvc;
     this.typeSvc        = typeSvc;
     this.currentValue   = collection;
     this.originalValue  = collection;
     this.defaultGroup   = group;
     this.defaultElement = owner;
 }
コード例 #6
0
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (provider != null)
            {
                IWindowsFormsEditorService windowsFormsEditorService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
                ITypeDiscoveryService      typeDiscoveryService      = (ITypeDiscoveryService)provider.GetService(typeof(ITypeDiscoveryService));
                IDesignerHost           designerHost           = (IDesignerHost)provider.GetService(typeof(IDesignerHost));
                IComponentChangeService componentChangeService = (IComponentChangeService)provider.GetService(typeof(IComponentChangeService));
                ISelectionService       selectionService       = (ISelectionService)provider.GetService(typeof(ISelectionService));

                if (windowsFormsEditorService == null)
                {
                    return(value);
                }

                RadItemOwnerCollection collection1 = value as RadItemOwnerCollection;
                RadGalleryGroupItem    group       = context.Instance as RadGalleryGroupItem;
                RadGalleryElement      owner       = null;

                if (collection1 == null ||
                    group == null)
                {
                    return(value);
                }
                else
                {
                    if (group.Owner == null && selectionService != null && selectionService.PrimarySelection != null && selectionService.PrimarySelection is RadGalleryElement)
                    {
                        group.Owner = (RadGalleryElement)selectionService.PrimarySelection;
                    }
                    owner = group.Owner;
                    if (owner == null)
                    {
                        return(value);
                    }
                }
                if (this.groupedItemsUI == null)
                {
                    this.groupedItemsUI = new GroupedItemsEditorUI();
                }
                componentChangeService.OnComponentChanging(context.Instance, TypeDescriptor.GetProperties(context.Instance)["Items"]);
                this.groupedItemsUI.Start(windowsFormsEditorService, typeDiscoveryService, designerHost, collection1, group, owner);                 //(this, collection1, group, owner)

                if (windowsFormsEditorService.ShowDialog(this.groupedItemsUI) == DialogResult.OK)
                {
                    this.groupedItemsUI.End();
                    value = this.groupedItemsUI.Value;
                    componentChangeService.OnComponentChanged(context.Instance, TypeDescriptor.GetProperties(context.Instance)["Items"], null, null);
                    return(value);
                }
            }
            return(value);
        }
コード例 #7
0
 private static void RemoveItemsContainedInFilter(ArrayList items, RadItemOwnerCollection groupItems)
 {
     for (int num1 = 0; num1 < groupItems.Count; num1++)
     {
         RadGalleryGroupItem item1 = groupItems[num1] as RadGalleryGroupItem;
         int num2 = items.IndexOf(item1);
         if (num2 >= 0)
         {
             items.RemoveAt(num2);
             num1--;
         }
     }
 }
コード例 #8
0
 private static void RemoveItemsContainedInFilter(
     ArrayList items,
     RadItemOwnerCollection groupItems)
 {
     for (int index1 = 0; index1 < groupItems.Count; ++index1)
     {
         RadGalleryGroupItem groupItem = groupItems[index1] as RadGalleryGroupItem;
         int index2 = items.IndexOf((object)groupItem);
         if (index2 >= 0)
         {
             items.RemoveAt(index2);
             --index1;
         }
     }
 }
コード例 #9
0
 public override object EditValue(
     ITypeDescriptorContext context,
     System.IServiceProvider provider,
     object value)
 {
     if (provider != null)
     {
         IWindowsFormsEditorService service1 = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
         ITypeDiscoveryService      service2 = (ITypeDiscoveryService)provider.GetService(typeof(ITypeDiscoveryService));
         IDesignerHost           service3    = (IDesignerHost)provider.GetService(typeof(IDesignerHost));
         IComponentChangeService service4    = (IComponentChangeService)provider.GetService(typeof(IComponentChangeService));
         ISelectionService       service5    = (ISelectionService)provider.GetService(typeof(ISelectionService));
         if (service1 == null)
         {
             return(value);
         }
         RadItemOwnerCollection collection = value as RadItemOwnerCollection;
         RadGalleryGroupItem    instance   = context.Instance as RadGalleryGroupItem;
         if (collection == null || instance == null)
         {
             return(value);
         }
         if (instance.Owner == null && service5 != null && (service5.PrimarySelection != null && service5.PrimarySelection is RadGalleryElement))
         {
             instance.Owner = (RadGalleryElement)service5.PrimarySelection;
         }
         RadGalleryElement owner = instance.Owner;
         if (owner == null)
         {
             return(value);
         }
         if (this.groupedItemsUI == null)
         {
             this.groupedItemsUI = new GroupedItemsEditorUI();
         }
         service4.OnComponentChanging(context.Instance, (MemberDescriptor)TypeDescriptor.GetProperties(context.Instance)["Items"]);
         this.groupedItemsUI.Start(service1, service2, service3, collection, instance, owner);
         if (service1.ShowDialog((Form)this.groupedItemsUI) == DialogResult.OK)
         {
             this.groupedItemsUI.End();
             value = (object)this.groupedItemsUI.Value;
             service4.OnComponentChanged(context.Instance, (MemberDescriptor)TypeDescriptor.GetProperties(context.Instance)["Items"], (object)null, (object)null);
             return(value);
         }
     }
     return(value);
 }
コード例 #10
0
 private void MoveUpAction(object sender, EventArgs e)
 {
     int[] numArray = new int[this.AssignedItemsBox.SelectedItems.Count];
     for (int index1 = 0; index1 < this.AssignedItemsBox.SelectedItems.Count; ++index1)
     {
         RadGalleryGroupItem instance = ((FilteredItemsEditorUI.InstanceItem) this.AssignedItemsBox.SelectedItems[index1]).Instance;
         int index2 = this.defaultFilter.Items.IndexOf((RadItem)instance);
         numArray[index1] = index2 - 1;
         this.defaultFilter.Items.RemoveAt(index2);
         this.defaultFilter.Items.Insert(index2 - 1, (RadItem)instance);
     }
     this.AssignedItemsBox.BeginUpdate();
     this.PopulateAssignedItems();
     foreach (int index in numArray)
     {
         this.AssignedItemsBox.SetSelected(index, true);
     }
     this.AssignedItemsBox.EndUpdate();
     this.SetButtonsEnabledState();
 }
コード例 #11
0
        private void MoveUpAction(object sender, EventArgs e)
        {
            int[] numArray1 = new int[this.AssignedItemsBox.SelectedItems.Count];

            for (int num1 = 0; num1 < this.AssignedItemsBox.SelectedItems.Count; num1++)
            {
                RadGalleryGroupItem item1 = ((InstanceItem)this.AssignedItemsBox.SelectedItems[num1]).Instance;
                int num2 = this.defaultFilter.Items.IndexOf(item1);
                numArray1[num1] = num2 - 1;
                this.defaultFilter.Items.RemoveAt(num2);
                this.defaultFilter.Items.Insert(num2 - 1, item1);
            }

            this.AssignedItemsBox.BeginUpdate();
            this.PopulateAssignedItems();
            foreach (int num3 in numArray1)
            {
                this.AssignedItemsBox.SetSelected(num3, true);
            }
            this.AssignedItemsBox.EndUpdate();
            this.SetButtonsEnabledState();
        }