System.Runtime.Serialization.Formatters.Binary.ObjectWriter.GetNext C# (CSharp) Method

GetNext() private method

private GetNext ( long &objID ) : object
objID long
return object
        private object GetNext(out long objID)
        {
            bool isNew;

            //The Queue is empty here.  We'll throw if we try to dequeue the empty queue.
            if (_objectQueue.Count == 0)
            {
                objID = 0;
                return null;
            }

            object obj = _objectQueue.Dequeue();

            // A WriteObjectInfo is queued if this object was a member of another object
            object realObj = obj is WriteObjectInfo ? ((WriteObjectInfo)obj)._obj : obj;
            objID = _idGenerator.HasId(realObj, out isNew);
            if (isNew)
            {
                throw new SerializationException(SR.Format(SR.Serialization_ObjNoID, realObj));
            }

            return obj;
        }