Exemple #1
0
        /// <summary>
        /// Gets model type code for specified entity id.
        /// </summary>
        /// <param name="id">entity id</param>
        /// <returns>Model type code</returns>
        public ModelCode GetModelCodeFromId(long id)
        {
            DMSType type = (DMSType)ModelCodeHelper.ExtractTypeFromGlobalId(id);

            ModelCode modelCode;

            if (this.type2modelCode.TryGetValue(type, out modelCode))
            {
                return(modelCode);
            }
            else
            {
                string message = string.Format("Failed to get model type code for DMS type: {0}. Invalid DMS type. ID: 0x{1:X16}", type, id);
                Logger.LogError(message);
                throw new Exception(message);
            }
        }
Exemple #2
0
        /// <summary>
        /// Gets property ids that corresponds to all settable attributes of the entity.
        /// </summary>
        /// <param name="globalId">GlobalId</param>
        /// <returns>List of property ids that corresponds to settable entity attributes.</returns>
        public List <ModelCode> GetAllSettablePropertyIdsForEntityId(long globalId)
        {
            DMSType type = (DMSType)ModelCodeHelper.ExtractTypeFromGlobalId(globalId);

            return(GetAllSettablePropertyIds(type));
        }