예제 #1
0
        public MetadataNameFormat Clone()
        {
            MetadataNameFormat result = (MetadataNameFormat)MemberwiseClone();

            result.IsReadOnly = false;
            return(result);
        }
예제 #2
0
        static MetadataNameFormat CreateDefault()
        {
            var result = new MetadataNameFormat(false);

            result.MakeReadOnly();
            return(result);
        }
예제 #3
0
 public string ToString(MetadataNameFormat format)
 {
     if (format == null)
     {
         return(ToString());
     }
     return(format.Format(null, this, null));
 }
예제 #4
0
 internal override string Accept(MetadataNameFormat formatter, string format, IFormatProvider provider)
 {
     if (IsReturnParameter)
     {
         throw new NotImplementedException();
     }
     return(formatter.FormatParameter(format, this, provider));
 }
            protected internal override string FormatGenericInstanceType(string format, GenericInstanceTypeName name, IFormatProvider formatProvider)
            {
                string             nameWithoutMangle = Regex.Replace(name.ElementType.FullName, @"`\d", string.Empty);
                MetadataNameFormat options           = this.GetFormatHelper(formatProvider);

                StringBuilder sb = new StringBuilder(nameWithoutMangle);

                options.PrintGenericArgs(sb, name.GenericArguments);
                return(sb.ToString());
            }
예제 #6
0
        public MetadataNameFormat(MetadataNameFormat options)
        {
            if (options == null)
            {
                options = MetadataNameFormat.Default;
            }

            DefaultFormatString.CopyBuffer(options.DefaultFormatString);
            _includeAttributes      = options.IncludeAttributes.Clone();
            _includeModifiers       = options.IncludeModifiers.Clone();
            _includeReturnTypes     = options.IncludeReturnTypes.Clone();
            _includeTypeConstraints = options.IncludeTypeConstraints;
            _includeTypeParameters  = options.IncludeTypeParameters;
            _includeVariance        = options.IncludeVariance;
        }
예제 #7
0
        private static string ComputeMethodDeclName(BasicFormat f,
                                                    MethodName name,
                                                    MetadataNameFormat formatProvider)
        {
            switch (f)
            {
            case BasicFormat.Compact:
                return(CompactFormat.FormatMethod(null, name, formatProvider));

            case BasicFormat.Name:
                return(name.Name);

            case BasicFormat.NameOverloads:
                return(NameOverloadsFormat.FormatMethod(null, name, formatProvider));

            case BasicFormat.Full:
                return(FullNameFormat.FormatMethod(null, name, formatProvider));

            case BasicFormat.Roundtrip:
            default:
                return(RoundtrippableFormat.FormatMethod(null, name, formatProvider));
            }
        }
 internal override string Accept(MetadataNameFormat formatter, string format, IFormatProvider provider)
 {
     return(formatter.FormatGenericInstanceType(format, this, provider));
 }
예제 #9
0
 internal override string Accept(MetadataNameFormat formatter, string format, IFormatProvider provider)
 {
     return(formatter.FormatAssembly(format, this, provider));
 }
예제 #10
0
 internal abstract string Accept(MetadataNameFormat formatter,
                                 string format,
                                 IFormatProvider provider);
예제 #11
0
 internal sealed override string Accept(MetadataNameFormat formatter, string format, IFormatProvider provider)
 {
     return(formatter.FormatGenericParameter(format, this, provider));
 }
 internal override string Accept(MetadataNameFormat formatter, string format, IFormatProvider provider)
 {
     return(formatter.FormatFunctionPointerType(format, this, provider));
 }