Exemplo n.º 1
0
        private void RemoveScanningControl(WorkItem workItem, FrameworkElement frameworkElement)
        {
            bool enableScanning = FrameworkElementStrategySettings.GetEnableScanning(frameworkElement);

            if (enableScanning)
            {
                if (workItem.Services.Contains(typeof(Services.TextControlScannerService)))
                {
                    workItem.Services.Get <Services.TextControlScannerService>().RemoveControl(frameworkElement);
                }
            }
        }
Exemplo n.º 2
0
        private void AddScanningControl(WorkItem workItem, FrameworkElement frameworkElement)
        {
            bool enableScanning = FrameworkElementStrategySettings.GetEnableScanning(frameworkElement);

            if (enableScanning)
            {
                string applicationIdentifier = FrameworkElementStrategySettings.GetApplicationIdentifier(frameworkElement);
                Key    completeScanKey       = FrameworkElementStrategySettings.GetCompleteScanKey(frameworkElement);

                if (!workItem.Services.Contains(typeof(Services.TextControlScannerService)))
                {
                    workItem.Services.Add <Services.TextControlScannerService>(new Services.TextControlScannerService());
                }

                workItem.Services.Get <Services.TextControlScannerService>().AddControl(frameworkElement, applicationIdentifier, completeScanKey);
            }
        }