Пример #1
0
        public void SetAllStatus(Dictionary <MessageTypeEnum, StatusEnum> dic)
        {
            foreach (var d in dic)
            {
                SetMessageStatus(d.Key, d.Value);
            }

            EmailCore.SaveMessageStatus(messageStatus);
        }
Пример #2
0
        public void Enable(MessageTypeEnum e)
        {
            CheckCanEnable();
            if (dic.Where(a => a.Key == e).FirstOrDefault().Value == Himall.Core.Plugins.Message.StatusEnum.Disable)
            {
                throw new Himall.Core.HimallException("该功能已被禁止,不能进行设置");
            }
            SetMessageStatus(e, StatusEnum.Open);
            //using (FileStream fs = new FileStream(EmailCore.WorkDirectory + "/Data/config.xml", FileMode.Create))
            //{
            //    XmlSerializer xs = new XmlSerializer(typeof(MessageStatus));
            //    xs.Serialize(fs, messageStatus);
            //}

            EmailCore.SaveMessageStatus(messageStatus);
        }