示例#1
0
            public static string GetVersion(out ReleaseTypes versionType)
            {
                versionType = ReleaseTypes.Unknown;

                IVsExtensionManager extensionManagerService = Package.GetGlobalService(typeof(SVsExtensionManager)) as IVsExtensionManager;

                if (extensionManagerService == null)
                {
                    return(null);
                }

                IInstalledExtension lufaExt = null;

                if (extensionManagerService.TryGetInstalledExtension(GuidList.guidLUFAVSIXManifestString, out lufaExt) == false)
                {
                    return(null);
                }

                string[] lufaVersionSegments = lufaExt.Header.Version.ToString().Split('.');

                if (lufaVersionSegments.First().Equals("0"))
                {
                    versionType = ReleaseTypes.Test;
                    return(lufaVersionSegments[1]);
                }
                else
                {
                    versionType = ReleaseTypes.Normal;
                    return(lufaVersionSegments.Last());
                }
            }
        public void meh(ReleaseTypes type, IEnumerable<string> validResolutionTags, IEnumerable<string> validSourceTags, IEnumerable<string> validCodecTags, IEnumerable<string> invalidExtraTags)
        {
            // These defaults should really depend on which releaseType we've currently got.
            if (validResolutionTags == null) {
                validResolutionTags = new List<string>() { "720p", "1080p" };
            }
            if (validSourceTags == null)
            {
                validSourceTags = new List<string>() { "HDTV", "BLURAY" };
            }
            if (validCodecTags == null) {
                validCodecTags = new List<string>() { "h264" };
            }

            // Check for nukes and the like.
            if (invalidExtraTags == null) {
                invalidExtraTags = new List<string>() { "out.of.sync", "nuke", "nuked" };
            }

            string regex = @"^(?'TAGS'[A-Za-z0-9\.\[\]]+)-(?'GROUP'[A-Za-z0-9\.]*+)$";

            //Regex reg = new Regex(@"^S(?'SEASON'\d{2})E(?'EPISODE'\d{2})$", RegexOptions.Singleline | RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase);

            Regex reg = new Regex(regex, RegexOptions.Singleline | RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase);
            Match match = reg.Match(this.ReleaseName);

            if (match.Success) {
                string groupString = match.Groups["GROUP"].Value;
                string tagsString = match.Groups["TAGS"].Value;

                // lets start by finding the resolution tag, and then split on that. left side will be name + id (episode number or year or something).
                GetTagMatchLeft(

            }
        }