示例#1
0
 public GPXGenerator(Framework.Interfaces.ICore core, List<Framework.Data.Geocache> gcList, Version gpxVersion)
 {
     _core = core;
     _gcList = gcList;
     _gpxVersion = gpxVersion;
     _index = 0;
 }
示例#2
0
        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);
                    }
                }
            }
        }
示例#3
0
文件: Favorites.cs 项目: RH-Code/GAPP
        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
            {
            }
        }
示例#4
0
        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;
        }
示例#5
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);
        }
示例#6
0
        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();
        }
示例#7
0
        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);
        }
示例#8
0
文件: Plugin.cs 项目: gahadzikwa/GAPP
 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;
 }
示例#9
0
        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;
            }
        }
示例#10
0
        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
            {
            }
        }
示例#11
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();
            }

        }
示例#12
0
        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);
        }
示例#13
0
        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();
            }
        }
示例#14
0
        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
            {
            }
        }
示例#15
0
        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
            {
            }
        }
示例#16
0
        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);
            }
        }
示例#17
0
        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);
        }
示例#18
0
文件: MapForm.cs 项目: RH-Code/GAPP
        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();
                }
            }
        }
示例#19
0
 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);
 }
示例#20
0
        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);
        }
示例#21
0
        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;
        }
示例#22
0
 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);
 }
示例#23
0
 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;
 }
示例#24
0
        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);
            }

        }
示例#25
0
        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);
        }
示例#26
0
        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);
        }
示例#27
0
        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;
        }
示例#28
0
        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);
        }
示例#29
0
        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());
            }
        }
示例#30
0
        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
            {
            }

        }
示例#31
0
 public BrowserScriptRework(WebbrowserForm.BrowserTab browserTab, Utils.BasePlugin.Plugin ownerPlugin, WebBrowser webBrowser, Framework.Interfaces.ICore core)
     : base(browserTab, ownerPlugin, "Rework", webBrowser, core, true)
 {
     core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_REWORK));
     webBrowser.Navigating        += new WebBrowserNavigatingEventHandler(webBrowser_Navigating);
     webBrowser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBrowser_DocumentCompleted);
 }
示例#32
0
 public PropertyItemAvailable(Framework.Interfaces.ICore core)
     : base(core, PropertyName.STR_AVAILABLE)
 {
 }
示例#33
0
        public static Framework.Data.Geocache Geocache(Framework.Interfaces.ICore core, LiveV6.Geocache gc)
        {
            Framework.Data.Geocache result = null;
            if (gc != null)
            {
                Framework.Data.Geocache tmp = DataAccess.GetGeocache(core.Geocaches, gc.Code);
                result = new Framework.Data.Geocache();
                if (tmp != null)
                {
                    result.UpdateFrom(tmp, null);
                }
                result.Code      = gc.Code;
                result.ID        = gc.ID.ToString();
                result.Archived  = gc.Archived ?? false;
                result.Available = gc.Available ?? true;
                result.Container = DataAccess.GetGeocacheContainer(core.GeocacheContainers, (int)gc.ContainerType.ContainerTypeId);
                if (gc.Attributes != null)
                {
                    List <int> attr = new List <int>();
                    foreach (LiveV6.Attribute a in gc.Attributes)
                    {
                        attr.Add(a.IsOn ? a.AttributeTypeID : -1 * a.AttributeTypeID);
                    }
                    result.AttributeIds = attr;
                }
                if (gc.Latitude != null)
                {
                    result.Lat = (double)gc.Latitude;
                }
                if (gc.Longitude != null)
                {
                    result.Lon = (double)gc.Longitude;
                }
                if (gc.Country != null)
                {
                    result.Country = gc.Country;
                }
                result.DataFromDate = DateTime.Now;
                result.Difficulty   = gc.Difficulty;
                result.Terrain      = gc.Terrain;
                result.Title        = gc.Name;
                if (gc.FavoritePoints != null)
                {
                    result.Favorites = (int)gc.FavoritePoints;
                }
                result.GeocacheType = DataAccess.GetGeocacheType(core.GeocacheTypes, (int)gc.CacheType.GeocacheTypeId);
                if (gc.LongDescription != null)
                {
                    result.LongDescription       = gc.LongDescription;
                    result.LongDescriptionInHtml = gc.LongDescriptionIsHtml;
                }
                if (gc.EncodedHints != null)
                {
                    result.EncodedHints = gc.EncodedHints;
                }
                result.MemberOnly = gc.IsPremium ?? false;
                result.Owner      = gc.Owner.UserName;
                if (gc.Owner.Id != null)
                {
                    result.OwnerId = gc.Owner.Id.ToString();
                }
                result.PlacedBy      = gc.PlacedBy;
                result.PublishedTime = gc.UTCPlaceDate;
                if (result.ShortDescription != null)
                {
                    result.ShortDescription       = gc.ShortDescription;
                    result.ShortDescriptionInHtml = gc.ShortDescriptionIsHtml;
                }
                if (gc.State == "None")
                {
                    result.State = "";
                }
                else
                {
                    result.State = gc.State;
                }
                result.PersonaleNote = gc.GeocacheNote;
                if (gc.HasbeenFoundbyUser != null)
                {
                    result.Found = (bool)gc.HasbeenFoundbyUser;
                }
                result.Url           = gc.Url;
                result.PersonaleNote = gc.GeocacheNote ?? "";

                Calculus.SetDistanceAndAngleGeocacheFromLocation(result, core.CenterLocation);
            }
            return(result);
        }
