Example #1
0
        /// <summary>
        /// Convert a <see cref="Tag"/> to a <see cref="TagView"/> for UI.
        /// </summary>
        /// <param name="t">The tag to convert</param>
        /// <returns>return the <see cref="TagView"/> representing the Tag.</returns>
        private TagView ConvertToTagView(Tag t)
        {
            //Find and clean all the deleted folder that are still tag.
            FindAndCleanDeletedPaths();
            //Create the Tag View

            //Convert the path.
            List<string>[] pathList = ProfilingLayer.Instance.ConvertAndFilter(t.FilteredPathListString);
            //a list of available path
            PathGroupView availGrpView = new PathGroupView("Available");
            List<PathView> pathViewList = new List<PathView>();
            foreach (string path in pathList[0])
            {
                PathView p = new PathView(path);
                if (!Directory.Exists(path))
                {
                    p.IsMissing = false;
                }
                pathViewList.Add(p);
            }
            availGrpView.PathList = pathViewList;
            TagView view = new TagView(t.TagName, t.LastUpdatedDate);
            view.GroupList.Add(availGrpView);

            view.Created = t.CreatedDate;
            view.IsQueued = CompareAndSyncController.Instance.IsQueued(t.TagName);
            view.IsSyncing = CompareAndSyncController.Instance.IsSyncing(t.TagName);

            view.TagState = GetTagState(view.TagName);
            return view;
        }
Example #2
0
 /// <summary>
 /// Add a path to the group
 /// </summary>
 /// <param name="path">PathView To add</param>
 public void AddPath(PathView path)
 {
     PathList.Add(path);
 }