Exemple #1
0
        /// <summary>
        /// Expand the abstract version to a list of fully-specified versions
        /// with all the keys of all the registered versions
        /// </summary>
        /// <param name="iv">Abstract version to expand</param>
        /// <returns>List of fully-specified versions</returns>
        public List <ItemVersion> ContainingVersions(ItemVersion iv)
        {
            var expIv = new ItemVersion(iv);

            foreach (var versioner in Versioners)
            {
                if (!iv.ContainsKey(versioner.VersionKey))
                {
                    expIv.Add(versioner.VersionKey, null);
                }
            }
            return(expIv.Expand());
        }
Exemple #2
0
        /// <summary>
        /// Find all specific ItemVersions which are applicable to a type
        /// </summary>
        /// <param name="t">The type</param>
        /// <returns>All applicable ItemVersion</returns>
        public List <ItemVersion> MatchingVersions(Type t)
        {
            var vsn   = new ItemVersion(this);
            var other = VersionManager.Instance.VersionForType(t);

            foreach (var key in this.Keys)
            {
                if (!other.ContainsKey(key))
                {
                    vsn.Remove(key);
                }
            }
            foreach (var key in other.Keys)
            {
                if (!vsn.ContainsKey(key))
                {
                    vsn.Add(key, null);
                }
            }
            return(vsn.Expand());
        }