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


C# IEventSymbol类代码示例

本文整理汇总了C#中IEventSymbol的典型用法代码示例。如果您正苦于以下问题:C# IEventSymbol类的具体用法?C# IEventSymbol怎么用?C# IEventSymbol使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: CreateEventSymbol

 /// <summary>
 /// Creates an event symbol that can be used to describe an event declaration.
 /// </summary>
 public static IEventSymbol CreateEventSymbol(
     IList<AttributeData> attributes, Accessibility accessibility,
     DeclarationModifiers modifiers, ITypeSymbol type,
     IEventSymbol explicitInterfaceSymbol, string name,
     IMethodSymbol addMethod = null, IMethodSymbol removeMethod = null, IMethodSymbol raiseMethod = null)
 {
     var result = new CodeGenerationEventSymbol(null, attributes, accessibility, modifiers, type, explicitInterfaceSymbol, name, addMethod, removeMethod, raiseMethod);
     CodeGenerationEventInfo.Attach(result, modifiers.IsUnsafe);
     return result;
 }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:13,代码来源:CodeGenerationSymbolFactory.cs

示例2: ReadSymbol

 protected override void ReadSymbol(IEventSymbol eventSymbol)
 {
     var @event = new Event(eventSymbol.Type, eventSymbol.Name)
     {
         IsAbstract = eventSymbol.IsAbstract,
         IsOverride = eventSymbol.IsOverride,
         IsInternal = eventSymbol.DeclaredAccessibility.HasFlag(Accessibility.Internal),
         Documentation = new DocumentationComment(eventSymbol.GetDocumentationCommentXml())
     };
     _events.AddEvent(@event);
 }
开发者ID:pgenfer,项目名称:mixinSharp,代码行数:11,代码来源:EventSymbolReader.cs

示例3: VisitEvent

 public override void VisitEvent(IEventSymbol symbol)
 {
     if (_finished || _symbolPredicate == null || _symbolPredicate(symbol))
     {
         AddDocumentForMember(symbol, true, new[]
         {
             Metadata.Create(MetadataKeys.SpecificKind, (k, m) => symbol.Kind.ToString()),
             Metadata.Create(MetadataKeys.Type, DocumentFor(symbol.Type)),
             Metadata.Create(MetadataKeys.Overridden, DocumentFor(symbol.OverriddenEvent))
         });
     }
 }
开发者ID:st1pps,项目名称:Wyam,代码行数:12,代码来源:AnalyzeSymbolVisitor.cs

示例4: GetParsedEvent

        private SDEvent GetParsedEvent(IEventSymbol eve)
        {
            var sdEvent = new SDEvent(eve.GetIdentifier())
            {
                Name = eve.Name,
                DeclaringType = _typeRefParser.GetParsedTypeReference(eve.ContainingType),
                Accessibility = eve.DeclaredAccessibility.ToString().ToLower(),
                Documentations = DocumentationParser.ParseDocumentation(eve)
            };

            ParserOptions.SDRepository.AddMember(sdEvent);
            return sdEvent;
        }
开发者ID:Geaz,项目名称:sharpDox,代码行数:13,代码来源:EventParser.cs

示例5: AddEventTo

        internal static CompilationUnitSyntax AddEventTo(
            CompilationUnitSyntax destination,
            IEventSymbol @event,
            CodeGenerationOptions options,
            IList<bool> availableIndices)
        {
            var declaration = GenerateEventDeclaration(@event, CodeGenerationDestination.CompilationUnit, options);

            // Place the event depending on its shape.  Field style events go with fields, property
            // style events go with properties.  If there 
            var members = Insert(destination.Members, declaration, options, availableIndices,
                after: list => AfterMember(list, declaration), before: list => BeforeMember(list, declaration));
            return destination.WithMembers(members.ToSyntaxList());
        }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:14,代码来源:EventGenerator.cs

