コード例 #1
0
ファイル: MemberHelper.cs プロジェクト: VE-2016/VE-2016
        /// <summary>
        /// Returns a C#-like string that corresponds to the signature of the given event definition and that conforms to the specified formatting options.
        /// </summary>
        //^ [Pure]
        public virtual string GetEventSignature(IEventDefinition eventDef, NameFormattingOptions formattingOptions)
        {
            string result = eventDef.Name.Value;

            if ((formattingOptions & NameFormattingOptions.OmitContainingType) == 0)
            {
                result = _typeNameFormatter.GetTypeName(eventDef.ContainingType, formattingOptions) + "." + result;
            }
            return(result);
        }
コード例 #2
0
ファイル: TypeExtensions.cs プロジェクト: safern/buildtools
        public static string GetTypeName(this ITypeReference type, NameFormattingOptions options)
        {
            TypeNameFormatter formatter = new TypeNameFormatter();
            string            name      = formatter.GetTypeName(type, options);

            return(name);
        }
コード例 #3
0
ファイル: TypeExtensions.cs プロジェクト: safern/buildtools
        public static string GetTypeName(this ITypeReference type, bool includeNamespace = true)
        {
            TypeNameFormatter     formatter = new TypeNameFormatter();
            NameFormattingOptions options   = NameFormattingOptions.OmitTypeArguments | NameFormattingOptions.UseReflectionStyleForNestedTypeNames;

            if (!includeNamespace)
            {
                options |= NameFormattingOptions.OmitContainingNamespace;
            }

            string name = formatter.GetTypeName(type, options);

            return(name);
        }
コード例 #4
0
 /// <summary>
 /// Returns an easy-to-read type name from the specified Type
 /// </summary>
 /// <param name="type"></param>
 /// <returns></returns>
 public static string GetTypeName(this Type type)
 {
     return(_typeNameFormatter.GetTypeName(type));
 }
コード例 #5
0
 public string GetTypeSignature(ITypeReference type)
 {
     return(_formatter.GetTypeName(type, (FormatOpts & ~NameFormattingOptions.OmitContainingType)));
 }