当前位置: 首页>>代码示例>>C#>>正文


C# ITextOutput.WriteModule方法代码示例

本文整理汇总了C#中ITextOutput.WriteModule方法的典型用法代码示例。如果您正苦于以下问题:C# ITextOutput.WriteModule方法的具体用法?C# ITextOutput.WriteModule怎么用?C# ITextOutput.WriteModule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ITextOutput的用法示例。


在下文中一共展示了ITextOutput.WriteModule方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateUI

        void CreateUI(ITextOutput output, object o, bool includeNamespace)
        {
            var ns = o as NamespaceSearchResult;
            if (ns != null) {
                output.WriteNamespace(ns.Namespace);
                return;
            }

            var td = o as TypeDef;
            if (td != null) {
                Debug.Assert(Language != null);
                Language.TypeToString(output, td, includeNamespace);
                return;
            }

            var md = o as MethodDef;
            if (md != null) {
                output.Write(IdentifierEscaper.Escape(md.Name), TextTokenHelper.GetTextTokenType(md));
                return;
            }

            var fd = o as FieldDef;
            if (fd != null) {
                output.Write(IdentifierEscaper.Escape(fd.Name), TextTokenHelper.GetTextTokenType(fd));
                return;
            }

            var pd = o as PropertyDef;
            if (pd != null) {
                output.Write(IdentifierEscaper.Escape(pd.Name), TextTokenHelper.GetTextTokenType(pd));
                return;
            }

            var ed = o as EventDef;
            if (ed != null) {
                output.Write(IdentifierEscaper.Escape(ed.Name), TextTokenHelper.GetTextTokenType(ed));
                return;
            }

            var asm = o as AssemblyDef;
            if (asm != null) {
                output.Write(asm);
                return;
            }

            var mod = o as ModuleDef;
            if (mod != null) {
                output.WriteModule(mod.FullName);
                return;
            }

            var asmRef = o as AssemblyRef;
            if (asmRef != null) {
                output.Write(asmRef);
                return;
            }

            var modRef = o as ModuleRef;
            if (modRef != null) {
                output.WriteModule(modRef.FullName);
                return;
            }

            // non-.NET file
            var loadedAsm = o as LoadedAssembly;
            if (loadedAsm != null) {
                output.Write(loadedAsm.ShortName, TextTokenType.Text);
                return;
            }

            var resNode = o as ResourceTreeNode;
            if (resNode != null) {
                output.WriteFilename(resNode.Name);
                return;
            }

            var resElNode = o as ResourceElementTreeNode;
            if (resElNode != null) {
                output.WriteFilename(resElNode.Name);
                return;
            }

            var s = o as string;
            if (s != null) {
                output.Write(s, TextTokenType.Text);
                return;
            }

            Debug.Assert(s == null);
        }
开发者ID:LiangChow,项目名称:dnSpy,代码行数:90,代码来源:SearchPane.cs


注:本文中的ITextOutput.WriteModule方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。