本文整理汇总了C#中Microsoft.CodeAnalysis.CSharp.Symbols.NamedTypeSymbol.GetTypeMember方法的典型用法代码示例。如果您正苦于以下问题:C# NamedTypeSymbol.GetTypeMember方法的具体用法?C# NamedTypeSymbol.GetTypeMember怎么用?C# NamedTypeSymbol.GetTypeMember使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.CodeAnalysis.CSharp.Symbols.NamedTypeSymbol
的用法示例。
在下文中一共展示了NamedTypeSymbol.GetTypeMember方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CommonTestInitialization
private void CommonTestInitialization()
{
_assembly = MetadataTestHelpers.GetSymbolsForReferences(
TestReferences.SymbolsTests.Metadata.DynamicAttributeLib,
TestReferences.NetFx.v4_0_30319.mscorlib)[0];
_base0Class = _assembly.Modules[0].GlobalNamespace.GetMember<NamedTypeSymbol>("Base0");
_base1Class = _assembly.Modules[0].GlobalNamespace.GetMember<NamedTypeSymbol>("Base1");
_base2Class = _assembly.Modules[0].GlobalNamespace.GetMember<NamedTypeSymbol>("Base2");
_derivedClass = _assembly.Modules[0].GlobalNamespace.GetMember<NamedTypeSymbol>("Derived");
_outerClass = _assembly.Modules[0].GlobalNamespace.GetMember<NamedTypeSymbol>("Outer");
_innerClass = _outerClass.GetTypeMember("Inner");
_innerInnerClass = _innerClass.GetTypeMember("InnerInner");
_outer2Class = _assembly.Modules[0].GlobalNamespace.GetMember<NamedTypeSymbol>("Outer2");
_inner2Class = _outer2Class.GetTypeMember("Inner2");
_innerInner2Class = _inner2Class.GetTypeMember("InnerInner2");
_outer3Class = _assembly.Modules[0].GlobalNamespace.GetMember<NamedTypeSymbol>("Outer3");
_inner3Class = _outer3Class.GetTypeMember("Inner3");
_objectType = _assembly.CorLibrary.GetSpecialType(SpecialType.System_Object);
_intType = _assembly.CorLibrary.GetSpecialType(SpecialType.System_Int32);
}
示例2: DynamicAttributeValidator
private DynamicAttributeValidator(CSharpCompilation compilation)
{
_comp = compilation;
_srcAssembly = compilation.SourceAssembly;
NamespaceSymbol globalNamespace = _srcAssembly.Modules[0].GlobalNamespace;
_base0Class = globalNamespace.GetMember<NamedTypeSymbol>("Base0");
_base1Class = globalNamespace.GetMember<NamedTypeSymbol>("Base1");
_base2Class = globalNamespace.GetMember<NamedTypeSymbol>("Base2");
_derivedClass = globalNamespace.GetMember<NamedTypeSymbol>("Derived");
_outerClass = globalNamespace.GetMember<NamedTypeSymbol>("Outer");
_innerClass = _outerClass.GetTypeMember("Inner");
_innerInnerClass = _innerClass.GetTypeMember("InnerInner");
_outer2Class = globalNamespace.GetMember<NamedTypeSymbol>("Outer2");
_inner2Class = _outer2Class.GetTypeMember("Inner2");
_innerInner2Class = _inner2Class.GetTypeMember("InnerInner2");
_outer3Class = globalNamespace.GetMember<NamedTypeSymbol>("Outer3");
_inner3Class = _outer3Class.GetTypeMember("Inner3");
_unsafeClass = globalNamespace.GetMember<NamedTypeSymbol>("UnsafeClass");
_structType = globalNamespace.GetMember<NamedTypeSymbol>("Struct");
_synthesizedMyDelegateType = globalNamespace.GetMember<NamedTypeSymbol>("MyDelegate");
_dynamicAttributeCtorNoArgs = (MethodSymbol)compilation.GetWellKnownTypeMember(WellKnownMember.System_Runtime_CompilerServices_DynamicAttribute__ctor);
_dynamicAttributeCtorTransformFlags = (MethodSymbol)compilation.GetWellKnownTypeMember(WellKnownMember.System_Runtime_CompilerServices_DynamicAttribute__ctorTransformFlags);
_expectedTransformFlags = null;
}