示例#1
0
        int IComparer.Compare(object x, object y)
        {
            TypeItem a = (TypeItem)((ListViewItem)x).Tag;
            TypeItem b = (TypeItem)((ListViewItem)y).Tag;

            int comp;

            switch (SortColumn)
            {
            case TypeItem.COL_PKG: comp = a.Package.CompareTo(b.Package); break;

            case TypeItem.COL_MAX: comp = a.Maximum.CompareTo(b.Maximum); break;

            case TypeItem.COL_COUNT: comp = a.Count.CompareTo(b.Count); break;

            case TypeItem.COL_MEM: comp = a.Memory.CompareTo(b.Memory); break;

            default: comp = a.Name.CompareTo(b.Name); break;
            }

            return(Sorting == SortOrder.Ascending ? comp : -comp);
        }
示例#2
0
        /// <summary>
        /// Live objects stats
        /// </summary>
        /// <param name="lines"></param>
        public void UpdateTypeGrid(string[] lines)
        {
            listView.SetExStyles();
            listView.BeginUpdate();
            foreach (TypeItem item in items.Values)
            {
                item.Zero();
            }

            try
            {
                foreach (string line in lines)
                {
                    string[] parts = line.Split('/');
                    TypeItem item;
                    if (parts.Length == 4)
                    {
                        item            = new TypeItem(parts[3]);
                        items[parts[0]] = item;
                        listView.Items.Add(item.ListItem);
                    }
                    else if (!items.ContainsKey(parts[0]))
                    {
                        continue;
                    }
                    else
                    {
                        item = items[parts[0]];
                    }
                    item.Update(parts[1], parts[2]);
                }
                listView.Sort();
            }
            finally
            {
                listView.EndUpdate();
            }
        }
示例#3
0
 void liveObjectsView_OnViewObject(TypeItem item)
 {
     snapshotWanted = Encoding.Default.GetBytes("<flashconnect status=\"5\" qname=\"" + item.QName.Replace("<", "&#60;") + "\"/>\0");
     objectRefsView.Clear();
     tabControl.SelectedTab = objectsPage;
 }
 void liveObjectsView_OnViewObject(TypeItem item)
 {
     snapshotWanted = Encoding.Default.GetBytes("<flashconnect status=\"5\" qname=\"" + item.QName.Replace("<", "&#60;") + "\"/>\0");
     objectRefsView.Clear();
     tabControl.SelectedTab = objectsPage;
 }
        /// <summary>
        /// Live objects stats
        /// </summary>
        /// <param name="lines"></param>
        public void UpdateTypeGrid(string[] lines)
        {
            listView.SetExStyles();
            listView.BeginUpdate();
            foreach (TypeItem item in items.Values)
                item.Zero();

            try
            {
                foreach (string line in lines)
                {
                    string[] parts = line.Split('/');
                    TypeItem item;
                    if (parts.Length == 4)
                    {
                        item = new TypeItem(parts[3]);
                        items[parts[0]] = item;
                        listView.Items.Add(item.ListItem);
                    }
                    else if (!items.ContainsKey(parts[0])) continue;
                    else item = items[parts[0]];
                    item.Update(parts[1], parts[2]);
                }
                listView.Sort();
            }
            finally
            {
                listView.EndUpdate();
            }
        }