public GPXGenerator(Framework.Interfaces.ICore core, List<Framework.Data.Geocache> gcList, Version gpxVersion) { _core = core; _gcList = gcList; _gpxVersion = gpxVersion; _index = 0; }
public async virtual Task<bool> InitializeAsync(Framework.Interfaces.ICore core, string[] actions) { bool result = false; _core = core; if (actions != null && actions.Length > 0) { _actions.AddRange(actions); } if (_actions != null && _actions.Count > 0) { foreach (string s in _actions) { string[] parts = s.Split(new char[] { SubActionSep }); _core.LanguageItems.AddTextRange(parts.ToList()); } } _core.LanguageItems.AddText(FriendlyName); if (RequiredCoreVersion <= core.Version) { List<Framework.Interfaces.IPlugin> p = core.GetPlugin(Framework.PluginType.UIMainWindow); if (p != null) { foreach (Framework.Interfaces.IPluginUIMainWindow mwp in p) { await InitUIMainWindowAsync(mwp); } } core.PluginAdded += new Framework.EventArguments.PluginEventHandler(_core_PluginAdded); result = true; } return result; }
public SetupWizardForm(Framework.Interfaces.IPlugin owner, Framework.Interfaces.ICore core) { InitializeComponent(); this.TopMost = true; _ownerPlugin = owner as SetupWizard; _core = core; UpdateTextForLanguage(); textBoxAccountname.Text = core.GeocachingComAccount.AccountName; textBoxHomecoords.Text = Utils.Conversion.GetCoordinatesPresentation(core.HomeLocation); textBoxCentercoords.Text = Utils.Conversion.GetCoordinatesPresentation(core.CenterLocation); comboBoxLanguage.Items.Add(Utils.LanguageSupport.Instance.GetTranslation(STR_ORGTEXT)); comboBoxLanguage.Items.AddRange(Utils.LanguageSupport.Instance.GetSupportedCultures().ToArray()); for (int i = 1; i < comboBoxLanguage.Items.Count; i++) { if ((comboBoxLanguage.Items[i] as System.Globalization.CultureInfo).LCID == core.SelectedLanguage.LCID) { comboBoxLanguage.SelectedIndex = i; break; } } if (comboBoxLanguage.SelectedIndex < 0) { comboBoxLanguage.SelectedIndex = 0; } }
public async override Task<bool> InitializeAsync(Framework.Interfaces.ICore core) { _core = core; var p = new PluginSettings(core); AddAction(ACTION_SHOW); core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_ASKUPDATE)); core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_ERROR)); core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_IMPORTING)); core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_INFO)); core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_NONEW)); core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_UPDATING)); core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_AUTODOWNLOAD)); core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_COUNTRY)); core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_STATE)); core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_LOCATION)); core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_RADIUS)); core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_KM)); core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_CLEAR)); core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_SHOWDIALOG)); core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_UPDATEANDDOWNLOAD)); core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsForm.STR_OK)); return await base.InitializeAsync(core); }
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 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 AccountsForm(Framework.Interfaces.ICore core, List<AccountInfo> ail) : this() { _core = core; AccountInfoSettings = ail; comboBox1.Items.AddRange(ail.ToArray()); textBox1.Text = core.GeocachingComAccount.AccountName; comboBox1_SelectedIndexChanged(this, EventArgs.Empty); this.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE); this.groupBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ACCOUNTS); this.groupBox3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_GCCOMACCOUNT); this.label10.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_NAME); this.label9.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_API); this.label8.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_MENBERSHIP); this.button3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CLEARAUTHORIZE); this.label4.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_NAME); this.button4.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ACTIVATE); this.button5.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_REMOVE); this.button6.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_FROMCURRENT); this.label12.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ENABLE); this.label14.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ENABLE); this.label1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_NAME); this.label16.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_NAME); this.button1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CREATEACCOUNT); this.button2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_OK); this.groupBox2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_NEWACCOUNT); }
public void Initialize(Framework.Interfaces.ICore core) { _core = core; _availableWaypoints = new Hashtable(); try { _dbcon = new Utils.DBConComSqlite(Path.Combine(core.PluginDataPath,"gcvote.db3")); object o = _dbcon.ExecuteScalar("SELECT name FROM sqlite_master WHERE type='table' AND name='votes'"); if (o == null || o.GetType() == typeof(DBNull)) { _dbcon.ExecuteNonQuery("create table 'votes' (Waypoint text, VoteMedian float, VoteAvg float, VoteCnt integer, VoteUser double)"); _dbcon.ExecuteNonQuery("create unique index idx_votess on votes (Waypoint)"); } DbDataReader dr = _dbcon.ExecuteReader("select Waypoint from votes"); while (dr.Read()) { _availableWaypoints.Add(dr[0], true); } } catch { _dbcon = null; _availableWaypoints.Clear(); } }
public SelectRegionForm(SelectRegion plugin, Framework.Interfaces.ICore core) { InitializeComponent(); _plugin = plugin; _core = core; this.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE); this.radioButtonAddToCurrent.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ADDTOSELECTION); this.radioButtonWithinSelection.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SEARCHWITHINSELECTION); this.radioButtonNewSearch.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_NEWSEARCH); this.groupBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SELECTIONOPTIONS); this.groupBox2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_REGIONSELECTION); this.label1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LEVEL); this.label4.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_AREA); this.label6.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_PREFIX); this.button1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SELECT); this.checkBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_INENVELOPE); 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)); comboBox1.Items.Add(Utils.LanguageSupport.Instance.GetTranslation(STR_OTHER)); comboBox1.SelectedIndex = 0; }
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 virtual void UpdateLanguageSupportPlugins(Framework.Interfaces.ICore core) { if (_core == null) { core.LanguageItems.Add(new Framework.Data.LanguageItem(Dialogs.GetLocationForm.STR_GET_LOCATION)); core.LanguageItems.Add(new Framework.Data.LanguageItem(Dialogs.GetLocationForm.STR_LOCATION)); core.LanguageItems.Add(new Framework.Data.LanguageItem(Dialogs.GetLocationForm.STR_OK)); core.LanguageItems.Add(new Framework.Data.LanguageItem(Dialogs.GetLocationForm.STR_MAP)); core.LanguageItems.Add(new Framework.Data.LanguageItem(Dialogs.GetLocationForm.STR_FROMHOMELOC)); core.LanguageItems.Add(new Framework.Data.LanguageItem(Dialogs.GetLocationForm.STR_FROMCENTERLOC)); core.LanguageItems.Add(new Framework.Data.LanguageItem(Dialogs.LiveAPICachesLeftForm.STR_INFO)); core.LanguageItems.Add(new Framework.Data.LanguageItem(Dialogs.LiveAPICachesLeftForm.STR_LEFT)); core.LanguageItems.Add(new Framework.Data.LanguageItem(Dialogs.LiveAPICachesLeftForm.STR_MAX)); core.LanguageItems.Add(new Framework.Data.LanguageItem(Dialogs.LiveAPICachesLeftForm.STR_TITLE)); core.LanguageItems.Add(new Framework.Data.LanguageItem(API.GeocachingLiveV6.STR_ERROR)); core.LanguageItems.Add(new Framework.Data.LanguageItem(API.GeocachingLiveV6.STR_MUSTAUTHORIZE)); core.LanguageItems.Add(new Framework.Data.LanguageItem(API.GeocachingLiveV6.STR_PMREQUIRED)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BasePlugin.BaseUIChildWindowForm.STR_DECOUPLE_WINDOW)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BasePlugin.BaseUIChildWindowForm.STR_DOCK_WINDOW)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BasePlugin.BaseUIChildWindowForm.STR_NOTTOPMOST_WINDOW)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BasePlugin.BaseUIChildWindowForm.STR_TOPMOST_WINDOW)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BasePlugin.BaseUIChildWindowForm.STR_OPAQUEWHENIACTIVE)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BasePlugin.BaseUIChildWindowTransparencyForm.STR_TITLE)); core.LanguageItems.Add(new Framework.Data.LanguageItem(BasePlugin.BaseUIChildWindowTransparencyForm.STR_OPACITY)); core.LanguageItems.Add(new Framework.Data.LanguageItem(Dialogs.GeocachesIgnoredMessageForm.STR_ACTION_EDIT)); core.LanguageItems.Add(new Framework.Data.LanguageItem(Dialogs.GeocachesIgnoredMessageForm.STR_OK)); core.LanguageItems.Add(new Framework.Data.LanguageItem(Dialogs.GeocachesIgnoredMessageForm.STR_WARNING)); core.LanguageItems.Add(new Framework.Data.LanguageItem(Dialogs.GeocachesIgnoredMessageForm.STR_XIGNORED)); foreach (var c in core.LogTypes) { core.LanguageItems.Add(new Framework.Data.LanguageItem(c.Name)); } } _core = core; List<Framework.Interfaces.IPlugin> p = core.GetPlugin(Framework.PluginType.LanguageSupport); if (p != null) { foreach (Framework.Interfaces.ILanguageSupport mwp in p) { if (!_languageModules.Contains(mwp)) { _languageModules.Add(mwp); } } foreach (Framework.Interfaces.IPlugin mwp in _languageModules) { if (!p.Contains(mwp)) { _languageModules.Remove(mwp as Framework.Interfaces.ILanguageSupport); } } } }
private IgnoreService(Framework.Interfaces.ICore core) { _filterFields = new Hashtable(); _core = core; foreach (string s in Enum.GetNames(typeof(FilterField))) { _filterFields.Add(s, new Hashtable()); } try { InitDatabase(core); lock (core.SettingsProvider) { List<FilterFieldPoco> pocos = core.SettingsProvider.Database.Fetch<FilterFieldPoco>(string.Format("select * from {0}", core.SettingsProvider.GetFullTableName("filterfields"))); foreach (var poco in pocos) { Hashtable ht = _filterFields[poco.field] as Hashtable; if (ht != null) { ht.Add(poco.filter, true); } } } } catch { } }
private Favorites(Framework.Interfaces.ICore core) { _favorites = new Hashtable(); _core = core; try { string xml = PluginSettings.Instance.Favorites; if (!string.IsNullOrEmpty(xml)) { XmlDocument doc = new XmlDocument(); doc.LoadXml(xml); XmlElement root = doc.DocumentElement; XmlNodeList bmNodes = root.SelectNodes("code"); if (bmNodes != null) { foreach (XmlNode n in bmNodes) { _favorites.Add(n.InnerText, true); } } } } catch { } }
private Favorites(Framework.Interfaces.ICore core) { _favorites = new Hashtable(); _core = core; try { _databaseFilename = System.IO.Path.Combine(_core.PluginDataPath, "favorites.xml" ); if (System.IO.File.Exists(_databaseFilename)) { XmlDocument doc = new XmlDocument(); doc.Load(_databaseFilename); XmlElement root = doc.DocumentElement; XmlNodeList bmNodes = root.SelectNodes("code"); if (bmNodes != null) { foreach (XmlNode n in bmNodes) { _favorites.Add(n.InnerText, true); } } } } catch { } }
private IgnoreService(Framework.Interfaces.ICore core) { _filterFields = new Hashtable(); _core = core; foreach (string s in Enum.GetNames(typeof(FilterField))) { _filterFields.Add(s, new Hashtable()); } try { _databaseFile = System.IO.Path.Combine(core.PluginDataPath, "ignoregc.db3"); InitDatabase(); using (Utils.DBCon dbcon = new Utils.DBConComSqlite(_databaseFile)) { DbDataReader dr = dbcon.ExecuteReader("select field, filter from filterfields"); while (dr.Read()) { Hashtable ht = _filterFields[dr["field"]] as Hashtable; if (ht != null) { ht.Add(dr["filter"], true); } } } } catch { } }
public GeocachesIgnoredMessageForm(Framework.Interfaces.ICore core, int cnt): this() { _core = core; this.Text = LanguageSupport.Instance.GetTranslation(STR_WARNING); this.label1.Text = string.Format(LanguageSupport.Instance.GetTranslation(STR_XIGNORED), cnt); this.button1.Text = LanguageSupport.Instance.GetTranslation(STR_ACTION_EDIT); this.button2.Text = LanguageSupport.Instance.GetTranslation(STR_OK); }
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 MapForm(Framework.Interfaces.ICore core, string title) { InitializeComponent(); STR_TITLE = title; _core = core; _core.ActiveGeocacheChanged += new Framework.EventArguments.GeocacheEventHandler(_core_ActiveGeocacheChanged); _core.SelectedLanguageChanged += new EventHandler(_core_SelectedLanguageChanged); _core.Geocaches.SelectedChanged += new Framework.EventArguments.GeocacheEventHandler(Geocaches_SelectedChanged); _core.Geocaches.ListSelectionChanged += new EventHandler(Geocaches_ListSelectionChanged); _core.Geocaches.DataChanged += new Framework.EventArguments.GeocacheEventHandler(Geocaches_DataChanged); _core.Geocaches.GeocacheAdded += new Framework.EventArguments.GeocacheEventHandler(Geocaches_GeocacheAdded); _core.Geocaches.GeocacheRemoved += new Framework.EventArguments.GeocacheEventHandler(Geocaches_GeocacheRemoved); _core.Geocaches.ListDataChanged += new EventHandler(Geocaches_ListDataChanged); _core.GPSLocation.Updated += new Framework.EventArguments.GPSLocationEventHandler(GPSLocation_Updated); _core.Waypoints.DataChanged += new Framework.EventArguments.WaypointEventHandler(Waypoints_DataChanged); _core.Waypoints.ListDataChanged += new EventHandler(Waypoints_ListDataChanged); _core_SelectedLanguageChanged(this, EventArgs.Empty); this.mapContainerControl1.tileCanvas.ZoomChanged += new EventHandler<EventArgs>(tileCanvas_ZoomChanged); this.mapContainerControl1.GeocacheClick += new Framework.EventArguments.GeocacheEventHandler(mapContainerControl1_GeocacheClick); /* if (Properties.Settings.Default.WindowPos != null && !Properties.Settings.Default.WindowPos.IsEmpty) { this.Bounds = Properties.Settings.Default.WindowPos; this.StartPosition = FormStartPosition.Manual; } */ _mapControlFactory = MapControl.MapCanvas.MapControlFactoryToUse; if (_mapControlFactory != null) { if (Properties.Settings.Default.SpecifiedWindowPos != null) { for (int i = 0; i < Properties.Settings.Default.SpecifiedWindowPos.Count; i++) { if (Properties.Settings.Default.SpecifiedWindowPos[i].StartsWith(string.Concat(_mapControlFactory.ID, "|"))) { try { string[] parts = Properties.Settings.Default.SpecifiedWindowPos[i].Split(new char[] { '|' }); this.Bounds = new Rectangle(int.Parse(parts[1]), int.Parse(parts[2]), int.Parse(parts[3]), int.Parse(parts[4])); this.StartPosition = FormStartPosition.Manual; break; } catch { } } } } else { Properties.Settings.Default.SpecifiedWindowPos = new System.Collections.Specialized.StringCollection(); } } }
public ActiveNotification(Framework.Interfaces.ICore core) : this() { _core = core; label1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SERVICEACTIVE); label2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_POSITION); button1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_STOP); button2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CENTER); }
public BaseUIMainWindowForm(BaseUIMainWindow ownerPlugin, Framework.Interfaces.ICore core): this() { _core = core; _ownerPlugin = ownerPlugin; LanguageSupport.Instance.UpdateLanguageSupportPlugins(core); core.PluginAdded += new Framework.EventArguments.PluginEventHandler(core_PluginAdded); core.SelectedLanguageChanged += new EventHandler(core_SelectedLanguageChanged); Utils.ImageSupport.Instance.UpdateImageSupportPlugins(core); Utils.GeometrySupport.Instance.UpdateGeometrySupportPlugins(core); }
public GarminCommunicatorForm(Framework.Interfaces.ICore core, List<Framework.Data.Geocache> gcList) { InitializeComponent(); _core = core; _gcList = gcList; if (Properties.Settings.Default.UpgradeNeeded) { Properties.Settings.Default.Upgrade(); Properties.Settings.Default.UpgradeNeeded = false; Properties.Settings.Default.Save(); } numericUpDown1.Value = Properties.Settings.Default.MaxGeocacheNameLength; numericUpDown2.Value = Properties.Settings.Default.MinStartOfGeocacheName; checkBox1.Checked = Properties.Settings.Default.AddFieldNotesToDescription; checkBox2.Checked = Properties.Settings.Default.AddChildWaypoints; checkBox3.Checked = Properties.Settings.Default.UseNameAndNotCode; checkBox4.Checked = Properties.Settings.Default.AddWaypointsToDescription; checkBox5.Checked = Properties.Settings.Default.UseHintsForDescription; comboBox2.Items.Add(Utils.GPXGenerator.V100); comboBox2.Items.Add(Utils.GPXGenerator.V101); comboBox2.Items.Add(Utils.GPXGenerator.V102); textBox1.Text = Properties.Settings.Default.CorrectedNamePrefix ?? ""; if (!string.IsNullOrEmpty(Properties.Settings.Default.GPXVersionStr)) { comboBox2.SelectedItem = Version.Parse(Properties.Settings.Default.GPXVersionStr); } else { comboBox2.SelectedIndex = 0; } button1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_START); this.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE); this.checkBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_INCLNOTES); this.checkBox2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ADDCHILDWAYPOINTS); this.checkBox3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_USENAME); this.checkBox4.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ADDWPTTODESCR); this.checkBox5.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_USEHINTSDESCR); this.label1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_MAXNAMELENGTH); this.label2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_MINSTARTNAME); this.label6.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_GPXVERSION); this.label10.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_EXTRACOORDNAMEPREFIX); tmpFile = new TemporaryFile(true); using (StreamReader textStreamReader = new StreamReader(Assembly.GetExecutingAssembly().GetManifestResourceStream("GlobalcachingApplication.Plugins.ExportGarmin.GarminCommunicator.html"))) { File.WriteAllText(tmpFile.Path, textStreamReader.ReadToEnd()); } webBrowser1.Navigate(string.Format("file://{0}", tmpFile.Path)); toolStripStatusLabel1.Text = string.Format("0/{0}", gcList.Count); toolStripProgressBar1.Maximum = gcList.Count; }
public GCLiveManualForm(Framework.Interfaces.ICore core) :this() { _core = core; this.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE); button1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_AUTHORIZE); button2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CONFIRM); label1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_STEP1); label2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_STEP2); label3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_STEP3); }
public FrameworkDataUpdater(Framework.Interfaces.ICore core) { _core = core; _core.LogImages.BeginUpdate(); _core.GeocacheImages.BeginUpdate(); _core.Logs.BeginUpdate(); _core.Waypoints.BeginUpdate(); _core.UserWaypoints.BeginUpdate(); _core.Geocaches.BeginUpdate(); _inUpdate = true; }
public ImportForm(Framework.Interfaces.ICore core) : this() { _core = core; checkBox1.Checked = Properties.Settings.Default.ImportMissingCaches; checkBox2.Checked = Properties.Settings.Default.BetweenDates; dateTimePicker1.Value = DateTime.Now.AddDays(-7); dateTimePicker2.Value = DateTime.Now; if (Properties.Settings.Default.Usernames == null) { Properties.Settings.Default.Usernames = new System.Collections.Specialized.StringCollection(); } foreach (string s in Properties.Settings.Default.Usernames) { listBox1.Items.Add(s); } button5.Enabled = listBox1.Items.Count > 0; toolTip1.SetToolTip(button6, Utils.LanguageSupport.Instance.GetTranslation(STR_COPYTOCLIPBOARD)); this.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE); this.groupBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_USERS); this.groupBox2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_GETLOGS); this.groupBox3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LOGTYPES); this.button1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_REMOVE); this.button3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_REMOVEANDLOGS); this.label1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_USERNAME); this.button2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ADD); this.checkBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_IMPORTMISSING); this.button4.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_IMPORTSELECTED); this.button5.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_IMPORTALL); this.checkBox2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_BETWEENDATES); this.button7.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SELECTALL); this.button8.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_DESELECTALL); if (Properties.Settings.Default.LogTypes == null) { Properties.Settings.Default.LogTypes = new System.Collections.Specialized.StringCollection(); } long[] lt = new long[] { 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 22, 23, 24, 45, 46, 47 }; var ltl = from a in core.LogTypes where lt.Contains(a.ID) select a; foreach (var gt in ltl) { imageList1.Images.Add(gt.ID.ToString(), Image.FromFile(Utils.ImageSupport.Instance.GetImagePath(core, Framework.Data.ImageSize.Small, gt))); ListViewItem lvt = new ListViewItem(Utils.LanguageSupport.Instance.GetTranslation(gt.Name), imageList1.Images.Count - 1); lvt.Checked = Properties.Settings.Default.LogTypes.Count == 0 || Properties.Settings.Default.LogTypes.Contains(gt.ID.ToString()); lvt.Tag = gt; listView1.Items.Add(lvt); } }
public ImportByRadiusForm(Framework.Interfaces.ICore core):this() { _core = core; this.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE); this.groupBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_AREA); this.label1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LOCATION); this.label2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_RADIUS); this.radioButtonKm.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_KM); this.radioButtonMiles.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_MILES); this.groupBox2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_MODIFIEDSINCE); this.button1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_OK); }
public AddToCalendarForm(Framework.Interfaces.ICore core, List<Framework.Data.Geocache> gcList) : this() { if (Properties.Settings.Default.UpgradeNeeded) { Properties.Settings.Default.Upgrade(); Properties.Settings.Default.UpgradeNeeded = false; Properties.Settings.Default.Save(); } _core = core; checkBoxGoogleAgenda.Checked = Properties.Settings.Default.AddToGoogleCalendar; checkBoxOutlook.Checked = Properties.Settings.Default.AddToOutlook; checkBoxOpenGoogleCalendar.Checked = Properties.Settings.Default.OpenGoogleCalendar; this.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE); this.buttonAddToCalendar.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ADDTOCAL); this.buttonAddNextToCalendar.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ADDONETOCAL); this.buttonSave.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SAVE); this.label13.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ADDTO); this.label12.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_EVENT); this.label1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_START); this.label2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_END); this.label6.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LOCATION); this.label8.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SUMMARY); this.label10.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_DESCRIPTIONB); _calendarEntries = new List<CalendarEntry>(); foreach (var gc in gcList) { CalendarEntry ce = new CalendarEntry(); ce.gc = gc; ce.Enabled = true; ce.StartTime = new DateTime(gc.PublishedTime.Year, gc.PublishedTime.Month, gc.PublishedTime.Day, 9, 0, 0); ce.EndTime = new DateTime(gc.PublishedTime.Year, gc.PublishedTime.Month, gc.PublishedTime.Day, 17, 0, 0); ce.Summary = string.Format("{0}: {1} {2} {3}", Utils.LanguageSupport.Instance.GetTranslation(STR_GEOCACHEEVENT), gc.Name == null ? "" : gc.Name.Replace('"', ' '), Utils.LanguageSupport.Instance.GetTranslation(STR_BY), gc.PlacedBy == null ? "" : gc.PlacedBy.Replace('"', ' ')); ce.Location = Utils.Conversion.GetCoordinatesPresentation(gc.Lat, gc.Lon); ce.Description = string.Format("{0} {1}", Utils.LanguageSupport.Instance.GetTranslation(STR_GEOCACHEEVENT), gc.Url ?? ""); _calendarEntries.Add(ce); checkedListBox1.SetItemChecked(checkedListBox1.Items.Add(ce), true); } buttonAddToCalendar.Enabled = _calendarEntries.Count > 0; buttonAddNextToCalendar.Enabled = _calendarEntries.Count > 0; checkedListBox1_SelectedIndexChanged(this, EventArgs.Empty); labelGoogleExpl.Visible = false; labelICSFilename.Visible = false; labelGoogleExpl.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_GOOGLEXPL); }
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 ServerConnectionForm(ActionBuilder owner, Framework.Interfaces.ICore core) : this() { _owner = owner; _core = core; var af = (owner.ChildForm as ActionBuilderForm).AvailableActionFlows; if (af != null) { foreach (var a in af) { ActionImplementation startAction = (from sa in a.Actions where sa is ActionStart select sa).FirstOrDefault(); if (startAction != null) { FlowInfo fi = new FlowInfo(); fi.Author = ""; fi.Created = DateTime.MinValue; fi.Modified = DateTime.MinValue; fi.Description = ""; fi.Name = a.Name; fi.ID = startAction.ID; fi.IsPublic = false; fi.ActionFlow = a; comboBox1.Items.Add(fi); } } } flowsList1.flowList.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(flowList_SelectionChanged); this.Text = string.Format("{0} - {1}", Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE1), Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE2)); this.groupBox2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SERVERFLOWS); this.groupBox3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_YOURFLOWS); this.radioButton1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_YOURUPLOADED); this.radioButton2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ALLPUBLICFLOWS); this.label3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_DESCRIPTION); this.label6.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_DESCRIPTION); flowsList1.flowList.Columns[0].Header = Utils.LanguageSupport.Instance.GetTranslation(STR_NAME); flowsList1.flowList.Columns[1].Header = Utils.LanguageSupport.Instance.GetTranslation(STR_AUTHOR); flowsList1.flowList.Columns[2].Header = Utils.LanguageSupport.Instance.GetTranslation(STR_CREATED); flowsList1.flowList.Columns[3].Header = Utils.LanguageSupport.Instance.GetTranslation(STR_MODIFIED); flowsList1.flowList.Columns[4].Header = Utils.LanguageSupport.Instance.GetTranslation(STR_PUBLIC); this.button3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_DOWNLOAD); this.button4.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_DELETE); this.label4.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_FLOW); this.button5.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_UPLOAD); this.checkBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_PUBLIC); this.button6.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_OK); }
public SelectByAreaForm(Framework.Interfaces.ICore core) { InitializeComponent(); _core = core; this.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE); this.buttonWholeArea.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SELECTWHOLEAREA); Assembly assembly = Assembly.GetExecutingAssembly(); using (StreamReader textStreamReader = new StreamReader(assembly.GetManifestResourceStream("GlobalcachingApplication.Plugins.OKAPI.ImportByBBoxPage.html"))) { DisplayHtml(textStreamReader.ReadToEnd()); } }
public MunzeeDfxAtForm(Framework.Interfaces.ICore core): this() { _core = core; this.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE); this.groupBox3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_MUNZEECOMACCOUNT); this.groupBox2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SELECTURL); this.groupBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ADD); this.label7.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_NAME); this.label1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_URLS); this.button2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ADD); this.button3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_REMOVE); this.button4.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_OK); this.label2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_URL); this.label5.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_COMMENT); this.label6.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_INFO); textBox3.Text = Properties.Settings.Default.AccountName; try { _urlsFile = System.IO.Path.Combine( _core.PluginDataPath, "MunzeeDfxAt.xml" ); if (System.IO.File.Exists(_urlsFile)) { XmlDocument doc = new XmlDocument(); doc.Load(_urlsFile); XmlElement root = doc.DocumentElement; XmlNodeList bmNodes = root.SelectNodes("url"); if (bmNodes != null) { foreach (XmlNode n in bmNodes) { UrlInfo bm = new UrlInfo(); bm.Url = n.SelectSingleNode("Url").InnerText; bm.Comment = n.SelectSingleNode("Comment").InnerText; _urlInfos.Add(bm); } } listBox1.Items.AddRange(_urlInfos.ToArray()); } } catch { } }