本文整理汇总了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;
}
示例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);
}
示例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());
}