Ejemplo n.º 1
0
        /// <summary>
        /// Gets a clone of the Key.
        /// </summary>
        /// <returns></returns>
        public override Key Clone()
        {
            MultiKey newKey = new MultiKey(this.t, this.TypeManager);

            newKey.pm_keydata = this.pm_keydata;
            return(newKey);
        }
Ejemplo n.º 2
0
        internal static ObjectId NewObjectId(Type t, Class cl, DataRow row, TypeManager tm)
        {
            if (cl.SystemType == null)
            {
                throw new InternalException(16, "ObjectIdFactory.NewObjectId: cl.SystemType is null.");
            }
            Key key;

            if (cl.Oid.IsDependent)
            {
                key = new DependentKey(t, cl, row, tm);
            }
            else
            {
                key = new MultiKey(t, cl, row, tm);
            }
            return(new ObjectId(key));
        }
Ejemplo n.º 3
0
 /// <inheritdoc />
 public override bool Equals(object obj)
 {
     if (base.Equals(obj))  // Key compares the types and checks for null
     {
         MultiKey k = obj as MultiKey;
         if ((object)k == null)
         {
             return(false);
         }
         bool result = true;
         for (int i = 0; i < pm_keydata.Length; i++)
         {
             result = result && pm_keydata[i].Equals(k.pm_keydata[i]);
         }
         return(result);
     }
     return(false);
 }