public void Start() { string providerId = Settings.Default.CurrentProvider; Console.WriteLine("Input provider in settings - " + providerId); if (!string.IsNullOrEmpty(providerId) && InputProviders != null) { Export <IProvider, IAddInView> currentProvider = (from provider in InputProviders where provider.MetadataView.Id == providerId select provider).FirstOrDefault(); if (currentProvider == null) { throw new MultitouchException(string.Format("Input provider '{0}' could not be found", providerId)); } string text = "Found:" + Environment.NewLine + "Name: " + currentProvider.MetadataView.Id + Environment.NewLine + "Description: " + currentProvider.MetadataView.Description + Environment.NewLine + "Publisher: " + currentProvider.MetadataView.Publisher + Environment.NewLine + "Version: " + currentProvider.MetadataView.Version; Console.WriteLine(text); ProviderManager = new InputProviderManager(currentProvider.GetExportedObject()); } }
public InputProviderManager(IProvider inputProvider) { instance = this; StartService(); this.inputProvider = inputProvider; this.inputProvider.NewFrame += inputProvider_NewFrame; this.inputProvider.Start(); Console.WriteLine("Started input provider"); }
public void Start() { string providerId = Settings.Default.CurrentProvider; Console.WriteLine("Input provider in settings - " + providerId); if (!string.IsNullOrEmpty(providerId) && InputProviders != null) { Export<IProvider, IAddInView> currentProvider = (from provider in InputProviders where provider.MetadataView.Id == providerId select provider).FirstOrDefault(); if (currentProvider == null) throw new MultitouchException(string.Format("Input provider '{0}' could not be found", providerId)); string text = "Found:" + Environment.NewLine + "Name: " + currentProvider.MetadataView.Id + Environment.NewLine + "Description: " + currentProvider.MetadataView.Description + Environment.NewLine + "Publisher: " + currentProvider.MetadataView.Publisher + Environment.NewLine + "Version: " + currentProvider.MetadataView.Version; Console.WriteLine(text); ProviderManager = new InputProviderManager(currentProvider.GetExportedObject()); } }