Exemplo n.º 1
0
        public void UpdateXLocationPropertyGridHost(bool isRight)
        {
            //To update the selected controls while using the arrow keys to move the selected controls
            ISelectionService selectionService = (ISelectionService)(ActiveDesignSurface.GetService(typeof(ISelectionService)));
            ICollection       iControls        = selectionService.GetSelectedComponents();
            Array             arr = Array.CreateInstance(typeof(object), iControls.Count);

            iControls.CopyTo(arr, 0);//copying the iControls into the arrary
            for (int i = iControls.Count - 1; i >= 0; i--)
            {
                this.PropertyGridHost.SelectedObject = arr.GetValue(i);
                this.PropertyGridHost.UpdateXValue(isRight);
            }
            selectionService.SetSelectedComponents(iControls);
        }
Exemplo n.º 2
0
        void PropertyGridHost_invokeUpdate()
        {
            IDesignerHost host = (IDesignerHost)ActiveDesignSurface.GetService(typeof(IDesignerHost));

            if (null == host)
            {
                return;
            }
            if (null == host.RootComponent)
            {
                return;
            }
            ISelectionService selectionService = (ISelectionService)(ActiveDesignSurface.GetService(typeof(ISelectionService)));
            object            oldSelectedObj   = PropertyGridHost.SelectedObject;;
            //SelectedObject = host.RootComponent;
            //SelectedObject = oldSelectedObj ;
            List <object> li = new List <object>();

            li.Add(host.RootComponent);
            //li.Add(oldSelectedObj);
            ICollection i1 = li;

            selectionService.SetSelectedComponents(i1);
            if (null != selectionService)
            {
                ICollection i = selectionService.GetSelectedComponents();
                selectionService.SetSelectedComponents(i);
            }
            li = new List <object>();
            li.Add(oldSelectedObj);
            i1 = li;
            selectionService.SetSelectedComponents(i1);
            if (null != selectionService)
            {
                ICollection i = selectionService.GetSelectedComponents();
                selectionService.SetSelectedComponents(i);
            }
            UpdateValueChanged();
            updateStatusBar(this.PropertyGridHost.reportCtrlProp.reportControlProperty);
        }
Exemplo n.º 3
0
        public void UpdatePropertyGridHost(DesignSurfaceExt2 surface)
        {
            IDesignerHost host = (IDesignerHost)surface.GetService(typeof(IDesignerHost));

            if (null == host)
            {
                return;
            }
            if (null == host.RootComponent)
            {
                return;
            }
            //- sync the PropertyGridHost
            if (host.TransactionDescription == null)
            {
                return;
            }

            string[]          transactionArr   = host.TransactionDescription.Split(' ');
            ISelectionService selectionService = (ISelectionService)(ActiveDesignSurface.GetService(typeof(ISelectionService)));
            ICollection       i = selectionService.GetSelectedComponents();

            //if (transactionArr[0] == "Move" || transactionArr[0] == "Resize")
            if (transactionArr[0] != "Move" && transactionArr[0] != "Resize")
            {
                //if (transactionArr[0] == "Delete")
                //{
                //    this.PropertyGridHost.DeleteReportControlPropertyItem();
                //}
                this.PropertyGridHost.SelectedObject = host.RootComponent;
            }
            else
            {
                this.PropertyGridHost.SelectedObject = this.PropertyGridHost.SelectedObject;
                updateStatusBar(this.PropertyGridHost.reportCtrlProp.reportControlProperty);
            }
        }