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


C# TypeReference.ToString方法代码示例

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


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

示例1: ResolveTypeReference_ArrayOfSourceType_Works

    public void ResolveTypeReference_ArrayOfSourceType_Works()
    {
      TypeReference reference = new TypeReference("RadClass", new int[] { 0, 0 });

      _typeResolver.AddTableEntry("SomeNamespace.Utility.RadClass");

      _typeResolver.UseNamespace("System");
      _typeResolver.UseNamespace("SomeNamespace.Utility");

      Assert.AreEqual("RadClass[][]", reference.ToString());
      Assert.AreEqual("SomeNamespace.Utility.RadClass[][]", _typeResolver.Resolve(reference));
    }
开发者ID:mgagne-atman,项目名称:Projects,代码行数:12,代码来源:TypeResolverTests.cs

示例2: ResolveTypeReference_GenericDictionary_Works

    public void ResolveTypeReference_GenericDictionary_Works()
    {
      TypeReference reference = new TypeReference("Dictionary", new List<TypeReference>(new TypeReference[] { new TypeReference("string"), new TypeReference("DateTime") }));
      _typeResolver.UseNamespace("System");
      _typeResolver.UseNamespace("System.Collections.Generic");

      Assert.AreEqual("Dictionary<string,DateTime>", reference.ToString());
      string actual = _typeResolver.Resolve(reference);
    }
开发者ID:mgagne-atman,项目名称:Projects,代码行数:9,代码来源:TypeResolverTests.cs

示例3: ResolveTypeReference_TwoDimArray_Works

    public void ResolveTypeReference_TwoDimArray_Works()
    {
      TypeReference reference = new TypeReference("DateTime", new int[] { 0, 0 });

      _typeResolver.UseNamespace("System");

      Assert.AreEqual("DateTime[][]", reference.ToString());
      Assert.AreEqual("System.DateTime[][]", _typeResolver.Resolve(reference));
    }
开发者ID:mgagne-atman,项目名称:Projects,代码行数:9,代码来源:TypeResolverTests.cs

示例4: ResolveTypeReference_SimplePrimitiveTypeArray_Works

    public void ResolveTypeReference_SimplePrimitiveTypeArray_Works()
    {
      TypeReference reference = new TypeReference("long", new int[] { 0 });

      _typeResolver.UseNamespace("System");

      Assert.AreEqual("long[]", reference.ToString());
      Assert.AreEqual("System.Int64[]", _typeResolver.Resolve(reference));
    }
开发者ID:mgagne-atman,项目名称:Projects,代码行数:9,代码来源:TypeResolverTests.cs

示例5: ResolveTypeReference_Simple_Works

    public void ResolveTypeReference_Simple_Works()
    {
      TypeReference reference = new TypeReference("DateTime");

      _typeResolver.UseNamespace("System");

      Assert.AreEqual("DateTime", reference.ToString());
      Assert.AreEqual("System.DateTime", _typeResolver.Resolve(reference));
    }
开发者ID:mgagne-atman,项目名称:Projects,代码行数:9,代码来源:TypeResolverTests.cs

示例6: ResolveTypeReference_GenericList_Works

		public void ResolveTypeReference_GenericList_Works()
		{
			var reference = new TypeReference("List", new List<TypeReference>(new[] {new TypeReference("string")}));
			typeResolver.UseNamespace("System");
			typeResolver.UseNamespace("System.Collections.Generic");

			Assert.AreEqual("List<string>", reference.ToString());
		}
开发者ID:mgagne-atman,项目名称:Projects,代码行数:8,代码来源:TypeResolverTests.cs

示例7: ResolveTypeReference_SimpleArray_Works

		public void ResolveTypeReference_SimpleArray_Works()
		{
			var reference = new TypeReference("DateTime", new[] {0});

			typeResolver.UseNamespace("System");

			Assert.AreEqual("DateTime[]", reference.ToString());
			Assert.AreEqual("System.DateTime[]", typeResolver.Resolve(reference));
		}
开发者ID:mgagne-atman,项目名称:Projects,代码行数:9,代码来源:TypeResolverTests.cs


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