Beispiel #1
0
        private string GetTextFromTag(object tag)
        {
            Type type = tag as Type;
            COMProxyInstanceEntry   proxy = tag as COMProxyInstanceEntry;
            NdrComplexTypeReference str   = tag as NdrComplexTypeReference;

            if (type != null)
            {
                return(TypeToText(type));
            }
            else if (proxy != null)
            {
                return(proxy.Format(m_iids_to_names));
            }
            else if (str != null)
            {
                return(str.FormatComplexType(new NdrFormatContext(m_iids_to_names, m_types_to_names)));
            }

            return(String.Empty);
        }
        private void listViewStructures_SelectedIndexChanged(object sender, EventArgs e)
        {
            string text = String.Empty;

            if (listViewStructures.SelectedItems.Count > 0)
            {
                ListViewItem            item = listViewStructures.SelectedItems[0];
                Type                    type = item.Tag as Type;
                NdrComplexTypeReference str  = item.Tag as NdrComplexTypeReference;

                if (type != null)
                {
                    text = TypeToText(type);
                }
                else if (str != null)
                {
                    text = str.FormatComplexType(new NdrFormatContext(m_iids_to_names, m_types_to_names));
                }
            }

            textEditor.Text = text;
            textEditor.Refresh();
        }