예제 #1
0
        public ButtonSpecificationsEditor()
        {
            this.Content = new StackLayout
            {
                Spacing = 5,
                Items   =
                {
                    new StackLayoutItem
                    {
                        Control = enable = new CheckBox
                        {
                            Text = "Enable",
                        }
                    },
                    new Group
                    {
                        Text        = "Button Count",
                        Orientation = Orientation.Horizontal,
                        Content     = buttonCount = new UnsignedIntegerNumberBox()
                    }
                }
            };

            enable.CheckedBinding.Cast <bool>().Bind(
                SpecificationsBinding.Convert(
                    c => c != null,
                    v => v ? new ButtonSpecifications() : null
                    )
                );

            enable.CheckedBinding.Bind(buttonCount, b => b.Enabled);

            buttonCount.ValueBinding.Bind(SpecificationsBinding.Child(b => b.ButtonCount));
        }
예제 #2
0
        public ButtonSpecificationsEditor()
        {
            this.Content = new Group
            {
                Text        = "Button Count",
                Orientation = Orientation.Horizontal,
                Content     = buttonCount = new UnsignedIntegerNumberBox()
            };

            buttonCount.ValueBinding.Bind(ButtonSpecificationsBinding.Child(b => b.ButtonCount));
        }
예제 #3
0
        public PenSpecificationsEditor()
        {
            buttonSpecifications = new ButtonSpecificationsEditor();

            this.Content = new StackLayout
            {
                HorizontalContentAlignment = HorizontalAlignment.Stretch,
                Spacing = 5,
                Padding = 5,
                Items   =
                {
                    new StackLayoutItem
                    {
                        Control = enable = new CheckBox
                        {
                            Text = "Enable"
                        }
                    },
                    new Group
                    {
                        Text        = "Max Pressure",
                        Orientation = Orientation.Horizontal,
                        Content     = maxPressure = new UnsignedIntegerNumberBox()
                    },
                    new Group
                    {
                        Text        = "Active Report ID",
                        Orientation = Orientation.Horizontal,
                        Content     = activeReportId = new DetectionRangeBox()
                    },
                    buttonSpecifications
                }
            };

            enable.CheckedBinding.Cast <bool>().Bind(
                PenSpecificationsBinding.Convert(
                    c => c != null,
                    v => v ? new PenSpecifications() : null
                    )
                );
            enable.CheckedBinding.Bind(maxPressure, c => c.Enabled);
            enable.CheckedBinding.Bind(activeReportId, c => c.Enabled);
            enable.CheckedBinding.Bind(buttonSpecifications, c => c.Enabled);

            maxPressure.ValueBinding.Bind(PenSpecificationsBinding.Child(c => c.MaxPressure));
            activeReportId.ValueBinding.Bind(PenSpecificationsBinding.Child(c => c.ActiveReportID));
            buttonSpecifications.ButtonSpecificationsBinding.Bind(PenSpecificationsBinding.Child(c => c.Buttons));
        }
예제 #4
0
        public PenSpecificationsEditor()
        {
            this.Content = new StackLayout
            {
                HorizontalContentAlignment = HorizontalAlignment.Stretch,
                Spacing = 5,
                Padding = 5,
                Items   =
                {
                    new StackLayoutItem
                    {
                        Control = enable = new CheckBox
                        {
                            Text = "Enable"
                        }
                    },
                    new Group
                    {
                        Text        = "Max Pressure",
                        Orientation = Orientation.Horizontal,
                        Content     = maxPressure = new UnsignedIntegerNumberBox()
                    },
                    new Group
                    {
                        Text        = "Button Count",
                        Orientation = Orientation.Horizontal,
                        Content     = buttonCount = new UnsignedIntegerNumberBox()
                    }
                }
            };

            enable.CheckedBinding.Cast <bool>().Bind(
                SpecificationsBinding.Convert(
                    c => c != null,
                    v => v ? new PenSpecifications() : null
                    )
                );
            enable.CheckedBinding.Bind(maxPressure, c => c.Enabled);
            enable.CheckedBinding.Bind(buttonCount, c => c.Enabled);

            maxPressure.ValueBinding.Bind(SpecificationsBinding.Child(c => c.MaxPressure));
            buttonCount.ValueBinding.Bind(SpecificationsBinding.Child(c => c.Buttons.ButtonCount));
        }
            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));
            }