Ejemplo n.º 1
0
        public QuoteGroup AddItemToGroup(QuoteItem i, string id, string title, bool insert_begin = true)
        {
            QuoteGroup group = null;

            group = AllGroups.SingleOrDefault(s => s.UniqueId == id);
            if (group == null)
            {
                group = new QuoteGroup(id, title);

                _allGroups.Add(group);
                i.Group = group;
            }
            else
            {
                i.Group = group;
            }

            if (insert_begin)
            {
                group.Items.Insert(0, i);
            }
            else
            {
                group.Items.Add(i);
            }

            return(group);
        }
Ejemplo n.º 2
0
        public QuoteGroup AddGroup(string id, string title)
        {
            QuoteGroup group = AllGroups.SingleOrDefault(s => s.UniqueId == id);

            if (group == null)
            {
                group = new QuoteGroup(id, title);
                _allGroups.Add(group);
            }

            return(group);
        }
Ejemplo n.º 3
0
        public QuoteGroup AddRecentGroup()
        {
            QuoteGroup group = ReturnRecentGroup();

            if (group == null)
            {
                group = new QuoteGroup("-2", App.loader.GetString("Recents"));

                _allGroups.Insert(0, group);
            }

            return(group);
        }
Ejemplo n.º 4
0
        public QuoteGroup AddFavoriteGroup()
        {
            QuoteGroup group = ReturnFavoriteGroup();

            if (group == null)
            {
                group = new QuoteGroup("-1", App.loader.GetString("Favorites"));

                if (ReturnRecentGroup() != null)
                {
                    _allGroups.Insert(1, group);
                }
                else
                {
                    _allGroups.Insert(0, group);
                }
            }
            return(group);
        }
Ejemplo n.º 5
0
        public QuoteGroup ReturnRecentGroup()
        {
            QuoteGroup group = AllGroups.SingleOrDefault(s => s.UniqueId == "-2");

            return(group);
        }
Ejemplo n.º 6
0
        public QuoteGroup ReturnFavoriteGroup()
        {
            QuoteGroup group = AllGroups.SingleOrDefault(s => s.UniqueId == "-1");

            return(group);
        }
Ejemplo n.º 7
0
        public QuoteItem(String uniqueId, String autor, String quote, DateTime received, QuoteGroup group)
        {
            this._group = group;

            this._uniqueId = uniqueId;
            this._autor    = autor;
            this._quote    = quote;
            this._received = received;
            SColor         = QuoteItem.GREEN;
        }