Exemple #1
0
        public void DesignerActionItemCollection_CopyTo_Invoke_Success()
        {
            var collection = new DesignerActionItemCollection();
            var value      = new SubDesignerActionItem("displayName", "category", "description");

            collection.Add(value);

            var array = new DesignerActionItem[3];

            collection.CopyTo(array, 1);
            Assert.Equal(new DesignerActionItem[] { null, value, null }, array);
        }
            private void OnCollapsedActionClick(object sender, EventArgs e)
            {
                DesignerActionItem verb = sender as DesignerActionItem;

                if (verb != null)
                {
                    bool collapsed = verb.DisplayName.Equals("Collapse");
                    this.actionName = collapsed?"Uncollapse":"Collapse";
                    PropertyDescriptor descriptor = TypeDescriptor.GetProperties(this.ownerComponent)["Collapsed"];
                    if ((descriptor != null) && (((bool)descriptor.GetValue(this.ownerComponent)) != collapsed))
                    {
                        descriptor.SetValue(this.ownerComponent, collapsed);
                    }
                    DesignerActionUIService service = (DesignerActionUIService)this.owner.GetService(typeof(DesignerActionUIService));
                    if (service != null)
                    {
                        service.Refresh(this.ownerComponent);
                    }
                }
            }
            private void OnOrientationActionClick(object sender, EventArgs e)
            {
                DesignerActionItem verb = sender as DesignerActionItem;

                if (verb != null)
                {
                    Orientation orientation = verb.DisplayName.Equals("Horizontal")?Orientation.Horizontal:Orientation.Vertical;
                    this.actionName = orientation == Orientation.Horizontal?"Vertical":"Horizontal";
                    PropertyDescriptor descriptor = TypeDescriptor.GetProperties(this.ownerComponent)["Orientation"];
                    if ((descriptor != null) && (((Orientation)descriptor.GetValue(this.ownerComponent)) != orientation))
                    {
                        descriptor.SetValue(this.ownerComponent, orientation);
                    }
                    DesignerActionUIService service = (DesignerActionUIService)this.owner.GetService(typeof(DesignerActionUIService));
                    if (service != null)
                    {
                        service.Refresh(this.ownerComponent);
                    }
                }
            }
 // Methods
 public int Add(DesignerActionItem value)
 {
 }
 public void Remove(DesignerActionItem value)
 {
 }
 public void Insert(int index, DesignerActionItem value)
 {
 }
 public int IndexOf(DesignerActionItem value)
 {
 }
 public bool Contains(DesignerActionItem value)
 {
 }
	public void CopyTo(DesignerActionItem[] array, int index) {}
	public bool Contains(DesignerActionItem value) {}
	// Methods
	public int Add(DesignerActionItem value) {}
	public void Remove(DesignerActionItem value) {}
	public void Insert(int index, DesignerActionItem value) {}
	public int IndexOf(DesignerActionItem value) {}