public void LoadData(EventViewerNodeType memberType)
        {
            EventlogPlugin eventLogPlugin = (EventlogPlugin)pi;
            Hostinfo hn = ctx as Hostinfo;

            if (hn != null && hn.hostName != null && hn.IsConnectionSuccess)
            {
                lblCaption.Text = string.Format("EventViewer for {0}", hn.hostName);
            }
            else
            {
                lblCaption.Text = string.Format("EventViewer");
            }
            bool bLayoutSuspended = false;
            try
            {
                if (lvEvents.Items.Count != 0)
                {
                    lvEvents.Items.Clear();
                }

                if (memberType == EventViewerNodeType.LOG)
                {
                    Logger.Log("Getting eventlog records", Logger.eventLogLogLevel);

                    Logger.Log(String.Format("SQL Filter: {0}", sqlQuery), Logger.eventLogLogLevel);

                    EventLogRecord[] logs = eventLogPlugin.ReadEventLog(nOffset, nPageSize, sqlQuery);
                    lvEvents.SuspendLayout();
                    bLayoutSuspended = true;

                    if (logs != null)
                    {
                        ListViewItem[] lvItems = new ListViewItem[logs.Length];
                        int index = 0;
                        foreach (EventLogRecord log in logs)
                        {
                            if (log != null)
                            {
                                EventAPI.EventLogRecord record = log.Record;
                                DateTime eventTime = EventUtils.Time_T2DateTime(record.dwEventDateTime);
                                eventTime = eventTime.ToLocalTime();
                                string[] values = new string[lvEvents.Columns.Count];

                                for (int idx = 0; idx < lvEvents.Columns.Count; idx++)
                                {
                                    string header = lvEvents.Columns[idx].Text.Trim();
                                    if (String.Equals(header, "Type", StringComparison.InvariantCultureIgnoreCase))
                                    {
                                        values[idx] = record.pszEventType;
                                    }
                                    else if (String.Equals(header, "Date", StringComparison.InvariantCultureIgnoreCase))
                                    {
                                        values[idx] = eventTime.ToString("MM/dd/yyyy");
                                    }
                                    else if (String.Equals(header, "Time", StringComparison.InvariantCultureIgnoreCase))
                                    {
                                        values[idx] = eventTime.ToLongTimeString();
                                    }
                                    else if (String.Equals(header, "Source", StringComparison.InvariantCultureIgnoreCase))
                                    {
                                        values[idx] = record.pszEventSource;
                                    }
                                    else if (String.Equals(header, "Category", StringComparison.InvariantCultureIgnoreCase))
                                    {
                                        values[idx] = record.pszEventCategory;
                                    }
                                    else if (String.Equals(header, "Event", StringComparison.InvariantCultureIgnoreCase))
                                    {
                                        values[idx] = record.dwEventSourceId.ToString();
                                    }
                                    else if (String.Equals(header, "User", StringComparison.InvariantCultureIgnoreCase))
                                    {
                                        values[idx] = record.pszUser;
                                    }
                                    else if (String.Equals(header, "Computer", StringComparison.InvariantCultureIgnoreCase))
                                    {
                                        values[idx] = record.pszComputer;
                                    }
                                }
                                lvItems[index] = new ListViewItem(values);
                                lvItems[index].Tag = log;
                                lvItems[index++].ImageIndex = (int)GetNodeType(record.pszEventType);
                            }
                        }
                        lvEvents.Items.AddRange(lvItems);
                    }
                }
                else if (memberType == EventViewerNodeType.PLUGIN)
                {
                    InitializePluginNodeControl();
                }
            }
            catch (Exception ex)
            {
                Logger.LogException("EventViewerControl.LoadData", ex);
            }
            finally
            {
                if (bLayoutSuspended)
                {
                    lvEvents.ResumeLayout();
                }
            }
        }
        public EventViewerControl(EventViewerNodeType type)
            : this()
        {
            Logger.Log("EventViewerControl constructor: running Initialize()", Logger.eventLogLogLevel);

            memberType = type;

            // Create an instance of a ListView column sorter and assign it
            // to the ListView control.
            lvwColumnSorter = new ListViewColumnSorter();
            this.lvEvents.ListViewItemSorter = lvwColumnSorter;

            if (lvEvents.Columns.Count != 0)
            {
                lvEvents.Columns.Clear();
            }

            if (type == EventViewerNodeType.PLUGIN)
            {
                columnLabels = _PluginColumns;
            }
            else if (type == EventViewerNodeType.LOG)
            {
                columnLabels = _LogColumns;
            }
            else
            {
                throw new ArgumentException("EventViewerControl must be initialized as either EventViewerNodeType.LOG, EventViewerNodeType.PLUGIN was not set");
            }

            numColumns = columnLabels.Length;
            columnHeaders = new ColumnHeader[numColumns];
            for (int i = 0; i < numColumns; i++)
            {
                columnHeaders[i] = new ColumnHeader();
                columnHeaders[i].Name = columnLabels[i];
                columnHeaders[i].Text = columnLabels[i];
                columnHeaders[i].Width = 125;
            }

            this.lvEvents.Columns.AddRange(columnHeaders);

            //Filter listview columns
            if (memberType == EventViewerNodeType.LOG)
            {
                AddRemoveColumnsForm.Diplayedcolumns = AddRemoveColumnsForm.logDisplayedcolumns;
                this.panel1.Show();
            }
            else if (memberType == EventViewerNodeType.PLUGIN)
            {
                AddRemoveColumnsForm.Diplayedcolumns = AddRemoveColumnsForm.pluginDisplayedcolumns;

                this.panel1.Hide();
                this.lvEvents.ResumeLayout();
            }
            if (AddRemoveColumnsForm.Diplayedcolumns != null &&
                AddRemoveColumnsForm.Diplayedcolumns.Count != 0)
            {
                ShowHideColumns();
            }
        }