示例#1
0
        public static string UidsToString(UIds uids)
        {
            if (uids == null)
            {
                return(null);
            }
            StringBuilder uidsStr = new StringBuilder();

            foreach (UId uid in uids)
            {
                uidsStr.Append("UID: {");
                uidsStr.AppendFormat("Id: {0} ", uid.Id);
                uidsStr.AppendFormat("IdValue: {0}", uid.IdValue);
                uidsStr.AppendLine("}");
            }
            return(uidsStr.ToString());
        }
示例#2
0
        private bool isTunerCountTweaked(int count)
        {
            updateStatusText("Verifying tuner limit increases ...");
            Logger.WriteVerbose("Verifying tuner limit increases ...");

            int success = 0;

            using (UIds uids = new UIds(Store.objectStore))
            {
                foreach (UId uid in uids.Where(arg => arg.GetFullName().StartsWith("!vss-")))
                {
                    foreach (string country in countries)
                    {
                        if (uid.GetFullName().Equals("!vss-" + country))
                        {
                            Type           t          = uid.Target.GetType();
                            PropertyInfo[] properties = t.GetProperties();
                            foreach (var property in properties.Where(arg => arg.Name.StartsWith("MaxRecordersFor")))
                            {
                                var q = property.GetValue(uid.Target, null);
                                if ((int)q != count)
                                {
                                    return(false);
                                }
                            }
                            ++success;
                            continue;
                        }
                    }
                    if (success == countries.Length)
                    {
                        return(true);
                    }
                }
            }
            Store.Close();
            return(false);
        }