Beispiel #1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            var dialog = new FolderBrowserDialog
                             {
                                 ShowNewFolderButton = false,
                                 Description = "Select a subversion checked out dir",
                                 SelectedPath = @"c:\checkout1\example\trunk"
                             };
            dialog.ShowDialog();
            var dirModel = new DirModel { MonitoredDir = dialog.SelectedPath };
            Window1.Instance.Add(dirModel);

            ModelFactory.Instance.Models.Add(dirModel);
            ModelFactory.Instance.Save();
        }
        public LocalModificationsMonitor(DirModel dirModel, string physicalRoot, IEnumerable<SvnPath> list)
        {
            map = new Dictionary<string, SvnPath>();
            m_DirModel = dirModel;
            foreach (var svnPath in list)
            {
//                if (svnPath.Action != Action.Modified && svnPath.Action != Action.Deleted) 
//                    continue;

                var path = Path.Combine(physicalRoot, svnPath.RelativePath);
//                if (!File.Exists(path) || Directory.Exists(path)) 
//                    continue;

                var cp = new ComplexPath(path);
                FileSystemWatcher watcher;
                map[path] = svnPath;
                    
                if (cp.Imaginary != null)
                {
                    watcher = new FileSystemWatcher(cp.Real, cp.Imaginary);                    
                }
                else
                {
                    if (File.Exists(path))
                    {
                        var path1 = new FileInfo(path);
                        watcher = new FileSystemWatcher(path1.DirectoryName, path1.Name);
                    }
                    else
                    {
                        watcher = new FileSystemWatcher(path);
                    }                    
                }
                watcher.Changed += ConflictHandler;
                watcher.Created += ConflictHandler;
                watcher.Deleted += ConflictHandler;
                watcher.IncludeSubdirectories = false;
                watcher.EnableRaisingEvents = true;
                
                m_FileSystemWatchers.Add(watcher);                                    
            }
        }
Beispiel #3
0
        public DirModel SetupModel(Stubversion stubversion)
        {
            var model = new DirModel
            {
                Subversion = stubversion,
                MonitoredDir = monitoredDir
            };

            model.Update();
            return model;
        }
Beispiel #4
0
 public void Add(DirModel dirModel2)
 {
     dirModel2.CheckinOccured += model_Changed;
     dirModel2.ConflictDetected += model_ConflictDetected;
 }