public static void ParseStreamIntoReplicationListView(NetworkStream NetworkStream, Dictionary <int, ObjectReplicationSummary> Summaries, ListView ListView)
        {
            ListView.BeginInit();
            ListView.Items.Clear();

            // Columns are "Object Class", "# Comparisons", "# Replications", "Comparison Time", "Avg. Time Per Compare"
            var Columns = new string[5];

            foreach (var SummaryEntry in Summaries)
            {
                Columns[0] = NetworkStream.GetName(SummaryEntry.Key);
                Columns[1] = (SummaryEntry.Value.NumberOfComparisons).ToString("0");
                Columns[2] = (SummaryEntry.Value.NumberOfReplications).ToString("0");
                Columns[3] = (SummaryEntry.Value.TimeSpentComparingProperties).ToString("0.0");
                Columns[4] = ((float)SummaryEntry.Value.TimeSpentComparingProperties / (float)SummaryEntry.Value.NumberOfComparisons).ToString("0.000");

                GridView gridView = new GridView();
                ListView.View = gridView;

                foreach (string S in Columns)
                {
                    gridView.Columns.Add(new GridViewColumn {
                        Header = S
                    });
                }
            }

            //ListView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
            ListView.EndInit();
        }
        public static void ParseStreamIntoPropertyReplicationListView(NetworkStream NetworkStream, ReadOnlyCollection <PropertyReplicationSummary> Summaries, ListView ListView)
        {
            ListView.BeginInit();
            ListView.Items.Clear();

            if (Summaries != null)
            {
                // Columns are "Property", "# Comparisons", "# Times Changed", "# Replications"
                var Columns = new string[4];
                foreach (var Summary in Summaries)
                {
                    Columns[0] = NetworkStream.GetName(Summary.PropertyNameIndex);
                    Columns[1] = (Summary.NumberOfComparisons).ToString("0");
                    Columns[2] = (Summary.NumberOfChanges).ToString("0");
                    Columns[3] = (Summary.NumberOfReplications).ToString("0");

                    GridView gridView = new GridView();
                    ListView.View = gridView;

                    foreach (string S in Columns)
                    {
                        gridView.Columns.Add(new GridViewColumn {
                            Header = S
                        });
                    }
                }
            }

            //ListView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
            ListView.EndInit();
        }
        /**
         * Parses summaries into a list view using the network stream for name lookup.
         *
         * @param	NetworkStream	Network stream used for name lookup
         * @param	Summaries		Summaries to parse into list view
         * @param	ListView		List view to parse data into
         */
        public static void ParseStreamIntoListView(NetworkStream NetworkStream, Dictionary <int, TypeSummary> Summaries, ListView ListView)
        {
            ListView.BeginInit();
            ListView.Items.Clear();

            // Columns are total size KByte, count, avg size in bytes, avg size in bits and associated name.
            var Columns = new string[7];

            foreach (var SummaryEntry in Summaries)
            {
                Columns[0] = ((float)SummaryEntry.Value.SizeBits / 8 / 1024).ToString("0.0");
                Columns[1] = SummaryEntry.Value.Count.ToString();
                Columns[2] = ((float)SummaryEntry.Value.SizeBits / 8 / SummaryEntry.Value.Count).ToString("0.0");
                Columns[3] = ((float)SummaryEntry.Value.SizeBits / SummaryEntry.Value.Count).ToString("0.0");
                Columns[4] = SummaryEntry.Value.TimeInMS.ToString("0.00");
                Columns[5] = (SummaryEntry.Value.TimeInMS / SummaryEntry.Value.Count).ToString("0.0000");
                Columns[6] = NetworkStream.GetName(SummaryEntry.Key);

                ListView.Items.Add(new NetworkListViewItem {
                    Header1 = Columns[0], Header2 = Columns[1], Header3 = Columns[2], Header4 = Columns[3], Header5 = Columns[4], Header6 = Columns[5], Header7 = Columns[6]
                });
                //ListView.ItemsSource = Columns;
            }

            //ListView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
            ListView.EndInit();
        }