示例#1
0
文件: Engine.cs 项目: ImranCS/tfsx
        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);
        }
示例#2
0
文件: WindowUI.cs 项目: ImranCS/tfsx
            public LvwItem(ChangeItem item, ListViewGroup grp)
            {
                Text = item.FileName;
                SubItems.AddRange(new string[] { item.RelPath, "todo", "todo", item.Change.ToString() });

                Group = grp;
            }
示例#3
0
文件: WindowUI.cs 项目: ImranCS/tfsx
        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);
        }
示例#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));
 }
示例#5
0
文件: WindowUI.cs 项目: ImranCS/tfsx
 void IWindowUI.AddItem(ChangeItem x)
 {
     lvwItems.Items.Add(new LvwItem(x, GroupOf(x)));
 }