Пример #1
0
        private static IIOProvider GetIOProvider()
        {
            if (_ioProvider == null)
            {
                lock (_lock)
                {
                    if (RuntimeInformation.IsUnittest)
                    {
                        return(_ioProvider = new LocalIOProvider());
                    }

                    if (_ioProvider == null)
                    {
                        try
                        {
                            _factory    = new IOProviderFactory();
                            _ioProvider = _factory.CreateDefault();
                        }
                        catch (ArgumentException ex)
                        {
                            HandleConfigurationError(ex);
                        }
                        catch (ConfigurationErrorsException ex)
                        {
                            HandleConfigurationError(ex);
                        }
                    }
                }
            }

            return(_ioProvider);
        }
Пример #2
0
        private static IIOProvider GetIOProvider()
        {
            if (_factory == null || _ioProvider == null)
            {
                lock (_lock)
                {
                    if (_factory == null || _ioProvider == null)
                    {
                        try
                        {
                            _factory    = new IOProviderFactory();
                            _ioProvider = _factory.CreateDefault();
                        }
                        catch (ArgumentException ex)
                        {
                            HandleConfigurationError(ex);
                        }
                        catch (ConfigurationErrorsException ex)
                        {
                            HandleConfigurationError(ex);
                        }
                    }
                }
            }

            return(_ioProvider);
        }
Пример #3
0
        private static IIOProvider GetIOProvider()
        {
            if (_factory == null || _ioProvider == null)
            {
                lock (_lock)
                {
                    if (_factory == null || _ioProvider == null)
                    {
                        try
                        {
                            _factory = new IOProviderFactory();
                            _ioProvider = _factory.CreateDefault();
                        }
                        catch (ArgumentException ex)
                        {
                            HandleConfigurationError(ex);
                        }
                        catch (ConfigurationErrorsException ex)
                        {
                            HandleConfigurationError(ex);
                        }

                    }
                }
            }

            return _ioProvider;
        }
Пример #4
0
        private static IIOProvider GetIOProvider()
        {
            if (_ioProvider == null)
            {
                lock (_lock)
                {
                    if (RuntimeInformation.IsUnittest)
                    {
                        return _ioProvider = new LocalIOProvider();
                    }

                    if (_ioProvider == null)
                    {
                        try
                        {
                            _factory = new IOProviderFactory();
                            _ioProvider = _factory.CreateDefault();
                        }
                        catch (ArgumentException ex)
                        {
                            HandleConfigurationError(ex);
                        }
                        catch (ConfigurationErrorsException ex)
                        {
                            HandleConfigurationError(ex);
                        }

                    }
                }
            }

            return _ioProvider;
        }