private void AddWatchFolder()
 {
     WatchFoldersSettings.Add(new WatchFolderSettingsViewModel(new Common.ObjectModel.Settings.WatchFolderSettings())
     {
         Name = "<Enter Name>", FolderName = "<Enter Folder Name>"
     });
 }
 public void SetWatchFoldersSettings(WatchFoldersSettings watchFoldersSettings)
 {
     if (_client != null)
     {
         _client.SetWatchFoldersSettings(watchFoldersSettings);
     }
 }
        private void RemoveWatchFolder()
        {
            _isRemoving = true;
            RemoveWatchFolderCommand.RaiseCanExecuteChanged();

            WatchFoldersSettings watchFoldersSettings = _client.GetWatchFoldersSettings();

            watchFoldersSettings.Remove(SelectedWatchFolderSettings.FolderName);
            //_client.SetWatchFoldersSettings(watchFoldersSettings);
            WatchFoldersSettings.Remove(SelectedWatchFolderSettings);

            _isRemoving = false;
            RemoveWatchFolderCommand.RaiseCanExecuteChanged();
        }
示例#4
0
        public WatchFolderSettings GetWatchFolderSettings(string folderName)
        {
            WatchFoldersSettings watchFoldersSettings = GetWatchFoldersSettings();

            try
            {
                if (watchFoldersSettings.Contains(folderName))
                {
                    return(watchFoldersSettings[folderName]);
                }
                return(null);
            }
            catch
            {
                return(null);
            }
        }
示例#5
0
        public bool SetWatchFolderSettings(WatchFolderSettings watchFolderSettings, string folderName)
        {
            try
            {
                WatchFoldersSettings watchFoldersSettings = GetWatchFoldersSettings();

                if (watchFoldersSettings.Contains(folderName))
                {
                    watchFoldersSettings[folderName] = watchFolderSettings;
                }
                else
                {
                    watchFoldersSettings.Add(watchFolderSettings);
                }
                return(true);
            }
            catch
            {
                return(false);
            }
        }
示例#6
0
        public void StartWatchFolders()
        {
            _logHelper.WriteEntry("Starting WatchFolder ServiceViewModel", MessageType.Information);

            try
            {
                _watchFolderSettingsHelper = new WatchFolderSettingsHelper(_logHelper);
                WatchFoldersSettings watchFoldersSettings = _watchFolderSettingsHelper.Settings.WatchFoldersSettings;

                foreach (WatchFolderSettings watchFolderSettings in watchFoldersSettings)
                {
                    StartWatchFolder(watchFolderSettings.FolderName);
                }

                _logHelper.WriteEntry("Started WatchFolder ServiceViewModel", MessageType.Information);
            }
            catch (Exception exception)
            {
                _logHelper.WriteEntry(exception.Message, MessageType.Error);
            }
        }
示例#7
0
 public bool SetWatchFoldersSettings(WatchFoldersSettings watchFoldersSettings)
 {
     _watchFolderSettingsHelper.Settings.WatchFoldersSettings = watchFoldersSettings;
     return(true);
 }
示例#8
0
 public bool SetWatchFoldersSettings(WatchFoldersSettings watchFoldersSettings)
 {
     return(Channel.SetWatchFoldersSettings(watchFoldersSettings));
 }
 public WatchFolderServiceConfigurationSection()
 {
     WatchFoldersSettings = new WatchFoldersSettings();
     Port = 0;
 }