コード例 #1
0
        public Diagnostics(IWindowsMessageHook messageHook)
        {
            using (var dataSourceManager = new DataSourceManager(DataSourceManager.DefaultApplicationId, messageHook))
            {
                dataSourceManager.SelectSource();

                var dataSource = dataSourceManager.DataSource;
                dataSource.OpenSource();

                foreach (Capabilities capability in Enum.GetValues(typeof(Capabilities)))
                {
                    try
                    {
                        var result = Capability.GetBoolCapability(capability, dataSourceManager.ApplicationId, dataSource.SourceId);

                        Console.WriteLine("{0}: {1}", capability, result);
                    }
                    catch (TwainException e)
                    {
                        Console.WriteLine("{0}: {1} {2} {3}", capability, e.Message, e.ReturnCode, e.ConditionCode);
                    }
                }
            }
        }
コード例 #2
0
ファイル: Diagnostics.cs プロジェクト: WilliamCopland/YPILIS
        public Diagnostics(IWindowsMessageHook messageHook)
        {
            using (var dataSourceManager = new DataSourceManager(DataSourceManager.DefaultApplicationId, messageHook))
            {
                dataSourceManager.SelectSource();

                var dataSource = dataSourceManager.DataSource;
                dataSource.OpenSource();

                foreach (Capabilities capability in Enum.GetValues(typeof(Capabilities)))
                {
                    try
                    {
                        var result = Capability.GetBoolCapability(capability, dataSourceManager.ApplicationId, dataSource.SourceId);

                        Console.WriteLine("{0}: {1}", capability, result);
                    }
                    catch (TwainException e)
                    {
                        Console.WriteLine("{0}: {1} {2} {3}", capability, e.Message, e.ReturnCode, e.ConditionCode);
                    }
                }
            }
        }
コード例 #3
0
ファイル: Twain.cs プロジェクト: ericramses/YPILIS
 /// <summary>
 /// Shows a dialog prompting the use to select the source to scan from.
 /// </summary>
 public void SelectSource()
 {
     _dataSourceManager.SelectSource();
 }