OnShowClassInfo(object sender, EventArgs e) { var selObj = _mPgProps.SelectedGridItem.Value; if (selObj == null) { MessageBox.Show("Value is null."); } else { var pgForm = new GenericPropGrid(selObj.GetType()); pgForm.Text = $"{_mPgProps.SelectedGridItem.Label} (System.Type = {selObj.GetType().FullName})"; pgForm.ShowDialog(); } }
/// <summary> /// User chose "Show Object Info..." from the context menu. Allow them to browse /// using Reflection for the sub-object selected. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnShowObjInfo(object sender, EventArgs e) { var selObj = _mPgProps.SelectedGridItem.Value; if (selObj == null) { MessageBox.Show("Value is null."); } else { var pgForm = new GenericPropGrid(selObj); pgForm.Text = $"{_mPgProps.SelectedGridItem.Label} (Object Info: {selObj.GetType()})"; pgForm.ShowDialog(); } }