예제 #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);
                }
            }
        }
예제 #2
0
        private void RemoveSettingsProvider(WorkItem workItem, FrameworkElement frameworkElement)
        {
            Type providerType = FrameworkElementStrategySettings.GetSettingsProviderType(frameworkElement);

            if (providerType != null)
            {
                if (!string.IsNullOrEmpty(frameworkElement.Name))
                {
                    IUXSettingsService settingsService = workItem.Services.Get <IUXSettingsService>();

                    settingsService.RemoveProvider(frameworkElement);
                }
            }
        }
예제 #3
0
        private void AddSettingsProvider(WorkItem workItem, FrameworkElement frameworkElement)
        {
            Type providerType = FrameworkElementStrategySettings.GetSettingsProviderType(frameworkElement);

            if (providerType != null)
            {
                if (!string.IsNullOrEmpty(frameworkElement.Name))
                {
                    IUXSettingsService settingsService = workItem.Services.Get <IUXSettingsService>();

                    ISettingsProvider provider = Activator.CreateInstance(providerType) as ISettingsProvider;

                    settingsService.AddProvider(frameworkElement, provider);
                }
            }
        }
예제 #4
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);
            }
        }