示例#1
0
        public void Handle(FileCreatedEvent message)
        {
            //ignore changes to files in .git repository
            //seems to happen if you are running github 4 windows and
            //looking at a repository while you edit a file from
            //that repository in markpad
            if (message.FullPath.Contains(".git\\") ||
                message.FullPath.Contains(".git/"))
            {
                return;
            }

            if (Path == System.IO.Path.GetDirectoryName(message.FullPath))
            {
                var newItem = new FileSystemSiteItem(EventAggregator, fileSystem, message.FullPath);
                for (int i = 0; i < Children.Count; i++)
                {
                    if (String.Compare(Children[i].Name, newItem.Name, StringComparison.Ordinal) < 0)
                    {
                        continue;
                    }
                    Children.Insert(i, newItem);
                    break;
                }
            }
        }
 public void Handle(FileCreatedEvent message)
 {
     if (Path == System.IO.Path.GetDirectoryName(message.FullPath))
     {
         var newItem = new FileSystemSiteItem(EventAggregator, fileSystem, message.FullPath);
         for (int i = 0; i < Children.Count; i++)
         {
             if (String.Compare(Children[i].Name, newItem.Name, StringComparison.Ordinal) < 0)
             {
                 continue;
             }
             Children.Insert(i, newItem);
             break;
         }
     }
 }