Esempio n. 1
0
        private static long GetNumber(CosObject obj)
        {
            if (obj == null)
            {
                throw new ArgumentNullException(nameof(obj));
            }

            return(obj.GetObjectNumber());
        }
Esempio n. 2
0
        public CosObject GetOrCreateDefault(CosObjectKey key)
        {
            if (!objects.TryGetValue(key, out CosObject obj))
            {
                obj = new CosObject(null);
            }

            return(obj);
        }
Esempio n. 3
0
        public CosObject Get(CosObjectKey key)
        {
            if (key != null)
            {
                if (objects.TryGetValue(key, out var value))
                {
                    return(value);
                }
            }

            // this was a forward reference, make "proxy" object
            var obj = new CosObject(null);

            if (key != null)
            {
                obj.SetObjectNumber(key.Number);
                obj.SetGenerationNumber((int)key.Generation);
                objects[key] = obj;
            }

            return(obj);
        }
Esempio n. 4
0
 /**
  * PDFObjectKey constructor comment.
  *
  * @param object The object that this key will represent.
  */
 public CosObjectKey(CosObject obj) : this(GetNumber(obj), obj.GetGenerationNumber())
 {
 }