List <XRControl> GetSelectedControls()
        {
            ISelectionService serv = panel.GetService(typeof(ISelectionService)) as ISelectionService;

            IEnumerable <XRControl> selectedComponents = panel.GetSelectedComponents()
                                                         .Where <object>(item => item is XRControl && !(item is Band) && !(item is XRCrossBandControl))
                                                         .Cast <XRControl>();

            List <XRControl> selectedControls = new List <XRControl>();

            if (selectedComponents.Count <XRControl>() == 0)
            {
                return(selectedControls);
            }

            XRControl primaryControl = serv.PrimarySelection as XRControl ?? selectedComponents.ElementAt <XRControl>(0);

            foreach (XRControl item in selectedComponents)
            {
                if (ReferenceEquals(item.Band, primaryControl.Band))
                {
                    selectedControls.Add(item as XRControl);
                }
            }
            return(selectedControls);
        }
        public void ShowSmartTag(XRDesignPanel panel, IComponent component)
        {
            XRDesignerHost    host     = panel.GetService(typeof(IDesignerHost)) as XRDesignerHost;
            XRControlDesigner designer = host.GetDesigner(component) as XRControlDesigner;

            if (designer == null)
            {
                return;
            }

            XRSmartTagService    tagSvc  = panel.GetService(typeof(XRSmartTagService)) as XRSmartTagService;
            IBandViewInfoService bandSvc = panel.GetService(typeof(IBandViewInfoService)) as IBandViewInfoService;
            RectangleF           bounds  = bandSvc.GetControlScreenBounds((XRControl)component);


            tagSvc.ShowPopup(new Point((int)bounds.Right, (int)bounds.Top - 15), designer, null);
        }
        public static void RedrawFieldListOnDesignPanel(this MessagingDesignForm form, XRDesignPanel designPanel)
        {
            if (form.ActiveDesignPanel == null) return;

            designPanel = designPanel ?? form.ActiveDesignPanel;

            // Update the Field List.
            var fieldList = (FieldListDockPanel)form.DesignDockManager[DesignDockPanelType.FieldList];
            var host = (IDesignerHost)designPanel.GetService(typeof(IDesignerHost));
            fieldList.UpdateDataSource(host);
        }
        void reportDesigner1_DesignPanelLoaded(object sender, DesignerLoadedEventArgs e)
        {
            reportDesigner1.DesignPanelLoaded -= reportDesigner1_DesignPanelLoaded;

            //Set initial selection in designer for demonstration purposes
            BeginInvoke(new MethodInvoker(() => {
                XRDesignPanel panel    = (XRDesignPanel)sender;
                XtraReport1 rep        = (XtraReport1)panel.Report;
                ISelectionService serv = panel.GetService(typeof(ISelectionService)) as ISelectionService;
                serv.SetSelectedComponents(new object[] { rep.xrRichText1, rep.xrRichText2 }, SelectionTypes.Auto);
            }));
        }
示例#5
0
        private void reportDesigner1_AnyDocumentActivated(object sender, DevExpress.XtraBars.Docking2010.Views.DocumentEventArgs e)
        {
            XRDesignPanel panel = this.reportDesigner1.ActiveDesignPanel;
            IDesignerHost host  = panel.GetService(typeof(IDesignerHost)) as IDesignerHost;

            if (e.Document.Caption.Equals("rptStokEnvanter"))
            {
                host.Container.Add(new StokEnvanterData());
            }
            if (e.Document.Caption.Equals("rptFaturaBarkodlu") || e.Document.Caption.Equals("rptSiparis") || e.Document.Caption.Equals("rptIrsaliye") || e.Document.Caption.Equals("rptTeklif") || e.Document.Caption.Equals("rptProformaFatura") || e.Document.Caption.Equals("rptBilgi"))
            {
                host.Container.Add(new DataSEtler());
            }
        }
        void ICommandHandler.HandleCommand(ReportCommand command, object[] args)
        {
            XRDesignPanel panel = mdiController.ActiveDesignPanel;

            XRSubreport subreport = (XRSubreport)args[0];

            if (subreport.ReportSource == null && String.IsNullOrEmpty(subreport.ReportSourceUrl))
            {
                subreport.ReportSource = CreateReport();
            }

            IWindowsService windowsSvc = panel.GetService(typeof(IWindowsService)) as IWindowsService;

            windowsSvc.EditSubreport(subreport);
            subreport.ReportSource = null;
        }
        private void DesignMdiController_DesignPanelLoaded(object sender, DevExpress.XtraReports.UserDesigner.DesignerLoadedEventArgs e)
        {
            XRDesignPanel panel = (XRDesignPanel)sender;

            if (panel == null)
            {
                return;
            }
            IDesignerHost host = panel.GetService(typeof(IDesignerHost)) as IDesignerHost;

            if (host == null)
            {
                return;
            }
            ITypeDescriptorFilterService serv = host.GetService(typeof(ITypeDescriptorFilterService)) as ITypeDescriptorFilterService;

            host.RemoveService(typeof(ITypeDescriptorFilterService));
            host.AddService(typeof(ITypeDescriptorFilterService), new TypeDescriptorFilterService(serv));
        }
 public static XRDesignMdiController GetDesignMdiController(this XRDesignPanel designPanel)
 {
     return(designPanel.GetService(typeof(XRDesignPanel).Assembly.GetType("DevExpress.XtraReports.UserDesigner.Native.INestedServiceProvider")) as XRDesignMdiController);
 }