HasId() public method

public HasId ( object obj, bool &firstTime ) : long
obj object
firstTime bool
return long
Ejemplo n.º 1
0
        // Get the next object to be serialized.
        protected virtual Object GetNext(out long objID)
        {
            Object next = m_objectQueue.Dequeue();
            bool   firstTime;

            objID = m_idGenerator.HasId(next, out firstTime);
            if (!firstTime)
            {
                throw new SerializationException
                          (_("Serialize_NoObjectID"));
            }
            return(next);
        }
Ejemplo n.º 2
0
        protected virtual object GetNext(out long objID)
        {
            if (m_objectQueue.Count == 0)
            {
                // set the out field to 0
                objID = 0L;
                return(null);
            }

            Object o = m_objectQueue.Dequeue();
            bool   FirstTime;

            objID = m_idGenerator.HasId(o, out FirstTime);

            return(o);
        }
        // This gives back the next object to be serialized.  Objects
        // are returned in a FIFO order based on how they were passed
        // to Schedule.  The id of the object is put into the objID parameter
        // and the Object itself is returned from the function.
        protected virtual Object GetNext(out long objID)
        {
            bool isNew;

            if (m_objectQueue.Count == 0)
            {
                objID = 0;
                return(null);
            }

            Object obj = m_objectQueue.Dequeue();

            objID = m_idGenerator.HasId(obj, out isNew);
            if (isNew)
            {
                throw new SerializationException(Environment.GetResourceString("Serialization_NoID"));
            }

            return(obj);
        }
Ejemplo n.º 4
0
        protected virtual object GetNext(out long objID)
        {
            if (m_objectQueue.Count == 0)
            {
                objID = 0;
                return(null);
            }

            object obj = m_objectQueue.Dequeue();

            bool isNew;

            objID = m_idGenerator.HasId(obj, out isNew);
            if (isNew)
            {
                throw new SerializationException(SR.Serialization_NoID);
            }

            return(obj);
        }