示例6: AddEventTo

        internal static TypeDeclarationSyntax AddEventTo(
            TypeDeclarationSyntax destination,
            IEventSymbol @event,
            CodeGenerationOptions options,
            IList<bool> availableIndices)
        {
            var declaration = GenerateEventDeclaration(@event, GetDestination(destination), options);

            var members = Insert(destination.Members, declaration, options, availableIndices,
                after: list => AfterMember(list, declaration), before: list => BeforeMember(list, declaration));

            // Find the best place to put the field.  It should go after the last field if we already
            // have fields, or at the beginning of the file if we don't.

            return AddMembersTo(destination, members);
        }
开发者ID:EkardNT,项目名称:Roslyn,代码行数:16,代码来源:EventGenerator.cs

示例7: GetParsedEvent

        private SDEvent GetParsedEvent(IEventSymbol eve)
        {
            var syntaxReference = eve.DeclaringSyntaxReferences.Any() ? eve.DeclaringSyntaxReferences.Single() : null;
            var sdEvent = new SDEvent(eve.GetIdentifier())
            {
                Name = eve.Name,
                DeclaringType = _typeRefParser.GetParsedTypeReference(eve.ContainingType),
                Accessibility = eve.DeclaredAccessibility.ToString().ToLower(),
                Documentations = DocumentationParser.ParseDocumentation(eve),
                Region = syntaxReference != null ? new SDRegion
                {
                    Start = syntaxReference.Span.Start,
                    StartLine = syntaxReference.SyntaxTree.GetLineSpan(syntaxReference.Span).StartLinePosition.Line + 1,
                    EndLine = syntaxReference.SyntaxTree.GetLineSpan(syntaxReference.Span).EndLinePosition.Line + 1,
                    End = syntaxReference.Span.End,
                    FilePath = syntaxReference.SyntaxTree.FilePath,
                    Filename = Path.GetFileName(syntaxReference.SyntaxTree.FilePath)
                } : null
            };

            ParserOptions.SDRepository.AddMember(sdEvent);
            return sdEvent;
        }
开发者ID:Geaz,项目名称:sharpDox,代码行数:23,代码来源:EventParser.cs

示例8: GetIsUnsafe

 public static bool GetIsUnsafe(IEventSymbol @event)
 {
     return GetIsUnsafe(GetInfo(@event));
 }
开发者ID:RoryVL,项目名称:roslyn,代码行数:4,代码来源:CodeGenerationEventInfo.cs

示例9: Attach

 public static void Attach(IEventSymbol @event, bool isUnsafe)
 {
     var info = new CodeGenerationEventInfo(isUnsafe);
     s_eventToInfoMap.Add(@event, info);
 }
开发者ID:RoryVL,项目名称:roslyn,代码行数:5,代码来源:CodeGenerationEventInfo.cs

示例10: GetEiiContainerTypeName

 private static string GetEiiContainerTypeName(IEventSymbol symbol, IFilterVisitor filterVisitor)
 {
     if (symbol.ExplicitInterfaceImplementations.Length == 0)
     {
         return null;
     }
     for (int i = 0; i < symbol.ExplicitInterfaceImplementations.Length; i++)
     {
         if (filterVisitor.CanVisitApi(symbol.ExplicitInterfaceImplementations[i]))
         {
             return NameVisitorCreator.GetCSharp(NameOptions.UseAlias | NameOptions.WithGenericParameter).GetName(symbol.ExplicitInterfaceImplementations[i].ContainingType);
         }
     }
     Debug.Fail("Should not be here!");
     return null;
 }
开发者ID:dotnet,项目名称:docfx,代码行数:16,代码来源:CSYamlModelGenerator.cs

