Ejemplo n.º 1
0
        public static string ToString(IEnumerable<int> tagIds, TagManager manager)
        {
            StringBuilder builder = new StringBuilder();

            foreach (var tagId in tagIds)
            {
                var tag = manager.TagDictionary[tagId];
                builder.Append(tag.Name + ",");
            }

            return builder.ToString();
        }
Ejemplo n.º 2
0
        public static void Expand(IEnumerable<SaveTagModel> tagModels, TagManager manager)
        {
            foreach (var saveTagModel in tagModels)
            {
                manager.Add(GetTag(saveTagModel));
            }

            foreach (var saveTagModel in tagModels)
            {
                var parent = manager.TagDictionary[saveTagModel.ParentId];
                var self = manager.TagDictionary[saveTagModel.Id];

                manager.ConnectTags(parent, self);
            }
        }
Ejemplo n.º 3
0
        public static Collection<SaveTagModel> Expand(TagManager manager)
        {
            Collection<SaveTagModel> saveTagModelList = new Collection<SaveTagModel>();

            foreach (var tag in manager.TagDictionary.Values)
            {
                if (tag.IsBase())
                {
                    continue;
                }

                saveTagModelList.Add(GetSaveTag(tag));
            }

            return saveTagModelList;
        }
        public static ObservableCollection<AppearListViewItemModel> ToAppearListViewItemModel(IEnumerable<int> tagIds, TagManager manager)
        {
            var tagItemModels = new ObservableCollection<AppearListViewItemModel>();

            foreach (var tagId in tagIds)
            {
                var tag = manager.TagDictionary[tagId];
                tagItemModels.Add(new AppearListViewItemModel(
                    tag.Name,
                    true,
                    "",
                    "",
                    tag) { BackgroundBrush = Brushes.LemonChiffon });
            }

            return tagItemModels;
        }