Exemplo n.º 1
0
        /// <summary>
        /// Factory method for creating an instance of EntityInfo for a device
        /// </summary>
        /// <returns>A populated EntityInfo</returns>
        /// <param name="properties">Any initial device state that you want to report to Splyt</param>
        /// <param name="isNew">Explicitly report the device as new or not. Setting a value here will override Splyt's automatic new device detection!</param>
        public static EntityInfo createDeviceInfo(Dictionary<string, object> properties = null, bool? isNew = null)
        {
            EntityInfo device = new EntityInfo();
            device.type = Constants.ENTITY_TYPE_DEVICE;
            device.properties = properties;
            device.isNew = isNew;

            return device;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Factory method for creating an instance of EntityInfo for a user
        /// </summary>
        /// <returns>A populated EntityInfo</returns>
        /// <param name="userId">The user id</param>
        /// <param name="properties">Any initial user state that you want to report to Splyt</param>
        /// <param name="isNew">Explicitly report the user as new or not. Setting a value here will override Splyt's automatic new user detection!</param>
        public static EntityInfo createUserInfo(string userId, Dictionary<string, object> properties = null, bool? isNew = null)
        {
            EntityInfo user = new EntityInfo();
            user.type = Constants.ENTITY_TYPE_USER;
            user.entityId = userId;
            user.properties = properties;
            user.isNew = isNew;

            return user;
        }