/// <summary>
        /// Converts a member to text.
        /// Returns the declaration of the member as C# or VB code, e.g.
        /// "public void MemberName(string parameter)"
        /// </summary>
        static string GetText(IEntity entity)
        {
            IAmbience ambience = csharpAmbience;

            ambience.ConversionFlags = ConversionFlags.StandardConversionFlags;
            if (entity is ITypeDefinition)
            {
                // Show fully qualified Type name
                ambience.ConversionFlags |= ConversionFlags.UseFullyQualifiedTypeNames;
            }
            return(ambience.ConvertEntity(entity));
        }
        /// <summary>
        /// Converts a member to text.
        /// Returns the declaration of the member as C# or VB code, e.g.
        /// "public void MemberName(string parameter)"
        /// </summary>
        static string GetText(IEntity entity)
        {
            IAmbience ambience = csharpAmbience;

            ambience.ConversionFlags = ConversionFlags.StandardConversionFlags;
            if (entity is ITypeDefinition)
            {
                // Show fully qualified Type name
                ambience.ConversionFlags |= ConversionFlags.UseFullyQualifiedTypeNames;
            }
            if (entity is IMethod)
            {
                //if the method is an extension method we wanna see the whole method for the description
                //the original method (not reduced) can be obtained by calling ReducedFrom
                var reducedFromMethod = ((IMethod)entity).ReducedFrom;
                if (reducedFromMethod != null)
                {
                    entity = reducedFromMethod;
                }
            }
            return(ambience.ConvertEntity(entity));
        }
Esempio n. 3
0
 public static string PrintFullName(this IEntity entity)
 {
     return(amb.ConvertEntity(entity));
 }