Beispiel #1
0
        public List <DisplayCounterSet> GetCounterSetByGroup(string group = null)
        {
            string me = whoami();

            if (string.IsNullOrEmpty(group))
            {
                group = MembershipHelper.DefaultGroup(me);
            }
            else
            {
                MembershipHelper.CheckMembership(group, me);
            }

            List <CounterSet>        css  = _counterManager.GetCounterSetByGroup(group);
            List <DisplayCounterSet> dcss = new List <DisplayCounterSet>();

            foreach (CounterSet cs in css)
            {
                DisplayCounterSet dcs = new DisplayCounterSet(cs);
                if (cs.RecordCount > 0)
                {
                    CounterRecord record = _counterManager.GetSingleCounterRecord(cs.Group, cs.Name, cs.RecordCount - 1);
                    foreach (var cv in record.Value.RelatedValues)
                    {
                        dcs.Entry.Add(new DisplayCounter(cv.Name, cv.Type));
                    }
                }

                dcss.Add(dcs);
            }
            return(dcss);
        }