Beispiel #1
0
    public override Form DrillDown()
    {
        // DrillDown on a ClassType will just browse it using Reflection
        var pgForm = new GenericPropGridView(_value);

        pgForm.Text = $"System.Type = {_value.FullName}";
        pgForm.ShowDialog();
        return(null);
    }
Beispiel #2
0
    public static void BrowseReflection(object obj)
    {
        if (obj is null)
        {
            MessageBox.Show("Object is null");
            return;
        }

        var pgForm = new GenericPropGridView(obj);

        pgForm.Text = $"Object Data (System.Type = {obj.GetType().FullName})";
        pgForm.ShowDialog();
    }
    /// <summary>
    ///     User chose "Show Class Info..." from the context menu.  Allow them to browse
    ///     using Reflection for the class of the sub-object selected.
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    private void OnShowClassInfo(object sender, EventArgs e)
    {
        var selObj = _pgProps.SelectedGridItem.Value;

        if (selObj is null)
        {
            MessageBox.Show("Value is null.");
        }
        else
        {
            var pgForm = new GenericPropGridView(selObj.GetType());
            pgForm.Text = $"{_pgProps.SelectedGridItem.Label} (System.Type = {selObj.GetType().FullName})";
            pgForm.ShowDialog();
        }
    }