Пример #1
0
        public plKey ReadUoid(hsStream s)
        {
            plUoid uoid = new plUoid();
            uoid.Read(s);

            // Plasma21+ uses an Invalid plLocation to indicate NULL keys
            if (s.Version.IsPlasma21 && uoid.fLocation.Invalid)
                return null;
            else
                return ReRegister(uoid);
        }
Пример #2
0
 internal plKey(plCreatableID type, string objName)
 {
     fKeyData = new plUoid(type, objName);
 }
Пример #3
0
 internal plKey(plUoid uoid)
 {
     fKeyData = uoid;
 }
Пример #4
0
 /// <summary>
 /// Creates a FAKE plKey based on the information given.
 /// </summary>
 /// <remarks>
 /// This key will NOT be added to (or checked by) the internal KeyCollector; therefore, you should 
 /// ONLY use this method if you know what you're doing! Othwerise, you will create duplicate keys
 /// and completely screw the garbage collection.
 /// </remarks>
 /// <param name="loc">Key's Location</param>
 /// <param name="type">Managed Type ID</param>
 /// <param name="name">Object Name</param>
 /// <param name="id">Object ID</param>
 /// <returns>Fabricated key</returns>
 public static plKey Fabricate(plLocation loc, plCreatableID type, string name, uint id)
 {
     plUoid uoid = new plUoid(type, name);
     uoid.fLocation = loc;
     uoid.fObjectID = id;
     return new plKey(uoid);
 }
Пример #5
0
        internal override plKey ReRegister(plUoid uoid)
        {
            plKey key = fKeyCollector.FindKey(uoid);
            if (key == null) {
                key = new plKey(uoid);
                fKeyCollector.AddKey(key);
            }

            return key;
        }
Пример #6
0
 internal virtual plKey ReRegister(plUoid uoid)
 {
     // Returns an unchecked key.
     return new plKey(uoid);
 }
Пример #7
0
 public void WriteUoid(hsStream s, plKey uoid)
 {
     if (uoid == null) {
         plUoid nil = new plUoid();
         nil.Write(s);
     } else
         uoid.Uoid.Write(s);
 }