Esempio n. 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 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)
            {
                INdrFormatter formatter = DefaultNdrFormatter.Create(m_iids_to_names);
                return(formatter.FormatComplexType(str));
            }

            return(String.Empty);
        }
Esempio n. 3
0
        private void listViewTypes_SelectedIndexChanged(object sender, EventArgs e)
        {
            string text = String.Empty;

            if (listViewTypes.SelectedItems.Count > 0)
            {
                ListViewItem          item  = listViewTypes.SelectedItems[0];
                Type                  type  = item.Tag as Type;
                COMProxyInstanceEntry proxy = item.Tag as COMProxyInstanceEntry;

                if (type != null)
                {
                    text = TypeToText(type);
                }
                else if (proxy != null)
                {
                    text = proxy.Format(m_iids_to_names);
                }
            }

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