Exemplo n.º 1
0
        public GroupItem(Entry entry, Dispatcher dispatcher)
        {
            if (entry == null) throw new ArgumentNullException("entry");
            if (dispatcher == null) throw new ArgumentNullException("dispatcher");

            Title = entry.Title;
            Notes = entry.Notes;
            Icon = ThemeData.GetImage("entry");
            Overlay = Cache.GetOverlay(dispatcher, entry.Icon);

            _targetUri = Navigation.GetPathTo
                <EntryDetails>("id={0}", entry.ID);
        }
Exemplo n.º 2
0
        protected override void OnNavigatedTo(
            bool cancelled, NavigationEventArgs e)
        {
            if (cancelled || _entry != null)
                return;

            var database = Cache.Database;
            if (database == null)
            {
                GoBack<MainPage>();
                return;
            }

            var id = NavigationContext.QueryString["entry"];
            _entry = database.GetEntry(id);

            foreach (var field in _entry.CustomFields.Take(3))
            {
                var item = new ApplicationBarMenuItem(field.Key);
                item.Click += (s, _) => SetValue(field.Value);
                ApplicationBar.MenuItems.Add(item);
            }
        }
Exemplo n.º 3
0
        private Entry ParseEntry(XmlReader reader)
        {
            var id = ReadId(reader);
            var icon = ParseIcon(reader);

            var lastModified = ReadLastModified(reader);
            var fields = ReadFields(reader);

            if (fields.Count == 0)
                return null;

            var histories = ReadHistories(reader);
            var entry = new Entry(fields)
            {
                ID = id,
                Icon = icon,
                Histories = histories,
                LastModified = lastModified,
            };

            return entry;
        }
Exemplo n.º 4
0
        /// <summary>
        /// Adds the specified entry.
        /// </summary>
        /// <param name="entry">The entry.</param>
        public void Add(Entry entry)
        {
            if (entry == null)
                throw new ArgumentNullException("entry");

            entry.Group = this;
            _entries.Add(entry);
        }