本文整理汇总了C#中MonoDevelop.Ide.TypeSystem.OutputSettings.EmitKeyword方法的典型用法代码示例。如果您正苦于以下问题:C# OutputSettings.EmitKeyword方法的具体用法?C# OutputSettings.EmitKeyword怎么用?C# OutputSettings.EmitKeyword使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MonoDevelop.Ide.TypeSystem.OutputSettings
的用法示例。
在下文中一共展示了OutputSettings.EmitKeyword方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetString
public override string GetString(string nameSpace, OutputSettings settings)
{
var result = new StringBuilder ();
result.Append (settings.EmitKeyword ("Namespace"));
result.Append (Format (nameSpace));
return result.ToString ();
}
示例2: GetParameterString
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 ();
}
示例3: GetEventString
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 ();
}
示例4: GetConstructorString
protected override string GetConstructorString(IMethod method, OutputSettings settings)
{
var result = new StringBuilder ();
if (settings.IncludeModifiers)
AppendModifiers (result, settings, method);
result.Append (settings.EmitKeyword ("Constructor"));
result.Append (settings.EmitName (method, method.DeclaringType.Name));
if (settings.IncludeParameters) {
result.Append (settings.Markup ("("));
bool first = true;
foreach (var parameter in method.Parameters) {
if (!first)
result.Append (settings.Markup (", "));
result.Append (GetParameterString (method, parameter, settings));
first = false;
}
result.Append (settings.Markup (")"));
}
return result.ToString ();
}
示例5: GetPropertyString
protected override string GetPropertyString(IProperty property, OutputSettings settings)
{
var result = new StringBuilder ();
if (settings.IncludeModifiers)
AppendModifiers (result, settings, property);
result.Append (settings.EmitKeyword ("Property"));
result.Append (settings.EmitName (property, property.Name));
if (settings.IncludeReturnType) {
result.Append (settings.Markup (" : "));
result.Append (GetTypeReferenceString (property.ReturnType, settings));
}
return result.ToString ();
}
示例6: GetTypeString
protected override string GetTypeString(IType t, OutputSettings settings)
{
ITypeDefinition type = t.GetDefinition ();
var result = new StringBuilder ();
if (settings.IncludeModifiers)
AppendModifiers (result, settings, type);
if (settings.IncludeKeywords)
result.Append (settings.EmitKeyword (GetString (type.Kind)));
result.Append (settings.EmitName (type, settings.UseFullName ? type.FullName : type.Name));
int parameterCount = type.TypeParameters.Count;
if (settings.IncludeGenerics && parameterCount > 0) {
result.Append (settings.Markup ("<"));
if (!settings.HideGenericParameterNames) {
for (int i = 0; i < parameterCount; i++) {
if (i > 0)
result.Append (settings.Markup (", "));
result.Append (type.TypeParameters [i].Name);
}
}
result.Append (settings.Markup (">"));
}
if (settings.IncludeBaseTypes && type.DirectBaseTypes.Any ()) {
result.Append (settings.Markup (" : "));
bool first = true;
foreach (var baseType in type.DirectBaseTypes) {
if (baseType.Equals (type.Compilation.FindType (KnownTypeCode.Object)))
continue;
if (!first)
result.Append (settings.Markup (", "));
first = false;
result.Append (GetTypeReferenceString (baseType, settings));
}
}
return result.ToString ();
}
示例7: GetOperatorString
protected override string GetOperatorString(IMethod method, OutputSettings settings)
{
var result = new StringBuilder ();
if (settings.IncludeModifiers)
AppendModifiers (result, settings, method);
result.Append (settings.EmitKeyword ("Operator"));
result.Append (settings.EmitName (method, settings.UseFullName ? method.FullName : method.Name));
if (settings.IncludeParameters) {
result.Append (settings.Markup ("("));
bool first = true;
foreach (var parameter in method.Parameters) {
if (!first)
result.Append (settings.Markup (", "));
result.Append (GetParameterString (method, parameter, settings));
first = false;
}
result.Append (settings.Markup (")"));
}
if (settings.IncludeReturnType) {
result.Append (settings.Markup (" : "));
result.Append (GetTypeReferenceString (method.ReturnType, settings));
}
return result.ToString ();
}
示例8: GetIndexerString
protected override string GetIndexerString(IProperty property, OutputSettings settings)
{
var result = new StringBuilder ();
if (settings.IncludeModifiers)
AppendModifiers (result, settings, property);
result.Append (settings.EmitKeyword ("Indexer"));
result.Append (settings.EmitName (property, property.Name));
if (settings.IncludeParameters && property.Parameters.Count > 0) {
result.Append (settings.Markup ("("));
bool first = true;
foreach (var parameter in property.Parameters) {
if (!first)
result.Append (settings.Markup (", "));
result.Append (GetParameterString (property, parameter, settings));
first = false;
}
result.Append (settings.Markup (")"));
}
if (settings.IncludeReturnType) {
result.Append (settings.Markup (" : "));
result.Append (GetTypeReferenceString (property.ReturnType, settings));
}
return result.ToString ();
}
示例9: GetFieldString
protected override string GetFieldString(IField field, OutputSettings settings)
{
var result = new StringBuilder ();
if (settings.IncludeModifiers)
AppendModifiers (result, settings, field);
result.Append (settings.EmitKeyword ("Field"));
result.Append (settings.EmitName (field, field.Name));
if (settings.IncludeReturnType) {
result.Append (settings.Markup (" : "));
result.Append (GetTypeReferenceString (field.ReturnType, settings));
}
return result.ToString ();
}
示例10: GetEventString
protected override string GetEventString(IEvent evt, OutputSettings settings)
{
var result = new StringBuilder ();
if (settings.IncludeModifiers)
AppendModifiers (result, settings, evt);
result.Append (settings.EmitKeyword ("Event"));
result.Append (settings.EmitName (evt, evt.Name));
if (settings.IncludeReturnType) {
result.Append (settings.Markup (" : "));
result.Append (GetTypeReferenceString (evt.ReturnType, settings));
}
return result.ToString ();
}
示例11: GetDestructorString
protected override string GetDestructorString(IMethod method, OutputSettings settings)
{
var result = new StringBuilder ();
result.Append (settings.EmitKeyword ("Destructor"));
result.Append (settings.EmitName (method, method.DeclaringType.Name));
return result.ToString ();
}