Files
2026-08-27 10:56:38 -06:00

60 lines
3.1 KiB
C#

using System.Threading;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis.CSharp.Symbols;
internal sealed class SourceCustomEventAccessorSymbol : SourceEventAccessorSymbol
{
public override Accessibility DeclaredAccessibility => AssociatedSymbol.DeclaredAccessibility;
public override bool IsImplicitlyDeclared => false;
internal override bool GenerateDebugInfo => true;
internal SourceCustomEventAccessorSymbol(SourceEventSymbol @event, AccessorDeclarationSyntax syntax, EventSymbol explicitlyImplementedEventOpt, string aliasQualifierOpt, bool isNullableAnalysisEnabled, BindingDiagnosticBag diagnostics)
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_009d: Unknown result type (might be due to invalid IL or missing references)
//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
SyntaxReference reference = syntax.GetReference();
SyntaxToken val = syntax.Keyword;
base._002Ector(@event, reference, ((SyntaxToken)(ref val)).GetLocation(), explicitlyImplementedEventOpt, aliasQualifierOpt, syntax.Kind() == SyntaxKind.AddAccessorDeclaration, SyntaxFacts.HasYieldOperations((SyntaxNode?)(object)syntax.Body), isNullableAnalysisEnabled, syntax != null && syntax.Body == null && syntax.ExpressionBody != null);
CheckFeatureAvailabilityAndRuntimeSupport((SyntaxNode)(object)syntax, base.Location, hasBody: true, diagnostics);
if ((syntax.Body != null || syntax.ExpressionBody != null) && IsExtern && !IsAbstract)
{
diagnostics.Add(ErrorCode.ERR_ExternHasBody, base.Location, this);
}
SyntaxTokenList modifiers = syntax.Modifiers;
if (((SyntaxTokenList)(ref modifiers)).Count > 0)
{
modifiers = syntax.Modifiers;
val = ((SyntaxTokenList)(ref modifiers))[0];
diagnostics.Add(ErrorCode.ERR_NoModifiersOnAccessor, ((SyntaxToken)(ref val)).GetLocation());
}
Symbol.CheckForBlockAndExpressionBody(syntax.Body, syntax.ExpressionBody, syntax, diagnostics);
}
internal AccessorDeclarationSyntax GetSyntax()
{
return (AccessorDeclarationSyntax)(object)syntaxReferenceOpt.GetSyntax(default(CancellationToken));
}
internal override ExecutableCodeBinder TryGetBodyBinder(BinderFactory binderFactoryOpt = null, bool ignoreAccessibility = false)
{
return TryGetBodyBinderFromSyntax(binderFactoryOpt, ignoreAccessibility);
}
internal override OneOrMany<SyntaxList<AttributeListSyntax>> GetAttributeDeclarations()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
return OneOrMany.Create<SyntaxList<AttributeListSyntax>>(GetSyntax().AttributeLists);
}
}