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


C# OutputSettings.EmitKeyword方法代码示例

本文整理汇总了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 ();
 }
开发者ID:Kalnor,项目名称:monodevelop,代码行数:7,代码来源:NetAmbience.cs

示例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 ();
		}
开发者ID:txdv,项目名称:monodevelop,代码行数:31,代码来源:CSharpAmbience.cs

示例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 ();
		}
开发者ID:txdv,项目名称:monodevelop,代码行数:27,代码来源:CSharpAmbience.cs

示例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 ();
        }
开发者ID:Kalnor,项目名称:monodevelop,代码行数:23,代码来源:NetAmbience.cs

示例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 ();
 }
开发者ID:Kalnor,项目名称:monodevelop,代码行数:13,代码来源:NetAmbience.cs

示例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 ();
        }
开发者ID:Kalnor,项目名称:monodevelop,代码行数:40,代码来源:NetAmbience.cs

示例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 ();
        }
开发者ID:Kalnor,项目名称:monodevelop,代码行数:28,代码来源:NetAmbience.cs

示例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 ();
        }
开发者ID:Kalnor,项目名称:monodevelop,代码行数:25,代码来源:NetAmbience.cs

示例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 ();
        }
开发者ID:Kalnor,项目名称:monodevelop,代码行数:16,代码来源:NetAmbience.cs

示例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 ();
        }
开发者ID:Kalnor,项目名称:monodevelop,代码行数:16,代码来源:NetAmbience.cs

示例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 ();
 }
开发者ID:Kalnor,项目名称:monodevelop,代码行数:7,代码来源:NetAmbience.cs


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