public void SetAllStatus(Dictionary <MessageTypeEnum, StatusEnum> dic) { foreach (var d in dic) { SetMessageStatus(d.Key, d.Value); } EmailCore.SaveMessageStatus(messageStatus); }
public void Enable(MessageTypeEnum e) { CheckCanEnable(); if (dic.Where(a => a.Key == e).FirstOrDefault().Value == Mall.Core.Plugins.Message.StatusEnum.Disable) { throw new Mall.Core.MallException("该功能已被禁止,不能进行设置"); } 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); }