Revision 0c02aa65 trunk/Pithos.Core/PithosMonitor.cs

b/trunk/Pithos.Core/PithosMonitor.cs
40 40
        [Import]
41 41
        public ICloudClient CloudListeningClient { get; set; }
42 42

  
43
        public IStatusNotification StatusNotification { get; set; }
44

  
43 45
        public string UserName { get; set; }
44 46
        public string ApiKey { get; set; }
45 47

  
......
57 59
                if (value)
58 60
                {
59 61
                    StatusKeeper.SetPithosStatus(PithosStatus.SyncPaused);
62
                    StatusNotification.NotifyChange("Paused");
60 63
                }
61 64
                else
62 65
                {
63 66
                    StatusKeeper.SetPithosStatus(PithosStatus.InSynch);
67
                    StatusNotification.NotifyChange("In Synch");
64 68
                }
65 69
            }
66 70
        }
......
77 81

  
78 82
        public void Start()
79 83
        {
80

  
84
            StatusNotification.NotifyChange("Starting");
81 85
            if (_cancellationSource != null)
82 86
            {
83 87
                if (!_cancellationSource.IsCancellationRequested)
......
135 139

  
136 140
        private void IndexLocalFiles(string path)
137 141
        {
138
            Trace.TraceInformation("[START] Inxed Local");
142
            StatusNotification.NotifyChange("Indexing Local Files",TraceLevel.Info);
143
            Trace.TraceInformation("[START] Index Local");
139 144
            try
140 145
            {
141 146
                var files =
......
157 162

  
158 163
        private void RestartInterruptedFiles()
159 164
        {
165
            StatusNotification.NotifyChange("Restart processing interrupted files", TraceLevel.Verbose);
160 166
            var interruptedStates = new[] { FileOverlayStatus.Unversioned, FileOverlayStatus.Modified };
161 167
            var filesQuery = from state in FileState.Queryable
162 168
                             where interruptedStates.Contains(state.OverlayStatus)
......
350 356

  
351 357
                                      var uniques =
352 358
                                          onlyLocal.Union(onlyRemote).Union(commonObjects)
353
                                              .Except(_networkActions,new LocalFileComparer());
354
                                      
359
                                              .Except(_networkActions,new LocalFileComparer());                                      
360

  
355 361
                                      _networkActions.AddFromEnumerable(uniques, false);
356 362

  
363
                                      StatusNotification.NotifyChange(String.Format("Processing {0} files", _networkActions.Count));
364

  
357 365
                                      Trace.TraceInformation("[LISTENER] End Processing");
358 366
                                      
359 367
                                  }
......
734 742

  
735 743

  
736 744
    }
745

  
746
    public interface IStatusNotification
747
    {        
748
        void NotifyChange(string status,TraceLevel level=TraceLevel.Info);
749
    }
737 750
}

Also available in: Unified diff