public SystemOpController(IOrderProvider orderProvider, IProductProvider productProvider, IPowerCheckProvider powerCheckProvider, IInkProvider inkProvider, IPaperProvider paperProvider ) { _orderProvider = orderProvider; _productProvider = productProvider; _powerCheckProvider = powerCheckProvider; _inkProvider = inkProvider; _paperProvider = paperProvider; }
private void ProcessRemoveControl(ContainerControl control) { lock (InkProviderLock) { if (inkProviders.ContainsKey(control)) { IInkProvider inkProvider = inkProviders[control]; inkProviders.Remove(control); if (inkProvider is IDisposable) { ((IDisposable)inkProvider).Dispose(); } } } }
private void ProcessAddControl(ContainerControl control) { // do not try to create an ink provider for these derived container control types if (control is PropertyGrid || control is SplitContainer || control is ToolStripContainer || control is ToolStripPanel || control is UpDownBase) { return; } if (Infragistics.Win.InkProviderManager.GetInkProvider(control) == null) { lock (InkProviderLock) { if (inkProviders.ContainsKey(control) == false) { IInkProvider inkProvider = CreateInkProvider(); if (null != inkProvider) { inkProviders.Add(control, inkProvider); // associate it with the container control - this will in turn // register the container control with the ink provider TypeDescriptor.GetProperties(inkProvider)["ContainingControl"].SetValue(inkProvider, control); // if the system doesn't support ink recognition // then default to showing the keyboard instead of // the ink collector panel if (IsInkRecognitionAvailable == false) { TypeDescriptor.GetProperties(inkProvider)["InputMode"].SetValue(inkProvider, 1); } } } } } }
static InkProviderStrategy() { #region InkAssemblyName string InkAssemblyNamev1 = "Infragistics2.Win.UltraWinInkProvider.v" + Infragistics.Shared.AssemblyVersion.MajorMinor + ", Version=" + Infragistics.Shared.AssemblyVersion.Version + ", Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"; string InkAssemblyNamev17 = "Infragistics2.Win.UltraWinInkProvider.Ink17.v" + Infragistics.Shared.AssemblyVersion.MajorMinor + ", Version=" + Infragistics.Shared.AssemblyVersion.Version + ", Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"; if (LoadInkAssembly(InkAssemblyNamev17)) { InkAssemblyName = InkAssemblyNamev17; } else if (LoadInkAssembly(InkAssemblyNamev1)) { InkAssemblyName = InkAssemblyNamev1; } else { InkAssemblyName = null; } #endregion //InkAssemblyName #region IsInkRecognitionAvailable // There were some alternative approaches to check // if ink recognition is available but its better // just to create an ink provider and check with it. // // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tpcsdk10/lonestar/managed_ovw/tbconapisamptpcinfo.asp // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tpcsdk10/lonestar/gettingstarted/tbconfreqaskedquestions.asp if (null != InkAssemblyName) { IInkProvider inkProvider = CreateInkProvider(); try { PropertyDescriptor propDescriptor = TypeDescriptor.GetProperties(inkProvider)["IsInkRecognitionAvailable"]; isInkRecognitionAvailable = (bool)propDescriptor.GetValue(inkProvider); } finally { if (inkProvider is IDisposable) { ((IDisposable)inkProvider).Dispose(); } } } else { isInkRecognitionAvailable = false; } #endregion //IsInkRecognitionAvailable }