Exemple #1
0
        public InputProviderSite RegisterInputProvider(object inputProvider)
        {
            this.VerifyAccess();
            InputProviderSite inputProviderSite = new InputProviderSite(this, inputProvider);
            int index = this._inputProviders.IndexOf(inputProvider);

            if (index < 0)
            {
                this._inputProviders.Add(inputProvider);
                this._inputProviderSites.Add((object)inputProviderSite);
            }
            else
            {
                this._inputProviders[index]     = inputProvider;
                this._inputProviderSites[index] = (object)inputProviderSite;
            }
            return(inputProviderSite);
        }
Exemple #2
0
        /// <summary>
        ///     Registers an input provider with the input manager.
        /// </summary>
        /// <param name="inputProvider">
        ///     The input provider to register.
        /// </param>
        public InputProviderSite RegisterInputProvider(object inputProvider)
        {
            VerifyAccess();

            // Create a site for this provider, and keep track of it.
            var site = new InputProviderSite(this, inputProvider);

            var idx = this._inputProviders.IndexOf(inputProvider);

            if (idx < 0)
            {
                this._inputProviders.Add(inputProvider);
                this._inputProviderSites.Add(site);
            }
            else
            {
                // NOTE -- should we dispose the old one?
                this._inputProviders[idx]     = inputProvider;
                this._inputProviderSites[idx] = site;
            }

            return(site);
        }
 public InputProvider(Application a)
 {
     this.buttonSite  = InputManager.CurrentInputManager.RegisterInputProvider(this);
     this.application = a;
 }