private static string GetComplexTypeName(NdrComplexTypeReference type, int index) { if (type is NdrBaseStructureTypeReference) { return(String.Format("Struct_{0}", index)); } else if (type is NdrUnionTypeReference) { return(String.Format("Union_{0}", index)); } else { return(String.Format("UnknownType_{0}", index)); } }
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); }
private string GetTextFromTag(object tag) { var type = tag as Type; var proxy = tag as NdrComProxyDefinition; NdrComplexTypeReference str = tag as NdrComplexTypeReference; if (type != null) { return(COMUtilities.FormatComType(type)); } else if (proxy != null) { INdrFormatter formatter = DefaultNdrFormatter.Create(m_iids_to_names, COMUtilities.DemangleWinRTName); return(formatter.FormatComProxy(proxy)); } else if (str != null) { INdrFormatter formatter = DefaultNdrFormatter.Create(m_iids_to_names); return(formatter.FormatComplexType(str)); } 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(); }
private string GetTextFromTag(object tag) { var type = tag as Type; var proxy = tag as NdrComProxyDefinition; NdrComplexTypeReference str = tag as NdrComplexTypeReference; if (type != null) { return(COMUtilities.FormatComType(type)); } else if (proxy != null) { INdrFormatter formatter = GetNdrFormatter(true); return(formatter.FormatComProxy(proxy)); } else if (str != null) { INdrFormatter formatter = GetNdrFormatter(false); return(formatter.FormatComplexType(str)); } return(String.Empty); }