Example #1
0
        /// <summary>
        /// Generate the collection of tags specified for the item
        /// </summary>
        private void GenerateTagsCollection()
        {
            // The query joins between the tag item mapping and tags based on
            // the user id
            var query = from m in context.TagItemMappingCollection
                        where m.ItemID == item.ID
                        join t in context.TagCollection on m.TagID equals t.ID
                        orderby t.Name
                        select t;

            // Create the dynamic query to handle changes in either collection
            tags = new DynamicQuery <Tag>(
                query,
                (INotifyCollectionChanged)context.TagItemMappingCollection,
                (INotifyCollectionChanged)context.TagCollection);

            // Update the dictionary of used tags
            UpdateUsedTags(from m in context.TagItemMappingCollection
                           where m.ItemID == item.ID
                           select m);
        }
Example #2
0
 private ContextModel()
 {
     UserID   = Guid.Empty;
     userTags = null;
     LoadUserID();
 }
Example #3
0
 /// <summary>
 /// Takes the tag id and the number of items associated with the tag
 /// </summary>
 /// <param name="tagId"></param>
 /// <param name="count"></param>
 public ModelTag(int tagId, int count)
 {
     this.tagId = tagId;
     this.count = count;
     items      = null;
 }