/// <summary> /// Resizes the event list's columns /// </summary> public static void ResizeEventListColumns(FastObjectListView list, bool hasSignatureColumn) { if (list.Items.Count == 0) { list.BeginUpdate(); foreach (ColumnHeader column in list.Columns) { column.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize); } list.EndUpdate(); } else { list.BeginUpdate(); list.Columns[(int)Global.FieldsEvent.SrcIp].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); list.Columns[(int)Global.FieldsEvent.SrcPort].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); list.Columns[(int)Global.FieldsEvent.DstIp].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); list.Columns[(int)Global.FieldsEvent.DstPort].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); list.Columns[(int)Global.FieldsEvent.Host].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); list.Columns[(int)Global.FieldsEvent.Protocol].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); list.Columns[(int)Global.FieldsEvent.Timestamp].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); list.Columns[(int)Global.FieldsEvent.Classification].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); list.Columns[(int)Global.FieldsEvent.Initials].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); if (hasSignatureColumn == true) { list.Columns[(int)Global.FieldsEvent.Payload].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); } list.EndUpdate(); } }
private void GetData(FastObjectListView olv) { try { olv.BeginUpdate(); olv.SetObjects(SimcList); olv.EndUpdate(); olv.Enabled = olv.Items.Count > 0; lblRecord.Text = "0 z " + olv.Items.Count; } catch (Exception) { throw; } }