示例#34
0
 public PropertyItemPublished(Framework.Interfaces.ICore core)
     : base(core, PropertyName.STR_PUBLISHED)
 {
 }
示例#35
0
 public PropertyItemRDy(Framework.Interfaces.ICore core)
     : base(core, PropertyName.STR_RDY)
 {
 }
示例#36
0
 public ThumbInfoItem(ThumbInfo imgInfo, Framework.Interfaces.ICore core)
 {
     InitializeComponent();
     _imgInfo = imgInfo;
     _core    = core;
 }
示例#37
0
 public PropertyItemName(Framework.Interfaces.ICore core)
     : base(core, PropertyName.STR_NAME)
 {
 }
示例#38
0
        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);
                                }
                            }
                        }
                    }
            }
        }
示例#39
0
        public async override Task <bool> InitializeAsync(Framework.Interfaces.ICore core)
        {
            AddAction(ACTION_EXPORT_ALL);
            AddAction(ACTION_EXPORT_SELECTED);

            var p = new PluginSettings(core);

            core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_NOGEOCACHESELECTED));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_ERROR));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_EXPORTINGPOI));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_CREATINGFILE));

            core.LanguageItems.Add(new Framework.Data.LanguageItem(ExportForm.STR_ADD));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(ExportForm.STR_DELETE));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(ExportForm.STR_EXPORT));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(ExportForm.STR_FIELDS));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(ExportForm.STR_FILE));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(ExportForm.STR_NAME));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(ExportForm.STR_SHEETS));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(ExportForm.STR_TITLE));

            PropertyItem ppi;

            ppi = new PropertyItemCode(core);
            ppi = new PropertyItemName(core);
            ppi = new PropertyItemPublished(core);
            ppi = new PropertyItemLat(core);
            ppi = new PropertyItemLon(core);
            ppi = new PropertyItemCoordinate(core);
            ppi = new PropertyItemAvailable(core);
            ppi = new PropertyItemArchived(core);
            ppi = new PropertyItemCountry(core);
            ppi = new PropertyItemState(core);
            ppi = new PropertyItemMunicipality(core);
            ppi = new PropertyItemCity(core);
            ppi = new PropertyItemType(core);
            ppi = new PropertyItemPlacedBy(core);
            ppi = new PropertyItemOwner(core);
            ppi = new PropertyItemContainer(core);
            ppi = new PropertyItemTerrain(core);
            ppi = new PropertyItemDifficulty(core);
            ppi = new PropertyItemDescriptionText(core);
            ppi = new PropertyItemDescriptionHTML(core);
            ppi = new PropertyItemUrl(core);
            ppi = new PropertyItemMemberOnly(core);
            ppi = new PropertyItemCustomLat(core);
            ppi = new PropertyItemCustomLon(core);
            ppi = new PropertyItemCustomCoordinate(core);
            ppi = new PropertyItemAutoCoordinate(core);
            ppi = new PropertyItemFavorites(core);
            ppi = new PropertyItemPersonalNotes(core);
            ppi = new PropertyItemNotes(core);
            ppi = new PropertyItemFlagged(core);
            ppi = new PropertyItemFound(core);
            ppi = new PropertyItemFoundDate(core);
            ppi = new PropertyItemHints(core);
            ppi = new PropertyItemGCVote(core);
