Esempio n. 1
0
        private IImageProvider GetImageProvider()
        {
            var solution = VisualStudioUtility.GetSolutionSettingsFileFullPath();
            var ret      = _imageProviders.FirstOrDefault(x => x.SolutionConfigFile == solution && x.ProviderType == _settings.ImageBackgroundType);

            if (!string.IsNullOrEmpty(solution))
            {
                ret = _imageProviders.FirstOrDefault(x => x.SolutionConfigFile == solution);
                if (ret == null)
                {
                    ret = _imageProviders.FirstOrDefault(x => x.SolutionConfigFile == null && x.ProviderType == _settings.ImageBackgroundType);
                }
            }
            else
            {
                ret = _imageProviders.FirstOrDefault(x => x.SolutionConfigFile == null && x.ProviderType == _settings.ImageBackgroundType);
            }

            if (ret == null)
            {
                ret = new SingleImageProvider(Setting.Instance);
            }

            return(ret);
        }
Esempio n. 2
0
        private ImageProvider GetImageProvider()
        {
            var ret = ProvidersHolder.Instance.ActiveProvider;

            if (ret == null)
            {
                ret = new SingleImageProvider(Setting.Instance);
            }

            return(ret);
        }