protected override string GetEventString(IEvent evt, OutputSettings settings) { if (evt == null) { return(""); } var result = new StringBuilder(); AppendModifiers(result, settings, evt); if (settings.IncludeKeywords) { result.Append(settings.EmitKeyword("event")); } if (!settings.CompletionListFomat && settings.IncludeReturnType) { result.Append(GetTypeReferenceString(evt.ReturnType, settings)); result.Append(settings.Markup(" ")); } if (!settings.IncludeReturnType && settings.UseFullName) { result.Append(GetTypeReferenceString(evt.DeclaringTypeDefinition, new OutputSettings(OutputFlags.UseFullName))); result.Append(settings.Markup(".")); } AppendExplicitInterfaces(result, evt, settings); result.Append(settings.EmitName(evt, Format(FilterName(evt.Name)))); if (settings.CompletionListFomat && settings.IncludeReturnType) { result.Append(settings.Markup(" : ")); result.Append(GetTypeReferenceString(evt.ReturnType, settings)); } return(result.ToString()); }
protected override string GetParameterString(IParameterizedMember member, IParameter parameter, OutputSettings settings) { if (parameter == null) { return(""); } var result = new StringBuilder(); if (settings.IncludeParameterName) { if (settings.IncludeModifiers) { if (parameter.IsOut) { result.Append(settings.EmitKeyword("out")); } if (parameter.IsRef) { result.Append(settings.EmitKeyword("ref")); } if (parameter.IsParams) { result.Append(settings.EmitKeyword("params")); } } result.Append(GetTypeReferenceString(parameter.Type, settings)); result.Append(" "); if (settings.HighlightName) { result.Append(settings.EmitName(parameter, settings.Highlight(Format(FilterName(parameter.Name))))); } else { result.Append(settings.EmitName(parameter, Format(FilterName(parameter.Name)))); } } else { result.Append(GetTypeReferenceString(parameter.Type, settings)); } return(result.ToString()); }
public override string GetString(string nameSpace, OutputSettings settings) { var result = new StringBuilder(); if (settings.IncludeKeywords) { result.Append(settings.EmitKeyword("namespace")); } result.Append(Format(nameSpace)); return(result.ToString()); }