Ejemplo n.º 1
0
        bool IsSreMessage(string str)
        {
            if (string.IsNullOrEmpty(str))
            {
                return(false);
            }

            if (str.Contains(typeof(IdpeMessage).ToString()))
            {
                string[] sreMsgInfo = str.Split("|".ToCharArray());

                IdpeMessageCodes msgCode = (IdpeMessageCodes)Enum.Parse(typeof(IdpeMessageCodes), sreMsgInfo[1], true);
                _Result         = new IdpeMessage(msgCode);
                _Result.Message = sreMsgInfo[2];
                return(true);
            }
            return(false);
        }
Ejemplo n.º 2
0
        public IdpeMessage(IdpeMessageCodes code)
        {
            this.Code = code;
            string msg = (string)Cache.Instance.Bag[code];

            if (msg == null)    //empty string is valid msg
            {
                ResourceManager rm = new ResourceManager("Eyedia.IDPE.Common.IdpeMessageCodeDescriptions", Assembly.GetAssembly(typeof(IdpeKeyTypes)));
                msg = rm.GetString(code.ToString());
                Cache.Instance.Bag.Add(code, msg);
            }
            this.Message = msg;
            if (this.Message == null)
            {
                this.Code    = IdpeMessageCodes.IDPE_UNKNOWN_ERROR;
                this.Message = "An unknown error occurred. There is no error defined with code " + code.ToString();
            }
        }