Пример #1
0
        /// <summary>
        /// The client MUST be connected to access to this service.
        /// Allow a hubapp client to create a hMessage with a hAlert payload.
        /// </summary>
        /// <param name="actor"></param>
        /// <param name="alert"></param>
        /// <param name="mOptions"></param>
        /// <returns></returns>
        public HMessage BuildAlert(string actor, string alert, HMessageOptions mOptions)
        {
            if (actor == null || actor.Length <= 0)
                throw new MissingAttrException("actor");
            if (alert == null || alert.Length <= 0)
                throw new MissingAttrException("alert");

            HAlert halert = new HAlert();
            halert.SetAlert(alert);

            HMessage message = BuildMessage(actor, "hAlert", halert, mOptions);
            return message;
        }