Пример #1
0
        private void LoadDateContentsDateTime()
        {
            if (!Directory.Exists(Properties.Settings.Default.EntryPath))
            {
                throw new DirectoryNotFoundException();
            }

            contentsList.Clear();
            var pathList = Directory.GetFiles(Properties.Settings.Default.EntryPath, "*.doentry");

            foreach (var path in pathList)
            {
                Dictionary <string, object> entry = Plist.readPlist(path) as Dictionary <string, object>;
                var created    = (DateTime)entry["Creation Date"];
                var createdKey = new DateTime(created.Year, created.Month, created.Day);
                var uuid       = (string)entry["UUID"];

                if (!contentsList.Keys.Contains(createdKey))
                {
                    contentsList.Add(createdKey, new List <string>()
                    {
                        uuid
                    });
                }
                else
                {
                    contentsList[createdKey].Add(uuid);
                }
            }
        }
Пример #2
0
        public static DayOneContent ReadContents(string path)
        {
            var entry = Plist.readPlist(path) as Dictionary <string, object>;

            return(ReadContents(entry));
        }
Пример #3
0
        public static DayOneContent ReadContents(byte[] data)
        {
            var entry = Plist.readPlist(data) as Dictionary <string, object>;

            return(ReadContents(entry));
        }