private void Ok() { _model.Settings.ExcludedFileNameTokens.Clear(); _model.Settings.ExcludedFilePathTokens.Clear(); _model.Settings.ExcludedFileNameTokens.AddRange(FileNameExclusions.Split(new [] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries)); _model.Settings.ExcludedFilePathTokens.AddRange(FilePathExclusions.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries)); _model.Save(); ViewNavigation.Direction = Direction.Forward; Messenger.Default.Send(Messages.ShowSync); }
private void DeleteRule(SyncRuleViewModel ruleViewModel) { lock (_ruleCollectionLock) { _model.Settings.Rules.Remove(ruleViewModel.Rule); _model.Save(); var index = Rules.IndexOf(ruleViewModel); Rules.RemoveAt(index); if (Rules.Count == 0) { ViewNavigation.Direction = Direction.Backward; Messenger.Default.Send(Messages.ShowWelcome); } } }
private void SaveRule() { _rule.Dest = _rule.Dest.ToLowerInvariant().TrimEnd('\\'); _rule.Source = _rule.Source.ToLowerInvariant().TrimEnd('\\'); if (!_rule.Filters.Any()) { _rule.Filters.Add("*.*"); } if (_isNew) { _model.Settings.Rules.Add(_rule); } _model.Save(); ViewNavigation.Direction = Direction.Forward; Messenger.Default.Send(App.FirstRun ? Messages.ShowExclusions : Messages.ShowSync); }