コード例 #1
0
        private void UpdateUserQuery(Query query)
        {
            var configuration = this.configurationService.GetConfiguration();
            var queryToUpdate = configuration.UserQueries.First(q => q.Id == query.Id);

            queryToUpdate.Name = query.Name;
            queryToUpdate.Value = query.Value;

            this.configurationService.SaveConfiguration(configuration);
        }
コード例 #2
0
        public QueryTreeViewModel(Query query, QueryTreeViewModelCommands queryTreeViewModelCommands)
        {            
            this.query = query;
            this.queryTreeViewModelCommands = queryTreeViewModelCommands;

            if (query.Children != null)
            {
                this.children = new ObservableCollection<QueryTreeViewModel>(query.Children.Select(q => new QueryTreeViewModel(q, queryTreeViewModelCommands)).ToList());
            }
        }
コード例 #3
0
        public void AddUserQuery(Query query)
        {
            var configuration = this.configurationService.GetConfiguration();

            if (configuration.UserQueries == null)
            {
                configuration.UserQueries = new List<Query>();
            }

            configuration.UserQueries.Add(query);
            this.configurationService.SaveConfiguration(configuration);
        }
コード例 #4
0
        public void AddOrUpdateQuery(Query query)
        {
            var configuration = this.configurationService.GetConfiguration();

            if (configuration.UserQueries.Any(q => q.Id == query.Id))
            {
                this.UpdateUserQuery(query);
            }
            else
            {
                this.AddUserQuery(query);
            }
        }
コード例 #5
0
 public AddEditQueryViewModel(IQueryService queryService, Query query, Action successCallback)
 {
     this.queryService = queryService;
     this.successCallback = successCallback;
     this.query = query;
 }
コード例 #6
0
 public void ShowEditDialog(Query queryToEdit, Action successCallback)
 {
     this.InitializeViewModels(this.viewModelFactory(queryToEdit, successCallback));
     this.ShowDialog();
 }