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


C# TypeName.ToString方法代码示例

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


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

示例1: GetType

			internal Type GetType(ModuleReader module, TypeName typeName)
			{
				if (type == null)
				{
					Assembly asm = module.ResolveAssemblyRef(assemblyRef);
					type = asm.ResolveType(typeName);
					if (type == null)
					{
						throw new TypeLoadException(typeName.ToString());
					}
				}
				return type;
			}
开发者ID:koush,项目名称:mono,代码行数:13,代码来源:ModuleReader.cs

示例2: CompressDoUpdateHelper

 private void CompressDoUpdateHelper(byte[] content, string name, TypeName typeName, bool compress)
 {
     if (compress)
         content = SevenZipHelper.Compress(content);
     DoUpdateResource(typeName.ToString() + (compress ? "_LZMA" : ""), name, content);
 }
开发者ID:red2901,项目名称:ExcelDna,代码行数:6,代码来源:ResourceHelper.cs

示例3: TypeNameToString

        public void TypeNameToString()
        {
            TypeName tn = new TypeName()
            {
                Namespace = "SurveyEngine.DataTypeConverters",
                Name = "CalendarQuestionConstraintType",
                Assembly = "SurveyEngine.DataTypeConverters",
                Version = new Version("2.3.5.2"),
                Culture = "neutral",
                PublicKeyToken = "79cd5921ea88a364"
            };

            Assert.AreEqual("SurveyEngine.DataTypeConverters.CalendarQuestionConstraintType, SurveyEngine.DataTypeConverters, Version=2.3.5.2, Culture=neutral, PublicKeyToken=79cd5921ea88a364", tn.ToString());

            tn.PublicKeyToken = null;
            Assert.AreEqual("SurveyEngine.DataTypeConverters.CalendarQuestionConstraintType, SurveyEngine.DataTypeConverters, Version=2.3.5.2, Culture=neutral", tn.ToString());

            tn.Culture = null;
            Assert.AreEqual("SurveyEngine.DataTypeConverters.CalendarQuestionConstraintType, SurveyEngine.DataTypeConverters, Version=2.3.5.2", tn.ToString());

            tn.Version = null;
            Assert.AreEqual("SurveyEngine.DataTypeConverters.CalendarQuestionConstraintType, SurveyEngine.DataTypeConverters", tn.ToString());

            tn.Assembly = null;
            Assert.AreEqual(string.Empty, tn.ToString());

            tn.Assembly = "SurveyEngine.DataTypeConverters";
            tn.Name = null;
            Assert.AreEqual(string.Empty, tn.ToString());

            tn.Name = "CalendarQuestionConstraintType";
            tn.Namespace = null;
            Assert.AreEqual(string.Empty, tn.ToString());
        }
开发者ID:ChadBurggraf,项目名称:llblgenprojectupdatetask,代码行数:34,代码来源:TypeNameTests.cs


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