public override object EditValue(ITypeDescriptorContext context,
                                         IServiceProvider provider,
                                         object value)
        {
            if ((context == null) || (provider == null))
            {
                return(base.EditValue(context, provider, value));
            }

            // Access the Property Browser's UI display service
            IWindowsFormsEditorService editorService =
                (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));

            if (editorService == null)
            {
                return(base.EditValue(context, provider, value));
            }

            // Create an instance of the UI editor form
            PropertyReport pr = context.Instance as PropertyReport;

            if (pr == null)
            {
                return(base.EditValue(context, provider, value));
            }

            using (OpenFileDialog ofd = new OpenFileDialog())
            {
                ofd.Filter = "XSL Files (*.xsl)|*.xsl" +
                             "|All files (*.*)|*.*";
                ofd.FilterIndex     = 0;
                ofd.CheckFileExists = true;
                if (ofd.ShowDialog() == DialogResult.OK)
                {
                    // Return the new property value from the UI editor form
                    return(ofd.FileName);
                }

                return(base.EditValue(context, provider, value));
            }
        }
        public override object EditValue(ITypeDescriptorContext context,
                                         IServiceProvider provider,
                                         object value)
        {
            if ((context == null) || (provider == null))
            {
                return(base.EditValue(context, provider, value));
            }

            // Access the Property Browser's UI display service
            IWindowsFormsEditorService editorService =
                (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));

            if (editorService == null)
            {
                return(base.EditValue(context, provider, value));
            }

            // Create an instance of the UI editor form
            PropertyReport pr = context.Instance as PropertyReport;

            if (pr == null)
            {
                return(base.EditValue(context, provider, value));
            }

            using (SingleCtlDialog scd = new SingleCtlDialog(pr.DesignCtl, pr.Draw, null, SingleCtlTypeEnum.ReportModulesClassesCtl, null))
            {
                // Display the UI editor dialog
                if (editorService.ShowDialog(scd) == DialogResult.OK)
                {
                    // Return the new property value from the UI editor form
                    return(new PropertyReportModulesClasses(pr));
                }

                return(base.EditValue(context, provider, value));
            }
        }
예제 #3
0
 internal PropertyPrintFirstLast(PropertyReport pr, XmlNode phNode)
 {
     _pr     = pr;
     _parent = phNode;
 }
 internal PropertyReportCode(PropertyReport r)
 {
     pr = r;
 }
 internal PropertyReportModulesClasses(PropertyReport r)
 {
     pr = r;
 }
 internal PropertyMargin(PropertyReport pr)
 {
     _pr = pr;
 }
 internal PropertyReportParameters(PropertyReport r)
 {
     pr = r;
 }
 internal PropertyMargin(PropertyReport pr)
 {
     _pr = pr;
 }
 internal PropertyPrintFirstLast(PropertyReport pr, XmlNode phNode)
 {
     _pr = pr;
     _parent = phNode;
 }
 internal PropertyReportModulesClasses(PropertyReport r)
 {
     pr = r;
 }
 internal PropertyReportCode(PropertyReport r)
 {
     pr = r;
 }
 internal PropertyReportParameters(PropertyReport r)
 {
     pr = r;
 }