public FrmInspector()
 {
     InitializeComponent();
     //AddButtonsToPropertyGrid();
     lvSharedVariableList.View = View.Details;
     lvSharedVariableList.Columns.Add("Name", "Name", 100);
     lvSharedVariableList.Columns.Add("Type", "Type", 75);
     lvSharedVariableList.Columns.Add("LastUpdated", "Last updated", 75);
     lvSharedVariableList.Columns.Add("LastWriter", "Last writer", 150);
     lvSharedVariableList.FullRowSelect = true;
     inspector = new Inspector();
     inspector.StatusChanged += new InspectorStatusChangedEH(inspector_StatusChanged);
     inspector.SharedVariableAdded += new InspectorSharedVariableAddedEH(inspector_SharedVariableAdded);
     inspector.SharedVariableUpdated += new SharedVariableUpdatedEventHadler(inspector_SharedVariableUpdated);
 }
 private void inspector_SharedVariableAdded(Inspector inspector, SharedVariable sharedVariable)
 {
     this.BeginInvoke(new EventHandler (delegate(object o, EventArgs e)
     {
         string[] row = { sharedVariable.Name,
                            sharedVariable.TypeName + (sharedVariable.IsArray ? "[]" : String.Empty),
                            sharedVariable.LastUpdated.ToString("hh:mm:ss"),
                            String.IsNullOrEmpty(sharedVariable.LastWriter) ? "(Unknown)" : sharedVariable.LastWriter
                        };
         ListViewItem item = new ListViewItem(row);
         item.Name = sharedVariable.Name;
         item.Tag = sharedVariable;
         lvSharedVariableList.Items.Add(item);
         item.BackColor = (item.Index % 2 == 0) ? Color.White : Color.LightGray;
         lvSharedVariableList.Refresh();
     }));
 }
 private void inspector_StatusChanged(Inspector inspector)
 {
     this.lblStatus.Text = inspector.Status.ToString();
 }