OleViewDotNet.TypedObjectViewer.listViewProperties_MouseDoubleClick C# (CSharp) Метод

listViewProperties_MouseDoubleClick() приватный Метод

private listViewProperties_MouseDoubleClick ( object sender, MouseEventArgs e ) : void
sender object
e MouseEventArgs
Результат void
        private void listViewProperties_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (listViewProperties.SelectedItems.Count > 0)
            {
                PropertyInfo pi = (PropertyInfo)listViewProperties.SelectedItems[0].Tag;

                if (pi.CanWrite)
                {
                    object val = null;

                    try
                    {
                        if (pi.CanRead)
                        {
                            val = pi.GetValue(m_pObject, null);
                        }
                    }
                    catch (Exception ex)
                    {
                        System.Diagnostics.Debug.WriteLine(ex.ToString());
                        val = null;
                    }

                    using (GetTypeForm frm = new GetTypeForm(pi.PropertyType, val))
                    {
                        if (frm.ShowDialog() == DialogResult.OK)
                        {
                            try
                            {
                                pi.SetValue(m_pObject, frm.Data, null);
                            }
                            catch (Exception ex)
                            {
                                System.Diagnostics.Debug.WriteLine(ex.ToString());
                            }
                            UpdateProperties();
                        }
                    }
                }
            }
        }