11 private readonly
Type type;
12 private readonly
object[] arguments;
36 public override bool Equals(
object obj)
41 this.type != Key.type ||
42 (
this.arguments is
null) ^ (Key.arguments is
null) ||
43 (c =
this.arguments?.Length ?? 0) != (Key.arguments?.Length ?? 0))
48 for (i = 0; i < c; i++)
50 if (!this.arguments[i].
Equals(Key.arguments[i]))
60 int Result = this.type.GetHashCode();
62 if (!(this.arguments is
null))
64 foreach (
object Obj
in this.arguments)
65 Result ^= Result << 5 ^ (Obj?.GetHashCode() ?? 0);
74 StringBuilder sb =
new StringBuilder();
77 sb.Append(this.type.FullName);
80 for (i = 0, c = this.arguments?.Length ?? 0; i < c; i++)
85 if (this.arguments[i] is
null)
88 sb.Append(this.arguments[i].GetType().FullName);
Represents a type and a set of arguments, for which an object instance is the single instantiation.
override int GetHashCode()
SingletonKey(Type Type, object[] Arguments)
Represents a type and a set of arguments, for which an object instance is the single instantiation.
override string ToString()
object[] Arguments
Arguments, for which the instance is unique.
override bool Equals(object obj)