Beispiel #1
0
 private void OpenFolderSelection()
 {
     try
     {
         var srcMlService = ServiceLocator.Resolve <ISrcMLGlobalService>();
         if (srcMlService != null)
         {
             if (srcMlService.MonitoredDirectories != null)
             {
                 while (MonitoredFiles.Count > 0)
                 {
                     MonitoredFiles.RemoveAt(0);
                 }
                 foreach (var dir in srcMlService.MonitoredDirectories)
                 {
                     MonitoredFiles.Add(new CheckedListItem(dir));
                 }
                 CurrentlyIndexingFoldersPopup.IsOpen = true;
             }
         }
     }
     catch (ResolutionFailedException resFailed)
     {
         //ignore
     }
 }
Beispiel #2
0
        private void AddFolder_Click(object sender, RoutedEventArgs e)
        {
            var dialog = new System.Windows.Forms.FolderBrowserDialog();

            if (MonitoredFiles.Count > 0)
            {
                dialog.SelectedPath = MonitoredFiles.First().Id;
            }
            System.Windows.Forms.DialogResult result = dialog.ShowDialog();
            if (System.Windows.Forms.DialogResult.OK.Equals(result))
            {
                MonitoredFiles.Add(new CheckedListItem(dialog.SelectedPath));
            }
        }