public IComponentVersion GetVersion(IDependencyProviderConfig config)
        {
            switch (config.Type)
            {
            case "Local":
                return(new ComponentVersion(GetFieldValue(DependencyProviderValidSettingName.VersionNumber)));

            case "BuildResultJSON":
                return(new ComponentVersion(
                           buildNumber: GetFieldValue(DependencyProviderValidSettingName.BuildNumber),
                           acceptedBuildStatus: GetBuildStatusOrQuality(DependencyProviderValidSettingName.BuildStatus),
                           acceptedBuildQuality: null,
                           acceptedBuildTags: GetBuildStatusOrQuality(DependencyProviderValidSettingName.BuildTags)
                           ));

            case "BuildResult":
                return(new ComponentVersion(
                           buildNumber: GetFieldValue(DependencyProviderValidSettingName.BuildNumber),
                           acceptedBuildStatus: GetBuildStatusOrQuality(DependencyProviderValidSettingName.BuildStatus),
                           acceptedBuildQuality: GetBuildStatusOrQuality(DependencyProviderValidSettingName.BuildQuality),
                           acceptedBuildTags: null));

            case "FileShare":
                return(new ComponentVersion(GetFieldValue(DependencyProviderValidSettingName.VersionNumber)));

            case "SourceControl":
            case "SourceControlCopy":
                var versionSpec = GetFieldValue(DependencyProviderValidSettingName.VersionSpec);
                if (string.IsNullOrWhiteSpace(versionSpec))
                {
                    // Version spec is not set probably because it is an already downloaded component
                    versionSpec = string.Format(
                        "W{0};{1}",
                        GetFieldValue(DependencyProviderValidSettingName.WorkspaceName),
                        GetFieldValue(DependencyProviderValidSettingName.WorkspaceOwner));
                }
                var version = VersionSpec.Parse(
                    versionSpec, GetFieldValue(DependencyProviderValidSettingName.WorkspaceOwner)).
                              First();
                return(new ComponentVersion(version));

            case "BinaryRepository":
                return(new ComponentVersion(GetFieldValue(DependencyProviderValidSettingName.VersionNumber)));

            case "Subversion":
                return(new ComponentVersion(GetFieldValue(DependencyProviderValidSettingName.VersionSpec)));

            default:
                throw new DependencyServiceException(
                          string.Format(
                              "Unsupported dependency type \"{0}\" found. Please check component {1}!", config.Type, Name));
            }
        }