This Form makes use of the built-in abilities of Reflection and the PropertyGrid class to automatically list out the data of an object. Because we don't have much control, it will get output in the order that it chooses (or alphabetical) and most of the items will appear as Greyed-out, read-only items. But, we don't have to go write a SnoopCollector for every item in the .NET system.
상속: System.Windows.Forms.Form
예제 #1
0
        OnShowClassInfo(object sender, System.EventArgs e)
        {
            object selObj = m_pgProps.SelectedGridItem.Value;

            if (selObj == null)
                MessageBox.Show("Value is null.");
            else {
                GenericPropGrid pgForm = new GenericPropGrid(selObj.GetType());
                pgForm.Text = string.Format("{0} (System.Type = {1})", m_pgProps.SelectedGridItem.Label, selObj.GetType().FullName);
                pgForm.ShowDialog();
            }
        }