Esempio n. 1
0
        private void newTemplate( )
        {
            ReportEditor re = new ReportEditor();

            //re.LoadReportFromApplication ( AReport.LoadTemplate ( this.Template.Instructions , this.Template.TemplateFile ) );
            re.ShowDialog( );

            //this.Template.Instructions = re.report.rawXML;
            (( App )Application.Current).ReportLibrary.addTemplatesToDB(re.report);

            //SaveChanges ( );

            updateTemplates();
        }
Esempio n. 2
0
        private void editTemplate()
        {
            ReportEditor re = new ReportEditor();

            re.LoadReportFromApplication(AReport.LoadTemplate(this.Template.Instructions, this.Template.TemplateFile));
            re.ShowDialog( );

            //this.Template.Instructions = re.report.rawXML;
            //ReportLibrary.addTemplatesToDB ( re.report );

            if (re.DialogResult == true)
            {
                this.Template.Instructions = re.report.rawXML;
                this.Template.TemplateFile = re.report.GetTemplate();
                Name = re.report.Name;
            }

            saveTemplate( );
        }
            public DeviceIdentifierEntry()
            {
                this.Content = layout = new StackLayout
                {
                    HorizontalContentAlignment = HorizontalAlignment.Stretch,
                    Padding = 5,
                    Spacing = 5,
                    Items   =
                    {
                        new Group
                        {
                            Text        = "Vendor ID",
                            Orientation = Orientation.Horizontal,
                            Content     = vendorId = new HexNumberBox()
                        },
                        new Group
                        {
                            Text        = "Product ID",
                            Orientation = Orientation.Horizontal,
                            Content     = productId = new HexNumberBox()
                        },
                        new Group
                        {
                            Text        = "Input Report Length",
                            Orientation = Orientation.Horizontal,
                            Content     = inputReportLength = new UnsignedIntegerNumberBox()
                        },
                        new Group
                        {
                            Text        = "Output Report Length",
                            Orientation = Orientation.Horizontal,
                            Content     = outputReportLength = new UnsignedIntegerNumberBox()
                        },
                        new Group
                        {
                            Text        = "Report Parser",
                            Orientation = Orientation.Horizontal,
                            Content     = reportParser = new TypeDropDown <IReportParser <IDeviceReport> >()
                        },
                        new Expander
                        {
                            Header  = "Feature Initialization Report",
                            Padding = 5,
                            Content = featureInitReport = new ReportEditor()
                        },
                        new Expander
                        {
                            Header  = "Output Initialization Report",
                            Padding = 5,
                            Content = outputInitReport = new ReportEditor()
                        },
                        new Expander
                        {
                            Header  = "Device Strings",
                            Padding = 5,
                            Content = deviceStrings = new DeviceStringEditor()
                        },
                        new Expander
                        {
                            Header  = "Initialization String Indexes",
                            Padding = 5,
                            Content = initializationStrings = new ByteListEditor()
                        }
                    }
                };

                vendorId.ValueBinding.Bind(EntryBinding.Child(e => e.VendorID));
                productId.ValueBinding.Bind(EntryBinding.Child(e => e.ProductID));

                inputReportLength.ValueBinding.Bind(
                    EntryBinding.Child(e => e.InputReportLength).Convert <uint>(
                        c => c ?? 0,
                        v => v
                        )
                    );

                outputReportLength.ValueBinding.Bind(
                    EntryBinding.Child(e => e.OutputReportLength).Convert <uint>(
                        c => c ?? 0,
                        v => v
                        )
                    );

                reportParser.SelectedKeyBinding.Bind(EntryBinding.Child(e => e.ReportParser));

                featureInitReport.ItemSourceBinding.Bind(EntryBinding.Child <IList <byte[]> >(e => e.FeatureInitReport));
                outputInitReport.ItemSourceBinding.Bind(EntryBinding.Child <IList <byte[]> >(e => e.OutputInitReport));
                deviceStrings.ItemSourceBinding.Bind(EntryBinding.Child <IDictionary <byte, string> >(e => e.DeviceStrings));
                initializationStrings.ItemSourceBinding.Bind(EntryBinding.Child <IList <byte> >(e => e.InitializationStrings));
            }