#if DEBUG
            ppi = new PropertyItemRDx(core);
            ppi = new PropertyItemRDy(core);
            ppi = new PropertyItemEnvelopAreaOther(core);
            ppi = new PropertyItemInAreaOther(core);
            ppi = new PropertyItemGlobalcachingUrl(core);
#endif
            return(await base.InitializeAsync(core));
        }
示例#40
0
        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
                        }
                    }
            }
        }
示例#41
0
 public async override Task <bool> InitializeAsync(Framework.Interfaces.ICore core)
 {
     AddAction(ACTION_SELECTPRESENT);
     AddAction(ACTION_SELECTNOTPRESENT);
     return(await base.InitializeAsync(core));
 }
示例#42
0
 protected virtual BaseUIMainWindowForm CreateUIMainWindowForm(Framework.Interfaces.ICore core)
 {
     return(new BaseUIMainWindowForm(this, core));
 }
示例#43
0
 public async override Task <bool> InitializeAsync(Framework.Interfaces.ICore core)
 {
     _baseImagePath = Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location), "Images");
     return(await base.InitializeAsync(core));
 }
示例#44
0
 public GeocachingLiveV6(Framework.Interfaces.ICore core)
     : this(core, false)
 {
 }
示例#45
0
文件: Map.cs 项目: pheijmans-zz/GAPP
 protected override Utils.BasePlugin.BaseUIChildWindowForm CreateUIChildWindowForm(Framework.Interfaces.ICore core)
 {
     return(new MapForm(this, core));
 }
示例#46
0
 public UserHelp(ITempDirProvider tmpDirProvider, Framework.Interfaces.ICore core)
 {
     _tmpDirProvider = tmpDirProvider;
     _core           = core;
     InitializeComponent();
 }
示例#47
0
 public PropertyItemCode(Framework.Interfaces.ICore core)
     : base(core, PropertyName.STR_CODE)
 {
 }
示例#48
0
 public ImportForm(Framework.Interfaces.ICore core, string name, string url)
     : this(core)
 {
     textBox2.Text = name;
     textBox1.Text = url;
 }
示例#49
0
 public PropertyItemLon(Framework.Interfaces.ICore core)
     : base(core, PropertyName.STR_LON)
 {
 }
示例#50
0
        public async override Task <bool> InitializeAsync(Framework.Interfaces.ICore core)
        {
            //AddAction(ACTION_SHOW);

            return(await base.InitializeAsync(core));
        }
示例#51
0
 public PropertyItemCoordinate(Framework.Interfaces.ICore core)
     : base(core, PropertyName.STR_COORDINATE)
 {
 }
