コード例 #1
0
        public bool AddReservedObject(ObjectIdInfo objectIdInfo)
        {
            if (!ConsideredObjectTypes.Contains(objectIdInfo.ObjectType))
            {
                return(true);
            }

            if (innerDictionary.ContainsKey(objectIdInfo.ObjectID))
            {
                innerDictionary[objectIdInfo.ObjectID].SetAvailability(objectIdInfo.ObjectType, Availability.Reserved);
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #2
0
        public bool AddUsedObject(ObjectIdInfo objectIdInfo)
        {
            // Returns false if the object's ID is outside of the ranges in the collection

            if (!ConsideredObjectTypes.Contains(objectIdInfo.ObjectType))
            {
                return(true);
            }

            if (innerDictionary.ContainsKey(objectIdInfo.ObjectID))
            {
                innerDictionary[objectIdInfo.ObjectID].SetAvailability(objectIdInfo.ObjectType, Availability.InUse);
                return(true);
            }
            else
            {
                return(false);
            }
        }