本文整理汇总了C#中IEventSymbol类的典型用法代码示例。如果您正苦于以下问题:C# IEventSymbol类的具体用法?C# IEventSymbol怎么用?C# IEventSymbol使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IEventSymbol类属于命名空间,在下文中一共展示了IEventSymbol类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: GetEventMarkup
// public TooltipInformation GetAliasedNamespaceTooltip (AliasNamespaceResolveResult resolveResult)
// {
// var result = new TooltipInformation ();
// result.SignatureMarkup = GetMarkup (resolveResult.Namespace);
// result.AddCategory (GettextCatalog.GetString ("Alias information"), GettextCatalog.GetString ("Resolved using alias '{0}'", resolveResult.Alias));
// return result;
// }
//
// public TooltipInformation GetAliasedTypeTooltip (AliasTypeResolveResult resolveResult)
// {
// var result = new TooltipInformation ();
// result.SignatureMarkup = GetTypeMarkup (resolveResult.Type, true);
// result.AddCategory (GettextCatalog.GetString ("Alias information"), GettextCatalog.GetString ("Resolved using alias '{0}'", resolveResult.Alias));
// return result;
// }
string GetEventMarkup (IEventSymbol evt)
{
if (evt == null)
throw new ArgumentNullException ("evt");
var result = new StringBuilder ();
AppendModifiers (result, evt);
result.Append (Highlight ("event ", colorStyle.KeywordModifiers));
result.Append (GetTypeReferenceString (evt.Type));
if (BreakLineAfterReturnType) {
result.AppendLine ();
} else {
result.Append (" ");
}
AppendExplicitInterfaces (result, evt.ExplicitInterfaceImplementations.Cast<ISymbol> ());
result.Append (HighlightSemantically (FilterEntityName (evt.Name), colorStyle.UserEventDeclaration));
return result.ToString ();
}
开发者ID:kdubau,项目名称:monodevelop,代码行数:34,代码来源:SignatureMarkupCreator.cs
示例17: HaveSameReturnType
private bool HaveSameReturnType(IEventSymbol ev1, IEventSymbol ev2)
{
return this.SignatureTypeEquivalenceComparer.Equals(ev1.Type, ev2.Type);
}
开发者ID:riversky,项目名称:roslyn,代码行数:4,代码来源:SignatureComparer.cs
示例18: GetEventPrototype
private string GetEventPrototype(IEventSymbol symbol, PrototypeFlags flags)
{
if ((flags & PrototypeFlags.Signature) != 0)
{
if (flags != PrototypeFlags.Signature)
{
// vsCMPrototypeUniqueSignature can't be combined with anything else.
throw Exceptions.ThrowEInvalidArg();
}
// The unique signature is simply the node key.
flags = PrototypeFlags.FullName | PrototypeFlags.Type;
}
var builder = new StringBuilder();
AppendEventPrototype(builder, symbol, flags, symbol.Name);
return builder.ToString();
}
开发者ID:Rickinio,项目名称:roslyn,代码行数:20,代码来源:CSharpCodeModelService_Prototype.cs
示例19: Create
public static void Create(IEventSymbol symbol, SymbolKeyWriter visitor)
{
visitor.WriteString(symbol.MetadataName);
visitor.WriteSymbolKey(symbol.ContainingType);
}
开发者ID:Rickinio,项目名称:roslyn,代码行数:5,代码来源:SymbolKey.EventSymbolKey.cs
示例20: AppendEventPrototype
private void AppendEventPrototype(StringBuilder builder, IEventSymbol symbol, PrototypeFlags flags, string baseName)
{
if ((flags & PrototypeFlags.Type) != 0)
{
builder.Append(GetAsStringForCodeTypeRef(symbol.Type));
if ((flags & PrototypeFlags.NameMask) != PrototypeFlags.NoName)
{
builder.Append(' ');
}
}
switch (flags & PrototypeFlags.NameMask)
{
case PrototypeFlags.FullName:
AppendTypeNamePrototype(builder, includeNamespaces: true, includeGenerics: false, symbol: symbol.ContainingSymbol);
builder.Append('.');
goto case PrototypeFlags.BaseName;
case PrototypeFlags.TypeName:
AppendTypeNamePrototype(builder, includeNamespaces: false, includeGenerics: true, symbol: symbol.ContainingSymbol);
builder.Append('.');
goto case PrototypeFlags.BaseName;
case PrototypeFlags.BaseName:
builder.Append(baseName);
break;
}
}
开发者ID:Rickinio,项目名称:roslyn,代码行数:29,代码来源:CSharpCodeModelService_Prototype.cs
注:本文中的IEventSymbol类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论