コード例 #1
0
        public List <UMUpdate> WittleDown(UMProducts prod, Architectures?arcs, bool super, bool appr, bool decline)
        {
            var list = new List <UMUpdate>();
            var info = new UMProductInfo(prod, arcs, super, appr, decline);

            for (int i = 0; i < UMContext.AllUpdates.Count; i++)
            {
                var up = UMContext.AllUpdates[i];
                if (up.MatchesInfo(info))
                {
                    list.Add(up);
                }
            }
            return(list);
        }
コード例 #2
0
        public ArchitectureParameter(UMProducts[] prods = null)
            : base(pName, type)
        {
            var list = new List <string>();

            if (prods != null)
            {
                for (int d = 0; d < prods.Length; d++)
                {
                    UMProducts p  = prods[d];
                    var        pi = new UMProductInfo(p, null, false, false, false);
                    list.AddRange(pi.AllowedPlatforms);
                }
            }
            if (enumValues == null)
            {
                enumValues = typeof(Architectures).GetEnumValues();
            }
            var strArr = new List <string>();

            for (int i = 0; i < enumValues.Length; i++)
            {
                var arc = (Architectures)enumValues.GetValue(i);
                strArr.Add(info.GetNameAttribute(arc));
            }
            for (int t = 0; t < list.Count; t++)
            {
                var inf = list[t];
                for (int f = strArr.Count - 1; f >= 0; f--)
                {
                    var s = strArr[f];
                    if (!list.Contains(s))
                    {
                        strArr.Remove(s);
                    }
                }
            }

            ValidatedItems = strArr.ToArray();
            Aliases        = new string[1] {
                "arc"
            };
            SetParameterAttributes(atts);

            AllowNull = true;

            CommitAttributes();
        }
コード例 #3
0
        internal List <UMUpdate> FilterUpdates(bool IsSuperseded, bool IsApproved, bool IsDeclined, bool displayResults = true)
        {
            var ups  = new List <UMUpdate>();
            var info = new UMProductInfo(null, null, IsSuperseded, IsApproved, IsApproved);

            for (int i = 0; i < UMContext.AllUpdates.Count; i++)
            {
                var u = UMContext.AllUpdates[i];
                if (u.MatchesInfo(info))
                {
                    ups.Add(u);
                }
            }
            if (displayResults)
            {
                WriteObject(ups.ToArray(), true);
                return(null);
            }
            else
            {
                return(ups);
            }
        }