Exemplo n.º 1
0
        public sealed override bool Matches(MetadataName name)
        {
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }

            return(name.SymbolType == SymbolType.Method && Matches((MethodName)name));
        }
Exemplo n.º 2
0
        internal override MetadataName AddRight(MetadataName name)
        {
            var member = name as MemberName;

            if (member != null)
            {
                return(member.WithDeclaringType(this));
            }
            return(base.AddRight(name));
        }
Exemplo n.º 3
0
        public override bool Equals(object obj)
        {
            MetadataName other = obj as MetadataName;

            if (other == null)
            {
                return(false);
            }

            return(this.FullName == other.FullName);
        }
Exemplo n.º 4
0
 internal override MetadataName AddRight(MetadataName name)
 {
     if (name.SymbolType == SymbolType.Namespace)
     {
         return(NamespaceName.Parse(this + "." + name.FullName));
     }
     if (name.SymbolType == SymbolType.Type)
     {
         return(((TypeName)name).WithNamespace(this));
     }
     return(base.AddRight(name));
 }
Exemplo n.º 5
0
 public static MetadataName Combine(MetadataName name1, MetadataName name2)
 {
     if (name1 == null)
     {
         throw new ArgumentNullException("name1");
     }
     if (name2 == null)
     {
         throw new ArgumentNullException("name2");
     }
     return(name1.AddRight(name2));
 }
Exemplo n.º 6
0
        public sealed override bool Matches(MetadataName name)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }
            if (object.ReferenceEquals(this, name))
            {
                return(true);
            }

            return(name.SymbolType == SymbolType.Type && Matches((TypeName)name));
        }
Exemplo n.º 7
0
        public string Format(string format, MetadataName name, IFormatProvider formatProvider = null)
        {
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }

            var options = this.GetFormatHelper(formatProvider);

            if (string.IsNullOrEmpty(format))
            {
                format = options.DefaultFormatString[name.SymbolType] ?? "G";
            }

            return(name.Accept(this, format, options));
        }
Exemplo n.º 8
0
        private static string DefaultFormat(string format, MetadataName name)
        {
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }

            switch (GetBasicFormat(format))
            {
            case BasicFormat.Compact:
            case BasicFormat.Name:
            case BasicFormat.NameOverloads:
                return(name.Name);

            case BasicFormat.Full:
            case BasicFormat.Roundtrip:
            default:
                return(name.FullName);
            }
        }
Exemplo n.º 9
0
 internal virtual MetadataName AddRight(MetadataName name)
 {
     throw new NotSupportedException();
 }
Exemplo n.º 10
0
 public abstract bool Matches(MetadataName name);
Exemplo n.º 11
0
 public string Format(MetadataName name, IFormatProvider formatProvider = null)
 {
     return(Format(null, name, formatProvider));
 }