Exemplo n.º 1
0
                #pragma warning restore 0414

        private WearableProviderBase GetOrCreateProvider(ProviderId providerId)
        {
            switch (providerId)
            {
            case ProviderId.DebugProvider:
                if (_debugProvider == null)
                {
                    _debugProvider = new WearableDebugProvider();
                }
                return(_debugProvider);

            case ProviderId.WearableDevice:
                if (_deviceProvider == null)
                {
                    _deviceProvider = new WearableDeviceProvider();
                }
                return(_deviceProvider);

            case ProviderId.MobileProvider:
                if (_mobileProvider == null)
                {
                    _mobileProvider = new WearableMobileProvider();
                }
                return(_mobileProvider);

            case ProviderId.USBProvider:
                if (_usbProvider == null)
                {
                    _usbProvider = new WearableUSBProvider();
                }

                return(_usbProvider);

            case ProviderId.WearableProxy:
                if (_proxyProvider == null)
                {
                    _proxyProvider = new WearableProxyProvider();
                }

                return(_proxyProvider);

            default:
                throw new NotImplementedException();
            }
        }