Esempio n. 1
0
 public bool Equals(GenericArgumentNode other)
 {
     return(other != null &&
            ArgumentType == other.ArgumentType &&
            Parent == other.Parent &&
            CompareUtil.ListEquals(children, other.children));
 }
Esempio n. 2
0
 private StringBuilder AppendChild(StringBuilder builder, GenericArgumentNode node, bool fullname, byte depth)
 {
     builder.AppendLine().AppendIndent(depth, "  ");
     AppendNode(builder, node, fullname);
     foreach (var child in node.Children)
     {
         AppendChild(builder, child, fullname, (byte)(depth + 1));
     }
     return(builder);
 }
Esempio n. 3
0
        public GenericArgumentNode(Type argumentType, GenericArgumentNode parent = null)
        {
            Ensure.Argument.NotNull(argumentType, "argumentType");

            ArgumentType = argumentType;
            Parent       = parent;

            if (argumentType.IsGenericType)
            {
                children = ArgumentType.GetGenericArguments()
                           .Select(a => new GenericArgumentNode(a, this))
                           .ToArray();
            }
        }
Esempio n. 4
0
 private static StringBuilder AppendNode(StringBuilder builder, GenericArgumentNode node, bool fullname)
 {
     return(builder.Append(node.GetType().GetName(fullname))
            .AppendFormat("({0})", node.ArgumentType.GetName(fullname)));
 }