Пример #1
0
        private IEnumerable <IDeviceOption> RequestOptionList(Action reloadFunction)
        {
            var p     = NativeMethods.SaneGetOptionDescriptor(_handle, 0);
            int count = p == IntPtr.Zero
                ? 0
                : p.ToInt32();

            for (int i = 1; i < count; i++)
            {
                var opt = ToOptionDescriptor(NativeMethods.SaneGetOptionDescriptor(_handle, i));

                var localOption = new LocalDeviceOption(opt.Name,
                                                        opt.Title,
                                                        opt.Description,
                                                        opt.Size,
                                                        i,
                                                        opt.Type,
                                                        opt.Unit,
                                                        opt.Capabilities,
                                                        _handle,
                                                        reloadFunction);
                yield return(localOption);
            }
        }
Пример #2
0
        private IEnumerable<IDeviceOption> RequestOptionList(Action reloadFunction)
        {
            var p = NativeMethods.SaneGetOptionDescriptor(_handle, 0);
            int count = p == IntPtr.Zero
                ? 0
                : p.ToInt32();

            for (int i = 1; i < count; i++)
            {
                var opt = ToOptionDescriptor(NativeMethods.SaneGetOptionDescriptor(_handle, i));

                var localOption = new LocalDeviceOption(opt.Name,
                                                        opt.Title,
                                                        opt.Description,
                                                        opt.Size,
                                                        i,
                                                        opt.Type,
                                                        opt.Unit,
                                                        opt.Capabilities,
                                                        _handle,
                                                        reloadFunction);
                yield return localOption;
            }
        }