示例#52
0
        public ActionBuilderForm(Framework.Interfaces.IPlugin owner, Framework.Interfaces.ICore core)
            : base(owner, core)
        {
            InitializeComponent();

            ActionBuilderFormInstance = this;

            var p = PluginSettings.Instance.WindowPos;

            if (p != null && !p.IsEmpty)
            {
                this.Bounds        = p;
                this.StartPosition = FormStartPosition.Manual;
            }

            actionBuilderEditor1.ShowConnectionLabels(PluginSettings.Instance.ShowConnectionLabel);

            loadFlowsFile();

            splitContainer1.SplitterDistance = PluginSettings.Instance.LeftPanelWidth;
            if (splitContainer2.Width > PluginSettings.Instance.RightPanelWidth)
            {
                splitContainer2.SplitterDistance = splitContainer2.Width - PluginSettings.Instance.RightPanelWidth;
            }

            _sizeInitializing = false;

            try
            {
                Assembly asm   = Assembly.GetExecutingAssembly();
                Type[]   types = asm.GetTypes();
                foreach (Type t in types)
                {
                    if (t.IsClass && (t.BaseType == typeof(ActionImplementationCondition)))
                    {
                        ConstructorInfo constructor       = t.GetConstructor(new Type[] { typeof(Framework.Interfaces.ICore) });
                        object[]        parameters        = new object[] { core };
                        ActionImplementationCondition obj = (ActionImplementationCondition)constructor.Invoke(parameters);

                        //exception for the start
                        if (obj is ActionStart)
                        {
                            //skip. auto
                        }
                        else
                        {
                            Button b = new Button();
                            b.Dock       = DockStyle.Top;
                            b.Tag        = obj;
                            b.Height     = 25;
                            b.Click     += new EventHandler(b_Click);
                            b.MouseDown += new MouseEventHandler(b_MouseDown);
                            b.MouseMove += new MouseEventHandler(b_MouseMove);
                            panel3.Controls.Add(b);

                            core.LanguageItems.Add(new Framework.Data.LanguageItem(obj.Name));
                        }
                    }
                }
                foreach (Type t in types)
                {
                    if (t.IsClass && (t.BaseType == typeof(ActionImplementationExecuteOnce)))
                    {
                        ConstructorInfo constructor         = t.GetConstructor(new Type[] { typeof(Framework.Interfaces.ICore) });
                        object[]        parameters          = new object[] { core };
                        ActionImplementationExecuteOnce obj = (ActionImplementationExecuteOnce)constructor.Invoke(parameters);

                        Button b = new Button();
                        b.Dock       = DockStyle.Top;
                        b.Tag        = obj;
                        b.Height     = 25;
                        b.Click     += new EventHandler(b_Click);
                        b.MouseDown += new MouseEventHandler(b_MouseDown);
                        b.MouseMove += new MouseEventHandler(b_MouseMove);
                        panel5.Controls.Add(b);

                        core.LanguageItems.Add(new Framework.Data.LanguageItem(obj.Name));
                    }
                }
                Label la = new Label();
                la.AutoSize  = false;
                la.TextAlign = ContentAlignment.MiddleCenter;
                la.Dock      = DockStyle.Top;
                la.Text      = Utils.LanguageSupport.Instance.GetTranslation(STR_EXECUTEONCE);
                panel5.Controls.Add(la);
                _executeOnceLabel = la;
                foreach (Type t in types)
                {
                    if (t.IsClass && (t.BaseType == typeof(ActionImplementationAction)))
                    {
                        ConstructorInfo            constructor = t.GetConstructor(new Type[] { typeof(Framework.Interfaces.ICore) });
                        object[]                   parameters  = new object[] { core };
                        ActionImplementationAction obj         = (ActionImplementationAction)constructor.Invoke(parameters);

                        //exception for the start
                        Button b = new Button();
                        b.Dock       = DockStyle.Top;
                        b.Tag        = obj;
                        b.Height     = 25;
                        b.Click     += new EventHandler(b_Click);
                        b.MouseDown += new MouseEventHandler(b_MouseDown);
                        b.MouseMove += new MouseEventHandler(b_MouseMove);
                        panel5.Controls.Add(b);

                        core.LanguageItems.Add(new Framework.Data.LanguageItem(obj.Name));
                    }
                }
            }
            catch
            {
            }

            SelectedLanguageChanged(this, EventArgs.Empty);
        }
 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);
 }
示例#54
0
 public MapControlFactoryOSMOffline(Framework.Interfaces.ICore core)
     : base(core)
 {
 }
示例#55
0
 public async virtual Task <bool> InitializeAsync(Framework.Interfaces.ICore core)
 {
     return(await InitializeAsync(core, null));
 }
示例#56
0
 public GPXProcessor(Framework.Interfaces.ICore core)
 {
     _core = core;
 }
示例#57
0
 public PropertyItemInAreaOther(Framework.Interfaces.ICore core)
     : base(core, PropertyName.STR_INAREA_OTHER)
 {
 }
示例#58
0
        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));
        }
