public BatchLogForm(Utils.BasePlugin.Plugin plugin, Framework.Interfaces.ICore core) { InitializeComponent(); _plugin = plugin; _core = core; this.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE); this.label1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TBLIST); this.button1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ADD); this.label2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TRACKABLES); this.label5.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LOGTYPE); this.label3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_DATE); this.label4.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_NOTE); this.checkBoxStopAfterEachLog.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_STOPATLOG); this.button2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LOG); this.buttonCancel.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CANCEL); this.label6.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_GEOCACHE); this.buttonCheck.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CHECK); this.button3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_INPOSSESSION); this.linkLabel1.Text = ""; int[] ids = new int[] { 4, 13, 14, 19, 48, 75 }; comboBoxLogType1.SetLogTypes(core, (from Framework.Data.LogType l in core.LogTypes join a in ids on l.ID equals a select l).ToList()); _context = SynchronizationContext.Current; if (_context == null) { _context = new SynchronizationContext(); } }
public BrowserScriptSelectAllGeocaches(WebbrowserForm.BrowserTab browserTab, Utils.BasePlugin.Plugin ownerPlugin, WebBrowser webBrowser, Framework.Interfaces.ICore core) : base(browserTab, ownerPlugin, "Select all geocaches", webBrowser, core, true) { core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_SELECT)); webBrowser.Navigating += new WebBrowserNavigatingEventHandler(webBrowser_Navigating); webBrowser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBrowser_DocumentCompleted); }
public bool OnBeforeBrowse(IWebBrowser browser, IRequest request, bool isRedirect) { if (request.Url.ToLower() != "http://www.google.com/") { try { if (PluginSettings.Instance.OpenInInternalBrowser) { _parent.BeginInvoke((Action)(() => { Utils.BasePlugin.Plugin p = Utils.PluginSupport.PluginByName(_core, "GlobalcachingApplication.Plugins.Browser.BrowserPlugin") as Utils.BasePlugin.Plugin; if (p != null) { var m = p.GetType().GetMethod("OpenNewBrowser"); m.Invoke(p, new object[] { request.Url.ToString() }); } })); } else { System.Diagnostics.Process.Start(request.Url.ToString()); } return(true); } catch { } } return(false); }
public VisitMyFindsForm(Utils.BasePlugin.Plugin plugin, Framework.Interfaces.ICore core) : this() { _plugin = plugin; _core = core; _context = SynchronizationContext.Current; if (_context == null) { _context = new SynchronizationContext(); } dateTimePicker1.Value = new DateTime(2000, 1, 1); this.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE); this.groupBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_EXPLANATION); this.label1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_EXPLANATIONTXT); this.groupBox2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SELECTTRACKABLE); this.label2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TRACKINGNUMBER); this.button1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CHECK); this.label4.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_OR); this.button2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_GETOWNED); this.listView1.Columns[0].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ICON); this.listView1.Columns[1].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CODE); this.listView1.Columns[2].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_NAME); this.groupBox3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_AVAILABLELOGS); this.label6.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_MISSING); this.label7.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_PRESENT); this.button3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_GETALLLOGS); this.label8.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LOGTEXT); this.label9.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_BETWEEN); this.button4.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_DOLOG); this.groupBox3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_MESSAGES); }
public GoogleDirectionsForm(Utils.BasePlugin.Plugin plugin, Framework.Interfaces.ICore core) : this() { _core = core; _plugin = plugin; this.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE); this.label1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_START); this.label3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_END); this.label2.Text = string.Format(Utils.LanguageSupport.Instance.GetTranslation(STR_STOPS), 8); this.checkBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_AUTOMATICROUTING); this.label4.Text = string.Format(Utils.LanguageSupport.Instance.GetTranslation(STR_AVWAYPOINTS), 200); this.button1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ADDTOSTOPS); this.button5.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ADDWAYPOINT); this.button6.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CREATEROUTE); this.button7.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_PRINT); Assembly assembly = Assembly.GetExecutingAssembly(); using (StreamReader textStreamReader = new StreamReader(assembly.GetManifestResourceStream("GlobalcachingApplication.Plugins.GDirections.content.html"))) { string doc = textStreamReader.ReadToEnd(); doc = doc.Replace("//defaultCenter", string.Format("var startCenter = new google.maps.LatLng({0});", _core.CenterLocation.SLatLon)); doc = doc.Replace("Total Distance", Utils.LanguageSupport.Instance.GetTranslation(STR_TOTALDISTANCE)); webBrowser1.Navigate("about:blank"); if (webBrowser1.Document != null) { webBrowser1.Document.Write(string.Empty); } webBrowser1.DocumentText = doc; } LocationInfo li = new LocationInfo(); li.Location = new Framework.Data.Location(_core.HomeLocation.Lat, _core.HomeLocation.Lon); li.Name = string.Format("{0}", Utils.LanguageSupport.Instance.GetTranslation(STR_HOME)); listBox2.Items.Add(li); comboBox1.Items.Add(li); comboBox2.Items.Add(li); li = new LocationInfo(); li.Location = new Framework.Data.Location(_core.CenterLocation.Lat, _core.CenterLocation.Lon); li.Name = string.Format("{0}", Utils.LanguageSupport.Instance.GetTranslation(STR_CENTER)); listBox2.Items.Add(li); comboBox1.Items.Add(li); comboBox2.Items.Add(li); var geocaches = Utils.DataAccess.GetSelectedGeocaches(_core.Geocaches).Take(200); foreach (Framework.Data.Geocache gc in geocaches) { li = new LocationInfo(); li.Location = new Framework.Data.Location(gc.Lat, gc.Lon); li.Name = gc.Name ?? ""; listBox2.Items.Add(li); comboBox1.Items.Add(li); comboBox2.Items.Add(li); } }
public OfflineLogForm(Utils.BasePlugin.Plugin plugin, Framework.Interfaces.ICore core, Utils.API.GeocachingLiveV6 client) : this() { _core = core; _client = client; _plugin = plugin; this.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE); this.groupBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ADDGEOCACHES); this.label5.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CODE); this.button6.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ADD); this.button7.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ADDALLSELECTED); this.groupBox2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_OFFLINELOGS); this.label1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_GEOCACHES); this.label2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LOGTYPE); this.label3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LOGDATE); this.label4.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LOGTEXT); this.button1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LOGSELECTED); this.button2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LOGALL); this.button8.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_OK); this.groupBox3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LOGONLINE); int[] ids = new int[] { 2, 3, 4, 7, 45 }; comboBoxLogType1.SetLogTypes(core, (from Framework.Data.LogType l in core.LogTypes join a in ids on l.ID equals a select l).ToList()); if (core.ActiveGeocache != null) { textBox2.Text = core.ActiveGeocache.Code; } button7.Enabled = Utils.DataAccess.GetSelectedGeocaches(core.Geocaches).Count > 0; loadOfflineLogs(); }
public VisitMyFindsForm(Utils.BasePlugin.Plugin plugin, Framework.Interfaces.ICore core): this() { _plugin = plugin; _core = core; _context = SynchronizationContext.Current; if (_context == null) { _context = new SynchronizationContext(); } dateTimePicker1.Value = new DateTime(2000, 1, 1); this.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE); this.groupBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_EXPLANATION); this.label1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_EXPLANATIONTXT); this.groupBox2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SELECTTRACKABLE); this.label2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TRACKINGNUMBER); this.button1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CHECK); this.label4.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_OR); this.button2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_GETOWNED); this.listView1.Columns[0].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ICON); this.listView1.Columns[1].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CODE); this.listView1.Columns[2].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_NAME); this.groupBox3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_AVAILABLELOGS); this.label6.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_MISSING); this.label7.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_PRESENT); this.button3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_GETALLLOGS); this.label8.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LOGTEXT); this.label9.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_BETWEEN); this.button4.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_DOLOG); this.groupBox3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_MESSAGES); }
public BrowserScriptImportBookmark(WebbrowserForm.BrowserTab browserTab, Utils.BasePlugin.Plugin ownerPlugin, WebBrowser webBrowser, Framework.Interfaces.ICore core) : base(browserTab, ownerPlugin, "Import bookmark", webBrowser, core, true) { core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_IMPORT)); webBrowser.Navigating += new WebBrowserNavigatingEventHandler(webBrowser_Navigating); webBrowser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBrowser_DocumentCompleted); _bookmarkImportPlugin = Utils.PluginSupport.PluginByName(core, "GlobalcachingApplication.Plugins.APIBookmark.Import") as Utils.BasePlugin.Plugin; }
public BrowserScriptPocketQueries(WebbrowserForm.BrowserTab browserTab, Utils.BasePlugin.Plugin ownerPlugin, WebBrowser webBrowser, Framework.Interfaces.ICore core) : base(browserTab, ownerPlugin, "Pocket Queries", webBrowser, core, true) { core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_SAVE)); core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_RESTORE)); core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_CREATE)); core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_SETTINGSSAVED)); core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_ERROR)); core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_DELETE)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSettingForm.STR_OK)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSettingForm.STR_REMOVE)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSettingForm.STR_SAVE)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSettingForm.STR_TITLE)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_AUTODATERANGES)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_AUTOMATIC)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_BELGIUM)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_CANCEL)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_CREATEPQ)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_DATE)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_DELAY)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_END)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_ERROR)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_FROMSELECTION)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_ITALY)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_MARGIN)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_MAXINLASTPQ)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_MAXINPQ)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_NAME)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_NETHERLANDS)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_NEW)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_REMOVE)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_RENAME)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_SAVE)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_SERIE)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_SETTINGS)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_START)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_TEMPLATE)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_TITLE)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_AUTOMATICACTIVATE)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_FROMGCPROJECT)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesGCProjectForm.STR_DESCRIPTION)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesGCProjectForm.STR_OK)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesGCProjectForm.STR_TITLE)); webBrowser.Navigating += new WebBrowserNavigatingEventHandler(webBrowser_Navigating); webBrowser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBrowser_DocumentCompleted); try { string p = core.PluginDataPath; _settingsFileName = System.IO.Path.Combine(new string[] { p, "pqsettings.xml" }); _seriesFileName = System.IO.Path.Combine(new string[] { p, "pqseries.xml" }); } catch { } }
public GoogleDirectionsForm(Utils.BasePlugin.Plugin plugin, Framework.Interfaces.ICore core) : this() { _core = core; _plugin = plugin; this.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE); this.label1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_START); this.label3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_END); this.label2.Text = string.Format(Utils.LanguageSupport.Instance.GetTranslation(STR_STOPS), 8); this.checkBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_AUTOMATICROUTING); this.label4.Text = string.Format(Utils.LanguageSupport.Instance.GetTranslation(STR_AVWAYPOINTS), 200); this.button1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ADDTOSTOPS); this.button5.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ADDWAYPOINT); this.button6.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CREATEROUTE); this.button7.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_PRINT); Assembly assembly = Assembly.GetExecutingAssembly(); using (StreamReader textStreamReader = new StreamReader(assembly.GetManifestResourceStream("GlobalcachingApplication.Plugins.GDirections.content.html"))) { string doc = textStreamReader.ReadToEnd(); doc = doc.Replace("//defaultCenter", string.Format("var startCenter = new google.maps.LatLng({0});",_core.CenterLocation.SLatLon)); doc = doc.Replace("Total Distance", Utils.LanguageSupport.Instance.GetTranslation(STR_TOTALDISTANCE)); webBrowser1.Navigate("about:blank"); if (webBrowser1.Document != null) { webBrowser1.Document.Write(string.Empty); } webBrowser1.DocumentText = doc; } LocationInfo li = new LocationInfo(); li.Location = new Framework.Data.Location(_core.HomeLocation.Lat, _core.HomeLocation.Lon); li.Name = string.Format("{0}", Utils.LanguageSupport.Instance.GetTranslation(STR_HOME)); listBox2.Items.Add(li); comboBox1.Items.Add(li); comboBox2.Items.Add(li); li = new LocationInfo(); li.Location = new Framework.Data.Location(_core.CenterLocation.Lat, _core.CenterLocation.Lon); li.Name = string.Format("{0}", Utils.LanguageSupport.Instance.GetTranslation(STR_CENTER)); listBox2.Items.Add(li); comboBox1.Items.Add(li); comboBox2.Items.Add(li); var geocaches = Utils.DataAccess.GetSelectedGeocaches(_core.Geocaches).Take(200); foreach (Framework.Data.Geocache gc in geocaches) { li = new LocationInfo(); li.Location = new Framework.Data.Location(gc.Lat, gc.Lon); li.Name = gc.Name ?? ""; listBox2.Items.Add(li); comboBox1.Items.Add(li); comboBox2.Items.Add(li); } }
public async Task LoadGCVoteData(Utils.BasePlugin.Plugin p) { _activePlugin = p; _core.Geocaches.BeginUpdate(); await Task.Run(() => { this.LoadGCVoteDataThreadMethod(); }); _core.Geocaches.EndUpdate(); }
public GetMapsForm(Utils.BasePlugin.Plugin plugin) : this() { _plugin = plugin; label2.Text = ""; button1.Enabled = false; this.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE); this.listView1.Columns[0].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_NAME); this.listView1.Columns[1].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SIZE); this.button1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_DOWNLOAD); }
public BrowserScript(WebbrowserForm.BrowserTab browserTab, Utils.BasePlugin.Plugin ownerPlugin, string name, WebBrowser webBrowser, Framework.Interfaces.ICore core, bool hasControls) { BrowserTab = browserTab; Name = name; Browser = webBrowser; Core = core; HasControls = hasControls; OwnerPlugin = ownerPlugin; core.LanguageItems.Add(new Framework.Data.LanguageItem(Name)); core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_IMPORTING)); core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_ERROR)); }
public FormSettings(Framework.Interfaces.ICore core, Utils.BasePlugin.Plugin ownerPlugin) : this() { this.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE); this.tabPageGeneral.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_GENERAL); this.groupBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_GCCOMACCOUNT); this.buttonAuthorize.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_AUTHORIZE); this.groupBox2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_PLUGINS); this.buttonApply.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_APPLY); this.label1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_NAME); this.label2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_API); this.label3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_MENBERSHIP); this.label7.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_INTERNALSTORAGE); this.checkBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LOADINBACKGROUND); _core = core; _ownerPlugin = ownerPlugin; _pluginList = core.GetPlugins(); List <string> allPlugins = core.GetAllDetectedPlugins(); checkedListBoxPlugins.Items.AddRange(allPlugins.ToArray()); foreach (Framework.Interfaces.IPlugin p in _pluginList) { int index = checkedListBoxPlugins.Items.IndexOf(p.GetType().FullName); if (index >= 0) { checkedListBoxPlugins.SetItemChecked(index, true); } List <UserControl> pnls = p.CreateConfigurationPanels(); if (pnls != null && pnls.Count > 0) { _ucList.AddRange(pnls.ToArray()); //create tab TabPage tp = new TabPage(Utils.LanguageSupport.Instance.GetTranslation(p.FriendlyName)); tp.AutoScroll = true; tabControlSettings.TabPages.Add(tp); //add controls FlowLayoutPanel fp = new FlowLayoutPanel(); tp.Controls.Add(fp); fp.Dock = DockStyle.Fill; fp.Controls.AddRange(pnls.ToArray()); } } comboBoxInternalStorage.Items.AddRange(core.GetAvailableInternalStoragePlugins().ToArray()); comboBoxInternalStorage.SelectedItem = core.ActiveInternalStoragePlugin; textBoxUsername.Text = core.GeocachingComAccount.AccountName; labelApiEnabled.Text = string.IsNullOrEmpty(core.GeocachingComAccount.APIToken) ? Utils.LanguageSupport.Instance.GetTranslation(STR_NO) : Utils.LanguageSupport.Instance.GetTranslation(STR_YES); labelApiMembership.Text = string.IsNullOrEmpty(core.GeocachingComAccount.MemberType) ? "-" : core.GeocachingComAccount.MemberType; checkBox1.Checked = core.LoadLogsInBackground; }
public FormSettings(Framework.Interfaces.ICore core, Utils.BasePlugin.Plugin ownerPlugin) : this() { this.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE); this.tabPageGeneral.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_GENERAL); this.groupBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_GCCOMACCOUNT); this.buttonAuthorize.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_AUTHORIZE); this.groupBox2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_PLUGINS); this.buttonApply.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_APPLY); this.label1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_NAME); this.label2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_API); this.label3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_MENBERSHIP); this.label7.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_INTERNALSTORAGE); this.checkBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LOADINBACKGROUND); _core = core; _ownerPlugin = ownerPlugin; _pluginList = core.GetPlugins(); List<string> allPlugins = core.GetAllDetectedPlugins(); checkedListBoxPlugins.Items.AddRange(allPlugins.ToArray()); foreach (Framework.Interfaces.IPlugin p in _pluginList) { int index = checkedListBoxPlugins.Items.IndexOf(p.GetType().FullName); if (index >= 0) { checkedListBoxPlugins.SetItemChecked(index, true); } List<UserControl> pnls = p.CreateConfigurationPanels(); if (pnls != null && pnls.Count > 0) { _ucList.AddRange(pnls.ToArray()); //create tab TabPage tp = new TabPage(Utils.LanguageSupport.Instance.GetTranslation(p.FriendlyName)); tp.AutoScroll = true; tabControlSettings.TabPages.Add(tp); //add controls FlowLayoutPanel fp = new FlowLayoutPanel(); tp.Controls.Add(fp); fp.Dock = DockStyle.Fill; fp.Controls.AddRange(pnls.ToArray()); } } comboBoxInternalStorage.Items.AddRange(core.GetAvailableInternalStoragePlugins().ToArray()); comboBoxInternalStorage.SelectedItem = core.ActiveInternalStoragePlugin; textBoxUsername.Text = core.GeocachingComAccount.AccountName; labelApiEnabled.Text = string.IsNullOrEmpty(core.GeocachingComAccount.APIToken) ? Utils.LanguageSupport.Instance.GetTranslation(STR_NO) : Utils.LanguageSupport.Instance.GetTranslation(STR_YES); labelApiMembership.Text = string.IsNullOrEmpty(core.GeocachingComAccount.MemberType) ? "-" : core.GeocachingComAccount.MemberType; checkBox1.Checked = core.LoadLogsInBackground; }
public GeocacheBatchLogForm(Utils.BasePlugin.Plugin plugin, Framework.Interfaces.ICore core, Utils.API.GeocachingLiveV6 client, bool addSelected) { InitializeComponent(); this.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE); this.label1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_GEOCACHECODE); this.buttonAdd.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ADD); this.listView1.Columns[0].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CODE); this.listView1.Columns[1].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_NAME); this.checkBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_STOPATLOG); this.label3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_STARTFOUNDCNT); this.label5.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LOGTYPE); this.label8.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_DATE); this.label9.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LOGTEXT); this.buttonSubmit.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SUBMIT); this.button6.Text = string.Format("{0} >>", Utils.LanguageSupport.Instance.GetTranslation(STR_TRACKABLES)); this.button9.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SELECTALL); this.button8.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CLEARTALL); _context = SynchronizationContext.Current; if (_context == null) { _context = new SynchronizationContext(); } _core = core; _client = client; _plugin = plugin; int[] ids = new int[] { 2 }; comboBoxLogType1.SetLogTypes(core, (from Framework.Data.LogType l in core.LogTypes join a in ids on l.ID equals a select l).ToList()); comboBoxLogType1.SelectedIndex = 0; ids = new int[] { 75 }; comboBoxLogType2.SetLogTypes(core, (from Framework.Data.LogType l in core.LogTypes join a in ids on l.ID equals a select l).ToList()); comboBoxLogType2.SelectedIndex = 0; if (addSelected) { listView1.BeginUpdate(); List <Framework.Data.Geocache> gcList = Utils.DataAccess.GetSelectedGeocaches(core.Geocaches); foreach (Framework.Data.Geocache gc in gcList) { addGeocacheToList(gc); } listView1.EndUpdate(); } numericUpDown1.Value = Utils.DataAccess.GetFoundGeocaches(core.Geocaches, core.Logs, core.GeocachingComAccount).Count + 1; checkSubmitButton(); }
public async Task ActivateGCVote(Utils.BasePlugin.Plugin p) { if (!_gcVoteActivated) { _gcVoteActivated = true; _core.Geocaches.BeginUpdate(); try { _core.Geocaches.AddCustomAttribute(Import.CUSTOM_ATTRIBUTE); await LoadGCVoteData(p); } catch { } _core.Geocaches.EndUpdate(); } }
public AssignRegionForm(Utils.BasePlugin.Plugin plugin, Framework.Interfaces.ICore core) : this() { _plugin = plugin; _core = core; this.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE); comboBox1.Items.Add(Utils.LanguageSupport.Instance.GetTranslation(STR_COUNTRY)); comboBox1.Items.Add(Utils.LanguageSupport.Instance.GetTranslation(STR_STATE)); comboBox1.Items.Add(Utils.LanguageSupport.Instance.GetTranslation(STR_MUNICIPALITY)); comboBox1.Items.Add(Utils.LanguageSupport.Instance.GetTranslation(STR_CITY)); this.label1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LEVEL); this.label4.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_NAMEPREFIX); this.label6.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_UNASSIGNEDONLY); this.label8.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SELECTEDONLY); this.button1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_START); comboBox1.SelectedIndex = 1; checkBox2_CheckedChanged(this, EventArgs.Empty); }
public CGeoGeocacheVisitsLogForm(Utils.BasePlugin.Plugin plugin, Framework.Interfaces.ICore core, Utils.API.GeocachingLiveV6 client) { InitializeComponent(); _core = core; _client = client; _plugin = plugin; this.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE); this.groupBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LOADFROMDEVICE); this.groupBox2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_GEOCACHEINFO); this.button1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SELECTFILE); this.button3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_IMPORTMISSING); this.button4.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LOGSELECTED); this.button6.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_BATCHLOGSELECTED); this.button5.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SELECTALL); this.listView1.Columns[0].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_PERESENT); this.listView1.Columns[1].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CODE); this.listView1.Columns[2].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_DATE); this.listView1.Columns[3].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LOGTYPE); this.listView1.Columns[4].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_COMMENT); }
public GarminGeocacheVisitsLogForm(Utils.BasePlugin.Plugin plugin, Framework.Interfaces.ICore core, Utils.API.GeocachingLiveV6 client) { InitializeComponent(); _core = core; _client = client; _plugin = plugin; this.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE); this.groupBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LOADFROMDEVICE); this.groupBox2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_GEOCACHEINFO); this.button1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SELECTFILE); this.button3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_IMPORTMISSING); this.button4.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LOGSELECTED); this.button6.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_BATCHLOGSELECTED); this.button5.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SELECTALL); this.listView1.Columns[0].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_PERESENT); this.listView1.Columns[1].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CODE); this.listView1.Columns[2].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_DATE); this.listView1.Columns[3].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LOGTYPE); this.listView1.Columns[4].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_COMMENT); }
public async override Task <bool> ActionAsync(string action) { bool result = base.Action(action); if (result) { if (action == ACTION_EXPORT_ALL || action == ACTION_EXPORT_SELECTED || action == ACTION_EXPORT_ACTIVE) { if (action == ACTION_EXPORT_ALL) { _gcList = (from Framework.Data.Geocache a in Core.Geocaches select a).ToList(); } else if (action == ACTION_EXPORT_SELECTED) { _gcList = Utils.DataAccess.GetSelectedGeocaches(Core.Geocaches); } else { if (Core.ActiveGeocache != null) { _gcList = new List <Framework.Data.Geocache>(); _gcList.Add(Core.ActiveGeocache); } } if (_gcList == null || _gcList.Count == 0) { System.Windows.Forms.MessageBox.Show(Utils.LanguageSupport.Instance.GetTranslation(STR_NOGEOCACHESELECTED), Utils.LanguageSupport.Instance.GetTranslation(STR_ERROR), System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); } else { using (SelectDeviceForm dlg = new SelectDeviceForm()) { if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { if (PluginSettings.Instance.CreateGGZFile) { Utils.BasePlugin.Plugin p = Utils.PluginSupport.PluginByName(Core, "GlobalcachingApplication.Plugins.ExportGPX.GgzExport") as Utils.BasePlugin.Plugin; if (p != null) { var m = p.GetType().GetMethod("ExportToGGZ"); if (m != null) { Utils.GPXGenerator gpxGenerator = new Utils.GPXGenerator(Core, _gcList, string.IsNullOrEmpty(PluginSettings.Instance.GPXVersionStr) ? Utils.GPXGenerator.V101 : Version.Parse(PluginSettings.Instance.GPXVersionStr)); gpxGenerator.UseNameForGCCode = _useName; gpxGenerator.AddAdditionWaypointsToDescription = PluginSettings.Instance.AddWaypointsToDescription; gpxGenerator.UseHintsForDescription = PluginSettings.Instance.UseHintsForDescription; gpxGenerator.AddFieldnotesToDescription = PluginSettings.Instance.AddFieldNotesToDescription; gpxGenerator.MaxNameLength = PluginSettings.Instance.MaxGeocacheNameLength; gpxGenerator.MinStartOfname = PluginSettings.Instance.MinStartOfGeocacheName; gpxGenerator.ExtraCoordPrefix = PluginSettings.Instance.CorrectedNamePrefix; gpxGenerator.AddExtraInfoToDescription = PluginSettings.Instance.AddExtraInfoToDescription; gpxGenerator.MaxLogCount = PluginSettings.Instance.MaximumNumberOfLogs; string filename = "geocaches.ggz"; if (PluginSettings.Instance.UseDatabaseNameForFileName) { Framework.Interfaces.IPluginInternalStorage storage = (from Framework.Interfaces.IPluginInternalStorage a in Core.GetPlugin(Framework.PluginType.InternalStorage) select a).FirstOrDefault(); if (storage != null) { var si = storage.ActiveStorageDestination; if (si != null) { string s = storage.ActiveStorageDestination.Name; int pos = s.LastIndexOf('.'); if (pos < 0) { filename = string.Format("{0}.ggz", s); } else { filename = string.Format("{0}.ggz", s.Substring(0, pos)); } } } } try { if (!System.IO.Directory.Exists(System.IO.Path.Combine(new string[] { dlg.SelectedDrive, "garmin", "ggz" }))) { System.IO.Directory.CreateDirectory(System.IO.Path.Combine(new string[] { dlg.SelectedDrive, "garmin", "ggz" })); } } catch { } m.Invoke(p, new object[] { System.IO.Path.Combine(new string[] { dlg.SelectedDrive, "garmin", "ggz", filename }), _gcList, gpxGenerator }); } } } else { _oneGeocachePerFile = !dlg.SeperateFilePerGeocache; _drive = dlg.SelectedDrive; _addChildWaypoints = dlg.AddChildWaypoints; _useName = dlg.UseName; if (!string.IsNullOrEmpty(_drive)) { await PerformExport(); } } if (PluginSettings.Instance.AddImages) { Utils.BasePlugin.Plugin p = Utils.PluginSupport.PluginByName(Core, "GlobalcachingApplication.Plugins.ImgGrab.ImageGrabber") as Utils.BasePlugin.Plugin; if (p != null) { var m = p.GetType().GetMethod("CreateImageFolderForGeocaches"); if (m != null) { m.Invoke(p, new object[] { _gcList, System.IO.Path.Combine(new string[] { dlg.SelectedDrive, "garmin" }) }); } } } } } } } } return(result); }
public FormSettingsTreeView(Framework.Interfaces.ICore core, Utils.BasePlugin.Plugin ownerPlugin) : this() { this.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE); this.groupBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_GCCOMACCOUNT); this.buttonAuthorize.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_AUTHORIZE); this.groupBox2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_INTERNALSTORAGE); this.buttonApply.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_APPLY); this.label1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_NAME); this.label2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_API); this.label3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_MENBERSHIP); this.checkBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LOADINBACKGROUND); this.checkBox2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_AUTOSAVEONCLOSE); this.button1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CLEARAUTHORIZE); this.groupBox3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_OTHERACCOUNTNAMES); this.listView1.Columns[0].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CODEPREFIX); this.listView1.Columns[1].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ACCOUNTNAME); this.label7.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CODEPREFIX); this.label8.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ACCOUNTNAME); this.checkBox3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SHOWOKAPIMENU); TreeNode tn; tn = new TreeNode(Utils.LanguageSupport.Instance.GetTranslation(STR_GENERAL)); tn.Tag = panelGeneral; treeView1.Nodes.Add(tn); foreach (var t in Enum.GetNames(typeof(Framework.PluginType))) { tn = new TreeNode(Utils.LanguageSupport.Instance.GetTranslation(PluginTypeToString(t))); tn.Tag = (Framework.PluginType)Enum.Parse(typeof(Framework.PluginType), t); treeView1.Nodes.Add(tn); } _core = core; _ownerPlugin = ownerPlugin; _pluginList = core.GetPlugins(); List<string> allPlugins = core.GetAllDetectedPlugins(); checkedListBoxPlugins.Items.AddRange(allPlugins.ToArray()); foreach (Framework.Interfaces.IPlugin p in _pluginList) { int index = checkedListBoxPlugins.Items.IndexOf(p.GetType().FullName); if (index >= 0) { checkedListBoxPlugins.SetItemChecked(index, true); } List<UserControl> pnls = p.CreateConfigurationPanels(); if (pnls != null && pnls.Count > 0) { _ucList.AddRange(pnls.ToArray()); int yPos = 0; foreach (UserControl uc in pnls) { uc.Location = new Point(0, yPos); yPos += uc.Height; uc.Visible = false; splitContainer1.Panel2.Controls.Add(uc); } foreach (TreeNode t in treeView1.Nodes) { if (t.Tag!=null && t.Tag.GetType()==typeof( Framework.PluginType)) { if ((Framework.PluginType)t.Tag == p.PluginType) { tn = new TreeNode(Utils.LanguageSupport.Instance.GetTranslation(p.FriendlyName)); tn.Tag = pnls; t.Nodes.Add(tn); break; } } } } } //delete the plugin nodes with no childs (settings) int i = 1; while ( i < treeView1.Nodes.Count) { TreeNode t = treeView1.Nodes[i]; if (t.Tag != null && t.Tag.GetType() == typeof(Framework.PluginType)) { if (t.Nodes.Count == 0) { treeView1.Nodes.RemoveAt(i); } else { i++; } } } treeView1.ExpandAll(); treeView1.SelectedNode = treeView1.Nodes[0]; comboBoxInternalStorage.Items.AddRange(core.GetAvailableInternalStoragePlugins().ToArray()); comboBoxInternalStorage.SelectedItem = core.ActiveInternalStoragePlugin; textBoxUsername.Text = core.GeocachingComAccount.AccountName; labelApiEnabled.Text = string.IsNullOrEmpty(core.GeocachingComAccount.APIToken) ? Utils.LanguageSupport.Instance.GetTranslation(STR_NO) : Utils.LanguageSupport.Instance.GetTranslation(STR_YES); labelApiMembership.Text = string.IsNullOrEmpty(core.GeocachingComAccount.MemberType) ? "-" : core.GeocachingComAccount.MemberType; checkBox1.Checked = core.LoadLogsInBackground; checkBox2.Checked = core.AutoSaveOnClose; checkBox3.Checked = Properties.Settings.Default.ShowOKAPIMenu; ; fillGeocacheAccounts(); }
public GeocacheBatchLogForm(Utils.BasePlugin.Plugin plugin, Framework.Interfaces.ICore core, Utils.API.GeocachingLiveV6 client, bool addSelected) { InitializeComponent(); this.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE); this.label1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_GEOCACHECODE); this.buttonAdd.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ADD); this.listView1.Columns[0].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CODE); this.listView1.Columns[1].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_NAME); this.checkBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_STOPATLOG); this.label3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_STARTFOUNDCNT); this.label5.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LOGTYPE); this.label8.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_DATE); this.label9.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LOGTEXT); this.buttonSubmit.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SUBMIT); this.button6.Text = string.Format("{0} >>", Utils.LanguageSupport.Instance.GetTranslation(STR_TRACKABLES)); this.button9.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SELECTALL); this.button8.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CLEARTALL); _context = SynchronizationContext.Current; if (_context == null) { _context = new SynchronizationContext(); } _core = core; _client = client; _plugin = plugin; int[] ids = new int[] { 2 }; comboBoxLogType1.SetLogTypes(core, (from Framework.Data.LogType l in core.LogTypes join a in ids on l.ID equals a select l).ToList()); comboBoxLogType1.SelectedIndex = 0; ids = new int[] { 75 }; comboBoxLogType2.SetLogTypes(core, (from Framework.Data.LogType l in core.LogTypes join a in ids on l.ID equals a select l).ToList()); comboBoxLogType2.SelectedIndex = 0; if (addSelected) { listView1.BeginUpdate(); List<Framework.Data.Geocache> gcList = Utils.DataAccess.GetSelectedGeocaches(core.Geocaches); foreach (Framework.Data.Geocache gc in gcList) { addGeocacheToList(gc); } listView1.EndUpdate(); } numericUpDown1.Value = Utils.DataAccess.GetFoundGeocaches(core.Geocaches, core.Logs, core.GeocachingComAccount).Count + 1; checkSubmitButton(); }
public DownloadShapefileForm(Utils.BasePlugin.Plugin plugin) : this() { _plugin = plugin; }
public SettingsPanel(Utils.BasePlugin.Plugin plugin) : this() { _plugin = plugin; }
public BrowserScriptHideOldBrowserWarning(WebbrowserForm.BrowserTab browserTab, Utils.BasePlugin.Plugin ownerPlugin, WebBrowser webBrowser, Framework.Interfaces.ICore core) : base(browserTab, ownerPlugin, "Hide old browser warning", webBrowser, core, false) { webBrowser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBrowser_DocumentCompleted); }
public SettingsPanel(Utils.BasePlugin.Plugin plugin): this() { _plugin = plugin; }
public FormSettingsTreeView(Framework.Interfaces.ICore core, Utils.BasePlugin.Plugin ownerPlugin) : this() { this.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE); this.groupBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_GCCOMACCOUNT); this.buttonAuthorize.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_AUTHORIZE); this.groupBox2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_INTERNALSTORAGE); this.buttonApply.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_APPLY); this.label1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_NAME); this.label2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_API); this.label3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_MENBERSHIP); this.checkBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LOADINBACKGROUND); this.checkBox2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_AUTOSAVEONCLOSE); this.button1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CLEARAUTHORIZE); this.groupBox3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_OTHERACCOUNTNAMES); this.listView1.Columns[0].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CODEPREFIX); this.listView1.Columns[1].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ACCOUNTNAME); this.label7.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CODEPREFIX); this.label8.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ACCOUNTNAME); this.checkBox3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SHOWOKAPIMENU); TreeNode tn; tn = new TreeNode(Utils.LanguageSupport.Instance.GetTranslation(STR_GENERAL)); tn.Tag = panelGeneral; treeView1.Nodes.Add(tn); foreach (var t in Enum.GetNames(typeof(Framework.PluginType))) { tn = new TreeNode(Utils.LanguageSupport.Instance.GetTranslation(PluginTypeToString(t))); tn.Tag = (Framework.PluginType)Enum.Parse(typeof(Framework.PluginType), t); treeView1.Nodes.Add(tn); } _core = core; _ownerPlugin = ownerPlugin; _pluginList = core.GetPlugins(); List <string> allPlugins = core.GetAllDetectedPlugins(); checkedListBoxPlugins.Items.AddRange(allPlugins.ToArray()); foreach (Framework.Interfaces.IPlugin p in _pluginList) { int index = checkedListBoxPlugins.Items.IndexOf(p.GetType().FullName); if (index >= 0) { checkedListBoxPlugins.SetItemChecked(index, true); } List <UserControl> pnls = p.CreateConfigurationPanels(); if (pnls != null && pnls.Count > 0) { _ucList.AddRange(pnls.ToArray()); int yPos = 0; foreach (UserControl uc in pnls) { uc.Location = new Point(0, yPos); yPos += uc.Height; uc.Visible = false; splitContainer1.Panel2.Controls.Add(uc); } foreach (TreeNode t in treeView1.Nodes) { if (t.Tag != null && t.Tag.GetType() == typeof(Framework.PluginType)) { if ((Framework.PluginType)t.Tag == p.PluginType) { tn = new TreeNode(Utils.LanguageSupport.Instance.GetTranslation(p.FriendlyName)); tn.Tag = pnls; t.Nodes.Add(tn); break; } } } } } //delete the plugin nodes with no childs (settings) int i = 1; while (i < treeView1.Nodes.Count) { TreeNode t = treeView1.Nodes[i]; if (t.Tag != null && t.Tag.GetType() == typeof(Framework.PluginType)) { if (t.Nodes.Count == 0) { treeView1.Nodes.RemoveAt(i); } else { i++; } } } treeView1.ExpandAll(); treeView1.SelectedNode = treeView1.Nodes[0]; comboBoxInternalStorage.Items.AddRange(core.GetAvailableInternalStoragePlugins().ToArray()); comboBoxInternalStorage.SelectedItem = core.ActiveInternalStoragePlugin; textBoxUsername.Text = core.GeocachingComAccount.AccountName; labelApiEnabled.Text = string.IsNullOrEmpty(core.GeocachingComAccount.APIToken) ? Utils.LanguageSupport.Instance.GetTranslation(STR_NO) : Utils.LanguageSupport.Instance.GetTranslation(STR_YES); labelApiMembership.Text = string.IsNullOrEmpty(core.GeocachingComAccount.MemberType) ? "-" : core.GeocachingComAccount.MemberType; checkBox1.Checked = core.LoadLogsInBackground; checkBox2.Checked = core.AutoSaveOnClose; checkBox3.Checked = PluginSettings.Instance.ShowOKAPIMenu;; fillGeocacheAccounts(); }
public void LoadGCVoteData(Utils.BasePlugin.Plugin p) { _activePlugin = p; _actionDone = new ManualResetEvent(false); _core.Geocaches.BeginUpdate(); Thread thrd = new Thread(new ThreadStart(this.LoadGCVoteDataThreadMethod)); thrd.Start(); while (!_actionDone.WaitOne(100)) { System.Windows.Forms.Application.DoEvents(); } thrd.Join(); _actionDone.Dispose(); _actionDone = null; _core.Geocaches.EndUpdate(); }
public void Export(Framework.Interfaces.ICore core, Utils.BasePlugin.Plugin owner, string fileName, List <Framework.Data.Geocache> gcList) { using (Utils.ProgressBlock upd = new Utils.ProgressBlock(owner, STR_EXPORT, STR_EXPORT, 1, 0)) { using (FileStream fs = File.OpenWrite(fileName)) using (BinaryWriter bw = new BinaryWriter(fs)) { bw.Write("GAPP"); bw.Write(BitConverter.IsLittleEndian); int version = 3; bw.Write(version); using (Utils.ProgressBlock prog = new Utils.ProgressBlock(owner, STR_EXPORT, STR_EXPORT_CACHES, gcList.Count, 0)) { bw.Write(gcList.Count); int index = 0; foreach (Framework.Data.Geocache gc in gcList) { bw.Write(gc.Archived); WriteIntegerArray(bw, gc.AttributeIds); bw.Write(gc.Available); bw.Write(gc.City ?? ""); bw.Write(gc.Code ?? ""); bw.Write(gc.Container.ID); bw.Write(gc.CustomCoords); bw.Write(gc.Country ?? ""); bw.Write(gc.ContainsCustomLatLon); if (gc.ContainsCustomLatLon) { bw.Write((double)gc.CustomLat); bw.Write((double)gc.CustomLon); } bw.Write(gc.Difficulty); bw.Write(gc.EncodedHints ?? ""); bw.Write(gc.Favorites); bw.Write(gc.Flagged); bw.Write(gc.Found); if (gc.FoundDate == null) { bw.Write(""); } else { bw.Write(((DateTime)gc.FoundDate).ToString("s")); } bw.Write(gc.GeocacheType.ID); bw.Write(gc.ID ?? ""); bw.Write(gc.Lat); bw.Write(gc.Lon); bw.Write(gc.LongDescription ?? ""); bw.Write(gc.LongDescriptionInHtml); bw.Write(gc.MemberOnly); bw.Write(gc.Municipality ?? ""); bw.Write(gc.Name ?? ""); bw.Write(gc.Notes ?? ""); bw.Write(gc.Owner ?? ""); bw.Write(gc.OwnerId ?? ""); bw.Write(gc.PersonaleNote ?? ""); bw.Write(gc.PlacedBy ?? ""); bw.Write(((DateTime)gc.PublishedTime).ToString("s")); bw.Write(gc.Selected); bw.Write(gc.ShortDescription ?? ""); bw.Write(gc.ShortDescriptionInHtml); bw.Write(gc.State ?? ""); bw.Write(gc.Terrain); bw.Write(gc.Title ?? ""); bw.Write(gc.Url ?? ""); bw.Write(gc.DataFromDate.ToString("s")); bw.Write(gc.Locked); //logs List <Framework.Data.Log> logs = Utils.DataAccess.GetLogs(core.Logs, gc.Code); bw.Write(logs.Count); foreach (Framework.Data.Log l in logs) { bw.Write(l.DataFromDate.ToString("s")); bw.Write(l.Date.ToString("s")); bw.Write(l.Encoded); bw.Write(l.Finder ?? ""); bw.Write(l.FinderId ?? ""); bw.Write(l.GeocacheCode ?? ""); bw.Write(l.ID ?? ""); bw.Write(l.LogType.ID); bw.Write(l.TBCode ?? ""); bw.Write(l.Text ?? ""); List <Framework.Data.LogImage> logImages = Utils.DataAccess.GetLogImages(core.LogImages, l.ID); bw.Write(logImages.Count); foreach (Framework.Data.LogImage li in logImages) { bw.Write(li.DataFromDate.ToString("s")); bw.Write(li.ID ?? ""); bw.Write(li.LogID ?? ""); bw.Write(li.Name ?? ""); bw.Write(li.Url ?? ""); } } //waypoints List <Framework.Data.Waypoint> wps = Utils.DataAccess.GetWaypointsFromGeocache(core.Waypoints, gc.Code); bw.Write(wps.Count); foreach (Framework.Data.Waypoint wp in wps) { bw.Write(wp.Code ?? ""); bw.Write(wp.Comment ?? ""); bw.Write(wp.DataFromDate.ToString("s")); bw.Write(wp.Description ?? ""); bw.Write(wp.GeocacheCode ?? ""); bw.Write(wp.ID ?? ""); if (wp.Lat == null || wp.Lon == null) { bw.Write(false); } else { bw.Write(true); bw.Write((double)wp.Lat); bw.Write((double)wp.Lon); } bw.Write(wp.Name ?? ""); bw.Write(wp.Time.ToString("s")); bw.Write(wp.Url ?? ""); bw.Write(wp.UrlName ?? ""); bw.Write(wp.WPType.ID); } //user waypoints List <Framework.Data.UserWaypoint> usrwps = Utils.DataAccess.GetUserWaypointsFromGeocache(core.UserWaypoints, gc.Code); bw.Write(usrwps.Count); foreach (Framework.Data.UserWaypoint wp in usrwps) { bw.Write(wp.ID); bw.Write(wp.Description ?? ""); bw.Write(wp.GeocacheCode ?? ""); bw.Write(wp.Lat); bw.Write(wp.Lon); bw.Write(wp.Date.ToString("s")); } index++; if (index % 200 == 0) { prog.UpdateProgress(STR_EXPORT, STR_EXPORT_CACHES, gcList.Count, index); } } } } } }
public void Import(Framework.Interfaces.ICore core, Utils.BasePlugin.Plugin owner, string fileName) { using (Utils.ProgressBlock upd = new Utils.ProgressBlock(owner, STR_IMPORT, STR_IMPORT, 1, 0)) { using (FileStream fs = File.OpenRead(fileName)) using (BinaryReader br = new BinaryReader(fs)) { string tag = br.ReadString(); if (tag == "GAPP") { bool IsLittleEndian = br.ReadBoolean(); int version = br.ReadInt32(); if (IsLittleEndian == BitConverter.IsLittleEndian && version <= 3) { int count = br.ReadInt32(); using (Utils.ProgressBlock prog = new Utils.ProgressBlock(owner, STR_IMPORT, STR_IMPORT_CACHES, count, 0)) { for (int index = 0; index < count; index++) { Framework.Data.Geocache gc = new Framework.Data.Geocache(); gc.Archived = br.ReadBoolean(); gc.AttributeIds = ReadIntegerArray(br); gc.Available = br.ReadBoolean(); gc.City = br.ReadString(); gc.Code = br.ReadString(); gc.Container = Utils.DataAccess.GetGeocacheContainer(core.GeocacheContainers, br.ReadInt32()); gc.CustomCoords = br.ReadBoolean(); gc.Country = br.ReadString(); if (br.ReadBoolean()) { gc.CustomLat = br.ReadDouble(); gc.CustomLon = br.ReadDouble(); } gc.Difficulty = br.ReadDouble(); gc.EncodedHints = br.ReadString(); gc.Favorites = br.ReadInt32(); gc.Flagged = br.ReadBoolean(); gc.Found = br.ReadBoolean(); string s = br.ReadString(); gc.GeocacheType = Utils.DataAccess.GetGeocacheType(core.GeocacheTypes, br.ReadInt32()); gc.ID = br.ReadString(); gc.Lat = br.ReadDouble(); gc.Lon = br.ReadDouble(); gc.LongDescription = br.ReadString(); gc.LongDescriptionInHtml = br.ReadBoolean(); gc.MemberOnly = br.ReadBoolean(); gc.Municipality = br.ReadString(); gc.Name = br.ReadString(); gc.Notes = br.ReadString(); gc.Owner = br.ReadString(); gc.OwnerId = br.ReadString(); gc.PersonaleNote = br.ReadString(); gc.PlacedBy = br.ReadString(); gc.PublishedTime = DateTime.Parse(br.ReadString()); gc.Selected = br.ReadBoolean(); gc.ShortDescription = br.ReadString(); gc.ShortDescriptionInHtml = br.ReadBoolean(); gc.State = br.ReadString(); gc.Terrain = br.ReadDouble(); gc.Title = br.ReadString(); gc.Url = br.ReadString(); gc.DataFromDate = DateTime.Parse(br.ReadString()); if (version > 1) { gc.Locked = br.ReadBoolean(); } Calculus.SetDistanceAndAngleGeocacheFromLocation(gc, core.CenterLocation); (owner as Import).AddImportedGeocache(gc); int logcount = br.ReadInt32(); for (int lc = 0; lc < logcount; lc++) { Framework.Data.Log log = new Framework.Data.Log(); log.DataFromDate = DateTime.Parse(br.ReadString()); log.Date = DateTime.Parse(br.ReadString()); log.Encoded = br.ReadBoolean(); log.Finder = br.ReadString(); log.FinderId = br.ReadString(); log.GeocacheCode = br.ReadString(); log.ID = br.ReadString(); log.LogType = Utils.DataAccess.GetLogType(core.LogTypes, br.ReadInt32()); log.TBCode = br.ReadString(); log.Text = br.ReadString(); (owner as Import).AddImportedLog(log); int logimgcount = br.ReadInt32(); for (int lic = 0; lic < logimgcount; lic++) { Framework.Data.LogImage li = new Framework.Data.LogImage(); li.DataFromDate = DateTime.Parse(br.ReadString()); li.ID = br.ReadString(); li.LogID = br.ReadString(); li.Name = br.ReadString(); li.Url = br.ReadString(); (owner as Import).AddImportedLogImage(li); } } int wpcount = br.ReadInt32(); for (int wpc = 0; wpc < wpcount; wpc++) { Framework.Data.Waypoint wp = new Framework.Data.Waypoint(); wp.Code = br.ReadString(); wp.Comment = br.ReadString(); wp.DataFromDate = DateTime.Parse(br.ReadString()); wp.Description = br.ReadString(); wp.GeocacheCode = br.ReadString(); wp.ID = br.ReadString(); if (br.ReadBoolean()) { wp.Lat = br.ReadDouble(); wp.Lon = br.ReadDouble(); } wp.Name = br.ReadString(); wp.Time = DateTime.Parse(br.ReadString()); wp.Url = br.ReadString(); wp.UrlName = br.ReadString(); wp.WPType = Utils.DataAccess.GetWaypointType(core.WaypointTypes, br.ReadInt32()); (owner as Import).AddImportedWaypoint(wp); } if (version > 2) { int usrwpcount = br.ReadInt32(); for (int wpc = 0; wpc < usrwpcount; wpc++) { Framework.Data.UserWaypoint wp = new Framework.Data.UserWaypoint(); wp.ID = br.ReadInt32(); wp.Description = br.ReadString(); wp.GeocacheCode = br.ReadString(); wp.Lat = br.ReadDouble(); wp.Lon = br.ReadDouble(); wp.Date = DateTime.Parse(br.ReadString()); (owner as Import).AddImportedUserWaypoint(wp); } } if (index % 200 == 0) { prog.UpdateProgress(STR_IMPORT, STR_IMPORT_CACHES, count, index); } } } } else { //message } } else { //message } } } }
public GeocacheBatchLogForm(Utils.BasePlugin.Plugin plugin, Framework.Interfaces.ICore core, Utils.API.GeocachingLiveV6 client) : this(plugin, core, client, true) { }