Ejemplo n.º 1
0
        /// <summary>
        /// 取得使用者設定通知資料
        /// </summary>
        /// <returns></returns>
        public override List <Member> GetMemberNotifyConfig()
        {
            List <Member> memberData = new List <Member>();

            var fileList = Directory.GetFiles(SystemInfo.notifyConfig);

            foreach (var file in fileList)
            {
                var    member = new Member();
                var    memberSetupFileName = Path.GetFileNameWithoutExtension(file);
                string memberJson          = ReadFile.ReadJsonFile(Path.GetFileName(file), SystemInfo.member);
                try
                {
                    member = JsonConvert.DeserializeObject <Member>(memberJson);
                }
                catch (Exception)
                {
                    throw;
                }
                member.Account = Path.GetFileNameWithoutExtension(file);
                string json = ReadFile.ReadJsonFile(file, SystemInfo.notifyConfig);
                try
                {
                    member.NotifyConfig = JsonConvert.DeserializeObject <List <NotifyConfig> >(json);
                    memberData.Add(member);
                }
                catch (Exception ex)
                {
                    continue;
                    //throw;
                }
            }
            return(memberData);
        }
Ejemplo n.º 2
0
        public override List <NotifyData> GetNotifyData()
        {
            List <NotifyData> data = null;

            try
            {
                string json = ReadFile.ReadJsonFile("List.json", SystemInfo.notifyData);
                data = JsonConvert.DeserializeObject <List <NotifyData> >(json);
            }
            catch (Exception ex)
            {
            }
            return(data);
//            data = Json
        }