示例#59
0
        public static Framework.Data.Geocache Geocache(Framework.Interfaces.ICore core, OKAPIService.Geocache gc)
        {
            Framework.Data.Geocache result = null;
            if (gc != null)
            {
                Framework.Data.Geocache tmp = Utils.DataAccess.GetGeocache(core.Geocaches, gc.code);
                result = new Framework.Data.Geocache();
                if (tmp != null)
                {
                    result.UpdateFrom(tmp, null);
                }
                result.DataFromDate = DateTime.Now;
                result.Code         = gc.code;
                result.ID           = gc.code;
                result.Archived     = gc.status == "Archived";
                result.Available    = gc.status == "Available";

                List <int> attris = new List <int>();
                foreach (string at in gc.attr_acodes)
                {
                    int code = OKAPIService.MapAttributeACodeToAttributeID(at);
                    if (code > 0)
                    {
                        attris.Add(code);
                    }
                }
                result.AttributeIds = attris;

                // 'none', 'nano', 'micro', 'small', 'regular', 'large', 'xlarge', 'other'
                // we chose to map the containers
                if (gc.size2 == "none")
                {
                    result.Container = Utils.DataAccess.GetGeocacheContainer(core.GeocacheContainers, 5);
                }
                else if (gc.size2 == "micro" || gc.size2 == "nano")
                {
                    result.Container = Utils.DataAccess.GetGeocacheContainer(core.GeocacheContainers, 2);
                }
                else if (gc.size2 == "small")
                {
                    result.Container = Utils.DataAccess.GetGeocacheContainer(core.GeocacheContainers, 8);
                }
                else if (gc.size2 == "regular")
                {
                    result.Container = Utils.DataAccess.GetGeocacheContainer(core.GeocacheContainers, 3);
                }
                else if (gc.size2 == "large" || gc.size2 == "xlarge")
                {
                    result.Container = Utils.DataAccess.GetGeocacheContainer(core.GeocacheContainers, 4);
                }
                else
                {
                    result.Container = Utils.DataAccess.GetGeocacheContainer(core.GeocacheContainers, 6);
                }
                result.Country      = gc.country ?? "";
                result.Difficulty   = gc.difficulty;
                result.EncodedHints = gc.hint2;
                result.Found        = gc.is_found;
                if (gc.type.ToLower().Contains("traditional"))
                {
                    result.GeocacheType = Utils.DataAccess.GetGeocacheType(core.GeocacheTypes, 96001);
                }
                else if (gc.type.ToLower().Contains("multi"))
                {
                    result.GeocacheType = Utils.DataAccess.GetGeocacheType(core.GeocacheTypes, 96002);
                }
                else if (gc.type.ToLower().Contains("quiz") || gc.type.ToLower().Contains("puzzle"))
                {
                    result.GeocacheType = Utils.DataAccess.GetGeocacheType(core.GeocacheTypes, 96008);
                }
                else if (gc.type.ToLower().Contains("virtual"))
                {
                    result.GeocacheType = Utils.DataAccess.GetGeocacheType(core.GeocacheTypes, 96003);
                }
                else if (gc.type.ToLower().Contains("event"))
                {
                    result.GeocacheType = Utils.DataAccess.GetGeocacheType(core.GeocacheTypes, 96004);
                }
                else if (gc.type.ToLower().Contains("webcam"))
                {
                    result.GeocacheType = Utils.DataAccess.GetGeocacheType(core.GeocacheTypes, 96006);
                }
                else if (gc.type.ToLower().Contains("location") || gc.type.Contains("moving"))
                {
                    result.GeocacheType = Utils.DataAccess.GetGeocacheType(core.GeocacheTypes, 96007);
                }
                else
                {
                    result.GeocacheType = Utils.DataAccess.GetGeocacheType(core.GeocacheTypes, 96005);
                }
                result.Lat                    = Utils.Conversion.StringToDouble(gc.location.Substring(0, gc.location.IndexOf('|')));
                result.Lon                    = Utils.Conversion.StringToDouble(gc.location.Substring(gc.location.IndexOf('|') + 1));
                result.LongDescription        = gc.description;
                result.LongDescriptionInHtml  = true;
                result.Name                   = gc.name;
                result.Owner                  = gc.owner.username;
                result.OwnerId                = gc.owner.uuid;
                result.PlacedBy               = gc.owner.username;
                result.PublishedTime          = DateTime.Parse(gc.date_hidden);
                result.ShortDescription       = "";
                result.ShortDescriptionInHtml = true;
                result.State                  = gc.state ?? "";
                result.Terrain                = gc.terrain;
                result.Url                    = gc.url ?? "";

                Calculus.SetDistanceAndAngleGeocacheFromLocation(result, core.CenterLocation);
            }
            return(result);
        }
 public MapControlFactoryGoogle(Framework.Interfaces.ICore core)
     : base(core)
 {
 }