// in its own thread.. public static Task <bool> DownloadMaps(IDiscoveryController discoveryform, Func <bool> cancelRequested, Action <string> logLine, Action <string> logError) // ASYNC process { try { string mapsdir = Path.Combine(EDDOptions.Instance.AppDataDirectory, "Maps"); if (!Directory.Exists(mapsdir)) { Directory.CreateDirectory(mapsdir); } logLine("Checking for new EDDiscovery maps"); BaseUtils.GitHubClass github = new BaseUtils.GitHubClass(EDDiscovery.Properties.Resources.URLGithubDataDownload, discoveryform.LogLine); var files = github.ReadDirectory("Maps/V1"); return(Task.Factory.StartNew(() => github.DownloadFiles(files, mapsdir))); } catch (Exception ex) { logError("DownloadImages exception: " + ex.Message); var tcs = new TaskCompletionSource <bool>(); tcs.SetException(ex); return(tcs.Task); } }
public static Task <bool> DownloadMaps(IDiscoveryController discoveryform, Func <bool> cancelRequested, Action <string> logLine, Action <string> logError) // ASYNC process { try { string mapsdir = Path.Combine(EDDConfig.Options.AppDataDirectory, "Maps"); if (!Directory.Exists(mapsdir)) { Directory.CreateDirectory(mapsdir); } logLine("Checking for new EDDiscovery maps"); BaseUtils.GitHubClass github = new BaseUtils.GitHubClass(discoveryform.LogLine); var files = github.GetDataFiles("Maps/V1"); return(Task.Factory.StartNew(() => github.DownloadFiles(files, mapsdir))); /* * DeleteMapFile("DW4.png", logLine); * DeleteMapFile("SC-00.jpg", logLine); * return DownloadMapFiles(new[] * { * "SC-01.jpg", * "SC-02.jpg", * "SC-03.jpg", * "SC-04.jpg", * "SC-L4.jpg", * "SC-U4.jpg", * "SC-00.png", * "SC-00.json", * "Galaxy_L.jpg", * "Galaxy_L.json", * "Galaxy_L_Grid.jpg", * "Galaxy_L_Grid.json", * "DW1.jpg", * "DW1.json", * "DW2.jpg", * "DW2.json", * "DW3.jpg", * "DW3.json", * "DW4.jpg", * "DW4.json", * "Formidine.png", * "Formidine.json", * "Formidine trans.png", * "Formidine trans.json" * }, * (s) => logLine("Map check complete."), * cancelRequested, * logLine); */ } catch (Exception ex) { logError("DownloadImages exception: " + ex.Message); var tcs = new TaskCompletionSource <bool>(); tcs.SetException(ex); return(tcs.Task); } }
public ScreenshotDirectoryWatcher(IDiscoveryController controller, Action <Action <ImageConverter> > paramscallback) { this.paramscallback = paramscallback; this._discoveryForm = controller; string ScreenshotsDirdefault = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyPictures), "Frontier Developments", "Elite Dangerous"); string OutputDirdefault = Path.Combine(ScreenshotsDirdefault, "Converted"); this.EDPicturesDir = ScreenshotsDirdefault; _discoveryForm.OnNewJournalEntry += NewJournalEntry; }
private void buttonSearch_Click(object sender, EventArgs e) { double MaxLy = Double.Parse(comboBoxMaxLy.SelectedItem.ToString()); IDiscoveryController edfrm = this.Owner as IDiscoveryController; HistoryEntry hi = edfrm.history.First <HistoryEntry>(); List <ISystem> distlist; distlist = SystemClass.GetSystemDistancesFrom(hi.System.x, hi.System.y, hi.System.z, 1000, MaxLy); }
public static bool SendEDDNEvents(IDiscoveryController frm, IEnumerable <HistoryEntry> helist) { foreach (HistoryEntry he in helist) { hlscanunsyncedlist.Enqueue(he); } hlscanevent.Set(); // Start the sync thread if it's not already running if (Interlocked.CompareExchange(ref _running, 1, 0) == 0) { Exit = false; mainForm = frm; ThreadEDDNSync = new System.Threading.Thread(new System.Threading.ThreadStart(SyncThread)); ThreadEDDNSync.Name = "EDDN Sync"; ThreadEDDNSync.IsBackground = true; ThreadEDDNSync.Start(); } return(true); }
public EDSMSync(IDiscoveryController frm) { mainForm = frm; }
public static bool SendEDDNEvents(IDiscoveryController frm, params HistoryEntry[] helist) { return(SendEDDNEvents(frm, (IEnumerable <HistoryEntry>)helist)); }
public static bool SendEDDNEvent(IDiscoveryController frm, HistoryEntry helist) { return(SendEDDNEvents(frm, new[] { helist })); }
public NetLogClass(IDiscoveryController ds) { }