示例11: GetEventSyntax

 private string GetEventSyntax(IEventSymbol symbol, IFilterVisitor filterVisitor)
 {
     ExplicitInterfaceSpecifierSyntax eii = null;
     if (symbol.ExplicitInterfaceImplementations.Length > 0)
     {
         eii = SyntaxFactory.ExplicitInterfaceSpecifier(SyntaxFactory.ParseName(GetEiiContainerTypeName(symbol, filterVisitor)));
     }
     return RemoveBraces(
         SyntaxFactory.EventDeclaration(
             GetAttributes(symbol, filterVisitor),
             SyntaxFactory.TokenList(GetMemberModifiers(symbol)),
             SyntaxFactory.Token(SyntaxKind.EventKeyword),
             GetTypeSyntax(symbol.Type),
             eii,
             SyntaxFactory.Identifier(GetMemberName(symbol, filterVisitor)),
             SyntaxFactory.AccessorList()
         ).NormalizeWhitespace().ToString()
     );
 }
开发者ID:dotnet,项目名称:docfx,代码行数:19,代码来源:CSYamlModelGenerator.cs

示例12: GetMemberModifiers

 private static IEnumerable<SyntaxToken> GetMemberModifiers(IEventSymbol symbol)
 {
     if (symbol.ContainingType.TypeKind != TypeKind.Interface)
     {
         switch (symbol.DeclaredAccessibility)
         {
             case Accessibility.Protected:
             case Accessibility.ProtectedOrInternal:
                 yield return SyntaxFactory.Token(SyntaxKind.ProtectedKeyword);
                 break;
             case Accessibility.Public:
                 yield return SyntaxFactory.Token(SyntaxKind.PublicKeyword);
                 break;
             case Accessibility.ProtectedAndInternal:
             case Accessibility.Internal:
             case Accessibility.Private:
             default:
                 break;
         }
     }
     if (symbol.IsStatic)
     {
         yield return SyntaxFactory.Token(SyntaxKind.StaticKeyword);
     }
     if (symbol.IsAbstract && symbol.ContainingType.TypeKind != TypeKind.Interface)
     {
         yield return SyntaxFactory.Token(SyntaxKind.AbstractKeyword);
     }
     if (symbol.IsVirtual)
     {
         yield return SyntaxFactory.Token(SyntaxKind.VirtualKeyword);
     }
     if (symbol.IsOverride)
     {
         yield return SyntaxFactory.Token(SyntaxKind.OverrideKeyword);
     }
     if (symbol.IsSealed)
     {
         yield return SyntaxFactory.Token(SyntaxKind.SealedKeyword);
     }
 }
开发者ID:dotnet,项目名称:docfx,代码行数:41,代码来源:CSYamlModelGenerator.cs

示例13: HaveSameSignature

 private bool HaveSameSignature(IEventSymbol event1, IEventSymbol event2, bool caseSensitive)
 {
     return IdentifiersMatch(event1.Name, event2.Name, caseSensitive);
 }
开发者ID:riversky,项目名称:roslyn,代码行数:4,代码来源:SignatureComparer.cs

示例14: CreateEventSymbol

 internal static IEventSymbol CreateEventSymbol(
     IEventSymbol @event,
     IList<AttributeData> attributes = null,
     Accessibility? accessibility = null,
     DeclarationModifiers? modifiers = null,
     IEventSymbol explicitInterfaceSymbol = null,
     string name = null,
     IMethodSymbol addMethod = null,
     IMethodSymbol removeMethod = null)
 {
     return CodeGenerationSymbolFactory.CreateEventSymbol(
         attributes,
         accessibility ?? @event.DeclaredAccessibility,
         modifiers ?? @event.GetSymbolModifiers(),
         @event.Type,
         explicitInterfaceSymbol,
         name ?? @event.Name,
         addMethod,
         removeMethod);
 }
开发者ID:RoryVL,项目名称:roslyn,代码行数:20,代码来源:CodeGenerationSymbolFactory.cs

示例15: WrappedEventSymbol

 public WrappedEventSymbol(IEventSymbol eventSymbol, bool canImplementImplicitly, IDocumentationCommentFormattingService docCommentFormattingService)
     : base(eventSymbol, canImplementImplicitly, docCommentFormattingService)
 {
     _symbol = eventSymbol;
 }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:5,代码来源:AbstractMetadataAsSourceService.WrappedEventSymbol.cs


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