Beispiel #1
0
        private void Add(FileSystemEventArgs e, ChangeItem.ChangeType type)
        {
            if (Directory.Exists(e.FullPath))
            {
                return;
            }

            var rel = IOHelper.RelFolderOf(e.FullPath, SolnFol);

            if (rel.ContainsAny(@"bin\", @"obj\", FolRoot))
            {
                return;
            }

            var itm = new ChangeItem
            {
                Change = type,
                FileName = e.Name,
                RelPath = rel
            };

            if (Items.AnyIs(itm))
            {
                return;
            }

            Window.AddItem(itm);
            Items.Add(itm);
            IOHelper.SaveTo(Items, RootFol);
        }
Beispiel #2
0
            public LvwItem(ChangeItem item, ListViewGroup grp)
            {
                Text = item.FileName;
                SubItems.AddRange(new string[] { item.RelPath, "todo", "todo", item.Change.ToString() });

                Group = grp;
            }
Beispiel #3
0
        private ListViewGroup GroupOf(ChangeItem item)
        {
            if (item.Changelist == null)
            {
                return null;

            }

            return lvwItems.Groups.Cast<ListViewGroup>().FirstOrDefault(x => x.Name == item.Changelist)
                ?? lvwItems.Groups.Add(item.Changelist, item.Changelist);
        }
Beispiel #4
0
 public static bool AnyIs(this IEnumerable<ChangeItem> list, ChangeItem item)
 {
     return list.Any(x => x.RelPath.Equals(item.RelPath, StringComparison.OrdinalIgnoreCase)
         && x.FileName.Equals(item.FileName, StringComparison.OrdinalIgnoreCase));
 }
Beispiel #5
0
 void IWindowUI.AddItem(ChangeItem x)
 {
     lvwItems.Items.Add(new LvwItem(x, GroupOf(x)));
 }