Issue with double clicking tray icon. Added list management.

This commit is contained in:
Patrick Fic
2020-01-17 00:41:41 -08:00
parent 32aec8e4ff
commit 2b3d9ac76b
15 changed files with 292 additions and 69 deletions

View File

@@ -2,9 +2,11 @@
using GraphQL.Common.Request;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace BodyshopUploader.ViewModels
{
@@ -15,41 +17,62 @@ namespace BodyshopUploader.ViewModels
public MainViewModel()
{
logger.Trace("Main VM Created.");
//Create Variables
if (MonitoringPaths == null) MonitoringPaths = new ObservableCollection<string>();
MonitoringPaths.CollectionChanged += MonitoringPathsChanged;
}
private void MonitoringPathsChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
{
logger.Warn("TODO: Change monitoring lifecycles for folder watchers.");
}
public void AddFolderMonitoringPath()
{
var dialog = new Ookii.Dialogs.Wpf.VistaFolderBrowserDialog();
if (dialog.ShowDialog().GetValueOrDefault())
{
logger.Debug("Adding folder {0} to monitoring paths.", dialog.SelectedPath);
MonitoringPaths.Add(dialog.SelectedPath);
Properties.Settings.Default.MonitoringPaths = MonitoringPaths;
Properties.Settings.Default.Save();
}
}
public void RemoveFolderMonitoringPath(string Path)
{
logger.Debug("Removing folder {0} to monitoring paths.", Path);
MonitoringPaths.Remove(Path);
Properties.Settings.Default.MonitoringPaths = MonitoringPaths;
Properties.Settings.Default.Save();
}
public async Task TestGql()
{
var r = new GraphQLRequest
{
Query = @"
query {
jobs {
id
est_number
ro_number
job_status {
id
name
}
scheduled_completion
scheduled_delivery
vehicle {
id
v_model_yr
v_make_desc
v_model_desc
plate_no
}
}
}
"
};
if (MonitoringPaths == null) MonitoringPaths = new ObservableCollection<string>();
MonitoringPaths.Add(@"C:\IMEX");
Properties.Settings.Default.MonitoringPaths = MonitoringPaths;
Properties.Settings.Default.Save();
using (var g = Utils.GraphQL.CreateGQLClient())
{
var graphQLResponse = await g.PostAsync(r);
logger.Info(graphQLResponse.Data.jobs);
}
//var r = new GraphQLRequest
//{
// Query = @"
// query {
// jobs {
// id
// est_number
// ro_number
// }
// }
// "
//};
//using (var g = Utils.GraphQL.CreateGQLClient())
//{
// var graphQLResponse = await g.PostAsync(r);
// logger.Info(graphQLResponse.Data.jobs);
//}
}
}
}