本文整理汇总了C#中Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.EENamedTypeSymbol.GetMembers方法的典型用法代码示例。如果您正苦于以下问题:C# EENamedTypeSymbol.GetMembers方法的具体用法?C# EENamedTypeSymbol.GetMembers怎么用?C# EENamedTypeSymbol.GetMembers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.EENamedTypeSymbol
的用法示例。
在下文中一共展示了EENamedTypeSymbol.GetMembers方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CompileAssignment
internal CommonPEModuleBuilder CompileAssignment(
string typeName,
string methodName,
ImmutableArray<Alias> aliases,
Microsoft.CodeAnalysis.CodeGen.CompilationTestData testData,
DiagnosticBag diagnostics,
out ResultProperties resultProperties)
{
var objectType = this.Compilation.GetSpecialType(SpecialType.System_Object);
var synthesizedType = new EENamedTypeSymbol(
Compilation.SourceModule.GlobalNamespace,
objectType,
_syntax,
_currentFrame,
typeName,
methodName,
this,
(method, diags) =>
{
var hasDisplayClassThis = _displayClassVariables.ContainsKey(GeneratedNames.ThisProxyFieldName());
var binder = ExtendBinderChain(
_syntax,
aliases,
method,
this.NamespaceBinder,
hasDisplayClassThis,
methodNotType: true);
return BindAssignment(binder, (ExpressionSyntax)_syntax, diags);
});
var module = CreateModuleBuilder(
this.Compilation,
synthesizedType.Methods,
additionalTypes: ImmutableArray.Create((NamedTypeSymbol)synthesizedType),
synthesizedType: synthesizedType,
testData: testData,
diagnostics: diagnostics);
Debug.Assert(module != null);
this.Compilation.Compile(
module,
win32Resources: null,
xmlDocStream: null,
emittingPdb: false,
diagnostics: diagnostics,
filterOpt: null,
cancellationToken: CancellationToken.None);
if (diagnostics.HasAnyErrors())
{
resultProperties = default(ResultProperties);
return null;
}
// Should be no name mangling since the caller provided explicit names.
Debug.Assert(synthesizedType.MetadataName == typeName);
Debug.Assert(synthesizedType.GetMembers()[0].MetadataName == methodName);
resultProperties = new ResultProperties(DkmClrCompilationResultFlags.PotentialSideEffect);
return module;
}
示例2: CompileExpression
internal CommonPEModuleBuilder CompileExpression(
InspectionContext inspectionContext,
string typeName,
string methodName,
Microsoft.CodeAnalysis.CodeGen.CompilationTestData testData,
DiagnosticBag diagnostics,
out ResultProperties resultProperties)
{
Debug.Assert(inspectionContext != null);
var properties = default(ResultProperties);
var objectType = this.Compilation.GetSpecialType(SpecialType.System_Object);
var synthesizedType = new EENamedTypeSymbol(
this.Compilation.SourceModule.GlobalNamespace,
objectType,
_syntax,
_currentFrame,
typeName,
methodName,
this,
(method, diags) =>
{
var hasDisplayClassThis = _displayClassVariables.ContainsKey(GeneratedNames.ThisProxyFieldName());
var binder = ExtendBinderChain(
inspectionContext,
this.Compilation,
_metadataDecoder,
_syntax,
method,
this.NamespaceBinder,
hasDisplayClassThis,
_methodNotType);
var statementSyntax = _syntax as StatementSyntax;
return (statementSyntax == null) ?
BindExpression(binder, (ExpressionSyntax)_syntax, diags, out properties) :
BindStatement(binder, statementSyntax, diags, out properties);
});
var module = CreateModuleBuilder(
this.Compilation,
synthesizedType.Methods,
additionalTypes: ImmutableArray.Create((NamedTypeSymbol)synthesizedType),
testData: testData,
diagnostics: diagnostics);
Debug.Assert(module != null);
this.Compilation.Compile(
module,
win32Resources: null,
xmlDocStream: null,
generateDebugInfo: false,
diagnostics: diagnostics,
filterOpt: null,
cancellationToken: CancellationToken.None);
if (diagnostics.HasAnyErrors())
{
resultProperties = default(ResultProperties);
return null;
}
// Should be no name mangling since the caller provided explicit names.
Debug.Assert(synthesizedType.MetadataName == typeName);
Debug.Assert(synthesizedType.GetMembers()[0].MetadataName == methodName);
resultProperties = properties;
return module;
}