Exemplo n.º 1
0
        public EditorForm(Framework.Interfaces.IPlugin owner, Framework.Interfaces.ICore core)
            : base(owner, core)
        {
            InitializeComponent();

            var p = PluginSettings.Instance.WindowPos;

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

            SelectedLanguageChanged(this, EventArgs.Empty);

            Repository.Instance.Initialize(core);
            comboBox1.Items.AddRange(Repository.Instance.AvailableBookmarks.ToArray());

            Repository.Instance.DataChanged += new EventHandler(Instance_DataChanged);

            core.ActiveGeocacheChanged          += new Framework.EventArguments.GeocacheEventHandler(core_ActiveGeocacheChanged);
            core.Geocaches.DataChanged          += new Framework.EventArguments.GeocacheEventHandler(Geocaches_DataChanged);
            core.Geocaches.ListDataChanged      += new EventHandler(Geocaches_ListDataChanged);
            core.Geocaches.SelectedChanged      += new Framework.EventArguments.GeocacheEventHandler(Geocaches_SelectedChanged);
            core.Geocaches.ListSelectionChanged += new EventHandler(Geocaches_ListSelectionChanged);
        }
Exemplo n.º 2
0
 public void OnPluginAdded(Framework.Interfaces.IPlugin p)
 {
     if (PluginAdded != null)
     {
         PluginAdded(this, new Framework.EventArguments.PluginEventArgs(p));
     }
 }
Exemplo n.º 3
0
 public void DebugLog(Framework.Data.DebugLogLevel level, Framework.Interfaces.IPlugin p, Exception e, string msg)
 {
     if (DebugLogAdded != null)
     {
         DebugLogAdded(this, new Framework.EventArguments.DebugLogEventArgs(level, p, e, msg));
     }
 }
Exemplo n.º 4
0
 public virtual void AddAction(Framework.Interfaces.IPlugin plugin, string action, string subaction)
 {
     if (_uiMainWindowForm != null)
     {
         _uiMainWindowForm.AddAction(plugin, action, subaction);
     }
 }
Exemplo n.º 5
0
        public AutoGeocachePickerForm(Framework.Interfaces.IPlugin owner, Framework.Interfaces.ICore core)
            : base(owner, core)
        {
            InitializeComponent();

            _context = SynchronizationContext.Current;
            if (_context == null)
            {
                _context = new SynchronizationContext();
            }

            if (Properties.Settings.Default.UpgradeNeeded)
            {
                Properties.Settings.Default.Upgrade();
                Properties.Settings.Default.UpgradeNeeded = false;
                Properties.Settings.Default.Save();
            }

            if (Properties.Settings.Default.WindowPos != null && !Properties.Settings.Default.WindowPos.IsEmpty)
            {
                this.Location      = Properties.Settings.Default.WindowPos.Location;
                this.StartPosition = FormStartPosition.Manual;
            }

            SelectedLanguageChanged(this, EventArgs.Empty);
        }
Exemplo n.º 6
0
        public QueryBuilderForm(Framework.Interfaces.IPlugin owner, Framework.Interfaces.ICore core)
            : base(owner, core)
        {
            InitializeComponent();

            _queriesFileName = System.IO.Path.Combine(new string[] { core.PluginDataPath, "FreeQueries.xml" });

            try
            {
                if (System.IO.File.Exists(_queriesFileName))
                {
                    XmlDocument doc = new XmlDocument();
                    doc.Load(_queriesFileName);
                    XmlNodeList nl = doc.SelectNodes("/queries/query");
                    foreach (XmlNode n in nl)
                    {
                        FreeQuery fq = new FreeQuery(this, n);

                        _freeQueries.Add(fq);
                        comboBox1.Items.Add(fq);
                    }
                }
            }
            catch
            {
            }

            SelectedLanguageChanged(this, EventArgs.Empty);
        }
Exemplo n.º 7
0
        public PackageManagerForm(Framework.Interfaces.IPlugin owner, Framework.Interfaces.ICore core)
            : base(owner, core)
        {
            InitializeComponent();

            _context = SynchronizationContext.Current;
            if (_context == null)
            {
                _context = new SynchronizationContext();
            }

            _columnHeaders = (from ColumnHeader c in listView1.Columns select c.Text).ToArray();
            foreach (string s in _columnHeaders)
            {
                core.LanguageItems.Add(new Framework.Data.LanguageItem(s));
            }

            if (Properties.Settings.Default.UpgradeNeeded)
            {
                Properties.Settings.Default.Upgrade();
                Properties.Settings.Default.UpgradeNeeded = false;
                Properties.Settings.Default.Save();
            }

            listView1.ListViewItemSorter = new Utils.ListViewColumnSorter();
            (listView1.ListViewItemSorter as Utils.ListViewColumnSorter).SortColumn = 0;
            (listView1.ListViewItemSorter as Utils.ListViewColumnSorter).Order      = SortOrder.Ascending;

            SelectedLanguageChanged(this, EventArgs.Empty);
        }
Exemplo n.º 8
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;
            }
        }
Exemplo n.º 9
0
 protected async virtual Task PluginAddedAsync(Framework.Interfaces.IPlugin plugin)
 {
     if (plugin != null && plugin.PluginType == Framework.PluginType.UIMainWindow)
     {
         await InitUIMainWindowAsync(plugin as Framework.Interfaces.IPluginUIMainWindow);
     }
 }
Exemplo n.º 10
0
        public ImageGalleryForm(Framework.Interfaces.IPlugin owner, Framework.Interfaces.ICore core)
            : base(owner, core)
        {
            InitializeComponent();

            try
            {
                _databaseFile = System.IO.Path.Combine(new string[] { core.PluginDataPath, "gallery.db3" });
                string p = System.IO.Path.Combine(new string[] { core.PluginDataPath, "ImageGallery" });
                if (!System.IO.Directory.Exists(p))
                {
                    System.IO.Directory.CreateDirectory(p);
                }
                _imgFolder = p;
                p          = System.IO.Path.Combine(new string[] { p, "Thumps" });
                if (!System.IO.Directory.Exists(p))
                {
                    System.IO.Directory.CreateDirectory(p);
                }
                _thumbFolder = p;
            }
            catch
            {
            }

            SelectedLanguageChanged(this, EventArgs.Empty);
            core.ActiveGeocacheChanged += new Framework.EventArguments.GeocacheEventHandler(core_ActiveGeocacheChanged);
        }
Exemplo n.º 11
0
 public ProgressEventArgs(Framework.Interfaces.IPlugin plugin, string actionTitle, string actionText, int max, int position)
 {
     Plugin      = plugin;
     ActionTitle = actionTitle;
     ActionText  = actionText;
     Max         = max;
     Position    = position;
 }
Exemplo n.º 12
0
 public ProgressEventArgs(Framework.Interfaces.IPlugin plugin, string actionTitle, string actionText, int max, int position)
 {
     Plugin = plugin;
     ActionTitle = actionTitle;
     ActionText = actionText;
     Max = max;
     Position = position;
 }
Exemplo n.º 13
0
        public LogViewForm(Framework.Interfaces.IPlugin owner, Framework.Interfaces.ICore core)
            : base(owner, core)
        {
            InitializeComponent();
            comboBox1.Items.AddRange(Enum.GetNames(typeof(Framework.Data.DebugLogLevel)));
            comboBox1.SelectedItem = Enum.GetName(typeof(Framework.Data.DebugLogLevel), Framework.Data.DebugLogLevel.Info);

            SelectedLanguageChanged(this, EventArgs.Empty);
        }
Exemplo n.º 14
0
 public BaseUIChildWindowForm(Framework.Interfaces.IPlugin owner, Framework.Interfaces.ICore core)
     : this()
 {
     _core  = core;
     _owner = owner;
     LanguageSupport.Instance.UpdateLanguageSupportPlugins(core);
     core.SelectedLanguageChanged += new EventHandler(core_SelectedLanguageChanged);
     Utils.ImageSupport.Instance.UpdateImageSupportPlugins(core);
     Utils.GeometrySupport.Instance.UpdateGeometrySupportPlugins(core);
 }
Exemplo n.º 15
0
        public virtual void RemoveAction(Framework.Interfaces.IPlugin plugin, string action, string subAction)
        {
            PluginAction pa = (from p in _pluginActionList where p.plugin == plugin && p.action == action && p.subaction == subAction select p).FirstOrDefault();

            if (pa != null)
            {
                RemovePluginAction(pa);
                _pluginActionList.Remove(pa);
            }
        }
Exemplo n.º 16
0
        public DashboardForm(Framework.Interfaces.IPlugin owner, Framework.Interfaces.ICore core)
            : base(owner, core)
        {
            InitializeComponent();

            core.ActiveGeocacheChanged += new Framework.EventArguments.GeocacheEventHandler(core_ActiveGeocacheChanged);
            SelectedLanguageChanged(this, EventArgs.Empty);
            core.Geocaches.DataChanged     += new Framework.EventArguments.GeocacheEventHandler(Geocaches_DataChanged);
            core.Geocaches.ListDataChanged += new EventHandler(Geocaches_ListDataChanged);
        }
Exemplo n.º 17
0
 private async void deleteGeocacheToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (Core.ActiveGeocache != null)
     {
         Framework.Interfaces.IPlugin p = Utils.PluginSupport.PluginByName(Core, "GlobalcachingApplication.Plugins.QuickAc.Actions");
         if (p != null)
         {
             await p.ActionAsync("Delete|Active");
         }
     }
 }
Exemplo n.º 18
0
        public WPEditorForm(Framework.Interfaces.IPlugin owner, Framework.Interfaces.ICore core)
            : base(owner, core)
        {
            InitializeComponent();

            comboBoxWaypointType1.SetWaypointTypes(core, core.WaypointTypes.ToList());

            SelectedLanguageChanged(this, EventArgs.Empty);
            core.ActiveGeocacheChanged     += new Framework.EventArguments.GeocacheEventHandler(core_ActiveGeocacheChanged);
            core.Geocaches.DataChanged     += new Framework.EventArguments.GeocacheEventHandler(Geocaches_DataChanged);
            core.Geocaches.ListDataChanged += new EventHandler(Geocaches_ListDataChanged);
        }
Exemplo n.º 19
0
        public virtual void AddAction(Framework.Interfaces.IPlugin plugin, string action)
        {
            PluginAction pa = new PluginAction();

            pa.plugin = plugin;
            pa.action = action;
            pa.Tag    = null;
            _pluginActionList.Add(pa);

            plugin.Closing += new Framework.EventArguments.PluginEventHandler(plugin_Closing);
            AddPluginAction(pa);
        }
Exemplo n.º 20
0
        public SettingsPanel(Framework.Interfaces.ICore core)
            : this()
        {
            this.label1.Text     = Utils.LanguageSupport.Instance.GetTranslation(STR_INFO);
            this.buttonSort.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SORT);

            //first the selected
            if (PluginSettings.Instance.Startup != null && PluginSettings.Instance.Startup.Count > 0)
            {
                foreach (string s in PluginSettings.Instance.Startup)
                {
                    string[] parts = s.Split(new char[] { '@' }, 2);
                    Framework.Interfaces.IPlugin p = Utils.PluginSupport.PluginByName(core, parts[0]);
                    if (p != null)
                    {
                        List <string> actions = p.GetActionSubactionList('@');
                        if (actions.Contains(parts[1]))
                        {
                            string[]     act = parts[1].Split(new char[] { '@' });
                            ListViewItem lvi = new ListViewItem(new string[] { p.GetType().ToString(), Utils.LanguageSupport.Instance.GetTranslation(parts[0]), act.Length == 1 ? "" : Utils.LanguageSupport.Instance.GetTranslation(act[1]), "" });
                            lvi.Tag     = s;
                            lvi.Checked = true;
                            listView1.Items.Add(lvi);
                        }
                    }
                }
            }

            List <Framework.Interfaces.IPlugin> pins = core.GetPlugins();

            foreach (Framework.Interfaces.IPlugin p in pins)
            {
                List <string> actions = p.GetActionSubactionList('@');
                foreach (string act in actions)
                {
                    string stag = string.Format("{0}@{1}", p.GetType(), act);
                    if ((PluginSettings.Instance.Startup == null || !PluginSettings.Instance.Startup.Contains(stag)))
                    {
                        string[]     parts = act.Split(new char[] { '@' });
                        ListViewItem lvi   = new ListViewItem(new string[] { p.GetType().ToString(), Utils.LanguageSupport.Instance.GetTranslation(parts[0]), parts.Length == 1 ? "" : Utils.LanguageSupport.Instance.GetTranslation(parts[1]), "" });
                        lvi.Tag     = stag;
                        lvi.Checked = false;
                        listView1.Items.Add(lvi);
                    }
                }
            }
            ListViewColumnSorter lvs = new ListViewColumnSorter();

            listView1.ListViewItemSorter = lvs;
            listView1.Sort();
        }
Exemplo n.º 21
0
        protected bool LoadAssembly(List <Framework.Interfaces.IPlugin> pins, string fn)
        {
            bool result = true;

            fn = fn.ToLower();
            if (fn.EndsWith(".dll") || fn.EndsWith(".exe"))
            {
                try
                {
                    Assembly asmbly = Assembly.LoadFrom(fn);
                    Type[]   types  = asmbly.GetTypes();
                    if (LoadingAssembly != null)
                    {
                        LoadingAssembly(this, fn);
                    }
                    foreach (Type t in types)
                    {
                        // Only select classes that implemented IPlugin
                        if (t.IsClass && ((IList)t.GetInterfaces()).Contains(typeof(Framework.Interfaces.IPlugin)))
                        {
                            bool isInternalStorage = ((IList)t.GetInterfaces()).Contains(typeof(Framework.Interfaces.IPluginInternalStorage));
                            if (isInternalStorage)
                            {
                                _internalStoragePlugins.Add(t.FullName);
                            }
                            else
                            {
                                _detectedPlugins.Add(t.FullName);
                            }
                            if (!isInternalStorage || ActiveInternalStoragePlugin == t.FullName)
                            {
                                //var dpil = _settingsProvider.GetSettingsValueStringCollection("Core.DisabledPlugins", null);
                                //if (dpil == null || !dpil.Contains(t.FullName))
                                {
                                    ConstructorInfo constructor         = t.GetConstructor(new Type[0]);
                                    object[]        parameters          = new object[0];
                                    Framework.Interfaces.IPlugin plugin = (Framework.Interfaces.IPlugin)constructor.Invoke(parameters);
                                    pins.Add(plugin);
                                }
                            }
                        }
                    }
                }
                catch
                {
                    //not an assembly
                }
            }
            return(result);
        }
Exemplo n.º 22
0
        public AttachementsForm(Framework.Interfaces.IPlugin owner, Framework.Interfaces.ICore core)
            : base(owner, core)
        {
            InitializeComponent();

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

            SelectedLanguageChanged(this, EventArgs.Empty);
            core.ActiveGeocacheChanged += new Framework.EventArguments.GeocacheEventHandler(core_ActiveGeocacheChanged);
        }
Exemplo n.º 23
0
        public UserWaypointsEditorForm(Framework.Interfaces.IPlugin owner, Framework.Interfaces.ICore core)
            : base(owner, core)
        {
            InitializeComponent();

            SelectedLanguageChanged(this, EventArgs.Empty);

            core.ActiveGeocacheChanged             += new Framework.EventArguments.GeocacheEventHandler(core_ActiveGeocacheChanged);
            core.Geocaches.DataChanged             += new Framework.EventArguments.GeocacheEventHandler(Geocaches_DataChanged);
            core.Geocaches.ListDataChanged         += new EventHandler(Geocaches_ListDataChanged);
            core.UserWaypoints.UserWaypointRemoved += new Framework.EventArguments.UserWaypointEventHandler(UserWaypoints_UserWaypointRemoved);
            core.UserWaypoints.UserWaypointAdded   += new Framework.EventArguments.UserWaypointEventHandler(UserWaypoints_UserWaypointAdded);
            core.UserWaypoints.ListDataChanged     += new EventHandler(UserWaypoints_ListDataChanged);
        }
Exemplo n.º 24
0
        public GeocacheSearchForm(Framework.Interfaces.IPlugin owner, Framework.Interfaces.ICore core)
            : base(owner, core)
        {
            InitializeComponent();

            foreach (var gt in core.GeocacheTypes)
            {
                if (gt.ID > 0)
                {
                    imageListGeocacheTypes.Images.Add(gt.ID.ToString(), Image.FromFile(Utils.ImageSupport.Instance.GetImagePath(core, Framework.Data.ImageSize.Small, gt)));
                    listViewGeocacheType.Items.Add(new ListViewItem(gt.Name, imageListGeocacheTypes.Images.Count - 1));
                }
            }
            foreach (var cnt in core.GeocacheContainers)
            {
                if (cnt.ID > 0)
                {
                    imageListContainers.Images.Add(cnt.ID.ToString(), Image.FromFile(Utils.ImageSupport.Instance.GetImagePath(core, Framework.Data.ImageSize.Small, cnt)));
                    listViewContainer.Items.Add(new ListViewItem(cnt.Name, imageListContainers.Images.Count - 1));
                }
            }
            foreach (var attr in core.GeocacheAttributes)
            {
                if (attr.ID > 0)
                {
                    imageListAttributes.Images.Add(attr.ID.ToString(), Image.FromFile(Utils.ImageSupport.Instance.GetImagePath(core, Framework.Data.ImageSize.Small, attr, Framework.Data.GeocacheAttribute.State.Yes)));
                    listViewAttributes.Items.Add(new ListViewItem(attr.Name, imageListAttributes.Images.Count - 1));
                }
            }
            foreach (var attr in core.GeocacheAttributes)
            {
                if (attr.ID > 0)
                {
                    imageListAttributes.Images.Add(attr.ID.ToString(), Image.FromFile(Utils.ImageSupport.Instance.GetImagePath(core, Framework.Data.ImageSize.Small, attr, Framework.Data.GeocacheAttribute.State.No)));
                    listViewAttributes.Items.Add(new ListViewItem(attr.Name, imageListAttributes.Images.Count - 1));
                }
            }
            string[] v = new string[] { "1", "1.5", "2", "2.5", "3", "3.5", "4", "4.5", "5" };
            comboBoxDifficultyFrom.Items.AddRange(v);
            comboBoxDifficultyFrom.SelectedItem = "1";
            comboBoxDifficultyTo.Items.AddRange(v);
            comboBoxDifficultyTo.SelectedItem = "5";
            comboBoxTerrainFrom.Items.AddRange(v);
            comboBoxTerrainFrom.SelectedItem = "1";
            comboBoxTerrainTo.Items.AddRange(v);
            comboBoxTerrainTo.SelectedItem  = "5";
            dateTimePickerPubDateFrom.Value = DateTime.Now.AddDays(-7);

            SelectedLanguageChanged(this, EventArgs.Empty);
        }
Exemplo n.º 25
0
        public async static Task <bool> ExecuteDefaultActionAsync(Framework.Interfaces.ICore core, string pluginName)
        {
            bool result = false;

            Framework.Interfaces.IPlugin pi = PluginByName(core, pluginName);
            if (pi != null)
            {
                if (!string.IsNullOrEmpty(pi.DefaultAction))
                {
                    result = await pi.ActionAsync(pi.DefaultAction);
                }
            }
            return(result);
        }
Exemplo n.º 26
0
        public GMapForm(Framework.Interfaces.IPlugin owner, Framework.Interfaces.ICore core)
            : base(owner, core)
        {
            InitializeComponent();

            checkBox1.Checked = PluginSettings.Instance.AddSelectedMarkers;

            Rectangle r = PluginSettings.Instance.WindowPos;

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

            Assembly assembly = Assembly.GetExecutingAssembly();

            using (StreamReader textStreamReader = new StreamReader(assembly.GetManifestResourceStream("GlobalcachingApplication.Plugins.GMap.SingleGeocache.html")))
            {
                _defaultSingleGeocachehtml = textStreamReader.ReadToEnd();
            }
            using (StreamReader textStreamReader = new StreamReader(assembly.GetManifestResourceStream("GlobalcachingApplication.Plugins.GMap.SingleGeocache.js")))
            {
                _defaultSingleGeocachejs = textStreamReader.ReadToEnd();
            }
            using (StreamReader textStreamReader = new StreamReader(assembly.GetManifestResourceStream("GlobalcachingApplication.Plugins.GMap.MultipleGeocache.html")))
            {
                _defaultMultipleGeocachehtml = textStreamReader.ReadToEnd();
            }
            using (StreamReader textStreamReader = new StreamReader(assembly.GetManifestResourceStream("GlobalcachingApplication.Plugins.GMap.MultipleGeocache.js")))
            {
                _defaultMultipleGeocachejs = textStreamReader.ReadToEnd();
            }

            core.ActiveGeocacheChanged          += new Framework.EventArguments.GeocacheEventHandler(core_ActiveGeocacheChanged);
            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_GeocacheAdded);
            core.Geocaches.ListDataChanged      += new EventHandler(Geocaches_ListDataChanged);
            core.GeocachingComAccountChanged    += new Framework.EventArguments.GeocacheComAccountEventHandler(core_GeocachingComAccountChanged);
            core.GPSLocation.Changed            += new Framework.EventArguments.GPSLocationEventHandler(GPSLocation_Changed);
            core.Waypoints.ListDataChanged      += new EventHandler(Waypoints_ListDataChanged);
            core.Waypoints.DataChanged          += new Framework.EventArguments.WaypointEventHandler(Waypoints_DataChanged);

            SelectedLanguageChanged(this, EventArgs.Empty);
            this.VisibleChanged += GMapForm_VisibleChanged;
        }
Exemplo n.º 27
0
        public GCEditorForm(Framework.Interfaces.IPlugin owner, Framework.Interfaces.ICore core)
            : base(owner, core)
        {
            InitializeComponent();

            comboBoxCacheType1.SetCacheTypes(core, core.GeocacheTypes.ToList());
            comboBoxContainerType1.SetContainerTypes(core, core.GeocacheContainers.ToList());
            comboBox5.Items.AddRange(new string[] { "1", "1.5", "2", "2.5", "3", "3.5", "4", "4.5", "5" });
            comboBox6.Items.AddRange(new string[] { "1", "1.5", "2", "2.5", "3", "3.5", "4", "4.5", "5" });

            SelectedLanguageChanged(this, EventArgs.Empty);
            core.ActiveGeocacheChanged     += new Framework.EventArguments.GeocacheEventHandler(core_ActiveGeocacheChanged);
            core.Geocaches.DataChanged     += new Framework.EventArguments.GeocacheEventHandler(Geocaches_DataChanged);
            core.Geocaches.ListDataChanged += new EventHandler(Geocaches_ListDataChanged);
        }
Exemplo n.º 28
0
        public HtmlEditorForm(Framework.Interfaces.IPlugin owner, Framework.Interfaces.ICore core)
            : base(owner, core)
        {
            InitializeComponent();

            var p = PluginSettings.Instance.WindowPos;

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

            SelectedLanguageChanged(this, EventArgs.Empty);
        }
Exemplo n.º 29
0
        public MapForm(Framework.Interfaces.IPlugin owner, Framework.Interfaces.ICore core)
            : base(owner, core)
        {
            InitializeComponent();


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

            foreach (var cnt in core.WaypointTypes)
            {
                if (cnt.ID > 0)
                {
                    imageListWaypointType.Images.Add(cnt.ID.ToString(), Image.FromFile(Utils.ImageSupport.Instance.GetImagePath(core, Framework.Data.ImageSize.Small, cnt)));
                    listViewWaypointType.Items.Add(new ListViewItem(cnt.Name, imageListWaypointType.Images.Count - 1));
                }
            }

            Assembly assembly = Assembly.GetExecutingAssembly();

            using (StreamReader textStreamReader = new StreamReader(assembly.GetManifestResourceStream("GlobalcachingApplication.Plugins.OpenAreas.MultipleGeocache.html")))
            {
                _defaultMultipleGeocachehtml = textStreamReader.ReadToEnd();
            }
            using (StreamReader textStreamReader = new StreamReader(assembly.GetManifestResourceStream("GlobalcachingApplication.Plugins.OpenAreas.MultipleGeocache.js")))
            {
                _defaultMultipleGeocachejs = textStreamReader.ReadToEnd();
            }

            checkBox3.Checked = PluginSettings.Instance.MysteryOnlyIfCorrected;
            checkBox2.Checked = PluginSettings.Instance.Waypoints;
            checkBox4.Checked = PluginSettings.Instance.CustomWaypoints;
            foreach (string s in PluginSettings.Instance.CustomWaypointsList)
            {
                listBox1.Items.Add(s);
            }
            numericUpDown1.Value = PluginSettings.Instance.Radius;
            numericUpDown2.Value = PluginSettings.Instance.FillOpacity;
            numericUpDown3.Value = PluginSettings.Instance.StrokeOpacity;
            label12.BackColor    = PluginSettings.Instance.GeocacheColor;
            label13.BackColor    = PluginSettings.Instance.WaypointColor;
            label16.BackColor    = PluginSettings.Instance.CustomColor;

            SelectedLanguageChanged(this, EventArgs.Empty);
        }
        public BrowserScriptPocketQueriesPQSeriesForm(Framework.Interfaces.ICore core, Framework.Interfaces.IPlugin plugin, string settingsFilename, string seriesFilename, WebBrowser wb)
            : this()
        {
            _settingsFilename = settingsFilename;
            _seriesFilename   = seriesFilename;
            _core             = core;
            _wb     = wb;
            _plugin = plugin;

            List <BrowserScriptPocketQueriesPQSetting> s = BrowserScriptPocketQueriesPQSetting.Load(settingsFilename);

            if (s != null)
            {
                comboBox2.Items.AddRange(s.ToArray());
            }

            List <BrowserScriptPocketQueriesPQSeries> l = BrowserScriptPocketQueriesPQSeries.Load(_seriesFilename);

            if (l != null)
            {
                comboBox1.Items.AddRange(l.ToArray());
            }

            this.Text         = Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE);
            this.button5.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CREATEPQ);
            this.label1.Text  = Utils.LanguageSupport.Instance.GetTranslation(STR_SERIE);
            this.label4.Text  = Utils.LanguageSupport.Instance.GetTranslation(STR_NAME);
            this.label6.Text  = Utils.LanguageSupport.Instance.GetTranslation(STR_SETTINGS);
            this.label12.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TEMPLATE);
            this.label8.Text  = Utils.LanguageSupport.Instance.GetTranslation(STR_START);
            this.label10.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_END);
            this.listView1.Columns[0].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_DATE);
            this.button1.Text   = Utils.LanguageSupport.Instance.GetTranslation(STR_REMOVE);
            this.button12.Text  = Utils.LanguageSupport.Instance.GetTranslation(STR_RENAME);
            this.button2.Text   = Utils.LanguageSupport.Instance.GetTranslation(STR_SAVE);
            this.button4.Text   = Utils.LanguageSupport.Instance.GetTranslation(STR_NEW);
            this.groupBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_AUTODATERANGES);
            this.label14.Text   = Utils.LanguageSupport.Instance.GetTranslation(STR_MAXINPQ);
            this.label16.Text   = Utils.LanguageSupport.Instance.GetTranslation(STR_MAXINLASTPQ);
            this.button7.Text   = Utils.LanguageSupport.Instance.GetTranslation(STR_FROMSELECTION);
            this.button8.Text   = Utils.LanguageSupport.Instance.GetTranslation(STR_NETHERLANDS);
            this.button9.Text   = Utils.LanguageSupport.Instance.GetTranslation(STR_BELGIUM);
            this.label21.Text   = Utils.LanguageSupport.Instance.GetTranslation(STR_DELAY);
            this.label19.Text   = Utils.LanguageSupport.Instance.GetTranslation(STR_MARGIN);
            this.button11.Text  = Utils.LanguageSupport.Instance.GetTranslation(STR_AUTOMATIC);
            this.checkBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_AUTOMATICACTIVATE);
            this.button13.Text  = Utils.LanguageSupport.Instance.GetTranslation(STR_FROMGCPROJECT);
        }
Exemplo n.º 31
0
        public LogViewerForm(Framework.Interfaces.IPlugin owner, Framework.Interfaces.ICore core)
            : base(owner, core)
        {
            FixedCore = core;
            InitializeComponent();

            core.ActiveGeocacheChanged += new Framework.EventArguments.GeocacheEventHandler(core_ActiveGeocacheChanged);
            core.Logs.DataChanged      += new Framework.EventArguments.LogEventHandler(Logs_DataChanged);
            core.Logs.ListDataChanged  += new EventHandler(Logs_ListDataChanged);
            core.Logs.LogAdded         += new Framework.EventArguments.LogEventHandler(Logs_LogAdded);
            core.Logs.LogRemoved       += new Framework.EventArguments.LogEventHandler(Logs_LogRemoved);

            logViewControl1.logList.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(logList_SelectionChanged);

            SelectedLanguageChanged(this, EventArgs.Empty);
        }
        public BrowserScriptPocketQueriesPQSeriesForm(Framework.Interfaces.ICore core, Framework.Interfaces.IPlugin plugin, string settingsFilename, string seriesFilename, WebBrowser wb)
            : this()
        {
            _settingsFilename = settingsFilename;
            _seriesFilename = seriesFilename;
            _core = core;
            _wb = wb;
            _plugin = plugin;

            List<BrowserScriptPocketQueriesPQSetting> s = BrowserScriptPocketQueriesPQSetting.Load(settingsFilename);
            if (s != null)
            {
                comboBox2.Items.AddRange(s.ToArray());
            }

            List<BrowserScriptPocketQueriesPQSeries> l = BrowserScriptPocketQueriesPQSeries.Load(_seriesFilename);
            if (l != null)
            {
                comboBox1.Items.AddRange(l.ToArray());
            }

            this.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE);
            this.button5.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CREATEPQ);
            this.label1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SERIE);
            this.label4.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_NAME);
            this.label6.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SETTINGS);
            this.label12.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TEMPLATE);
            this.label8.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_START);
            this.label10.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_END);
            this.listView1.Columns[0].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_DATE);
            this.button1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_REMOVE);
            this.button12.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_RENAME);
            this.button2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SAVE);
            this.button4.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_NEW);
            this.groupBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_AUTODATERANGES);
            this.label14.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_MAXINPQ);
            this.label16.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_MAXINLASTPQ);
            this.button7.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_FROMSELECTION);
            this.button8.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_NETHERLANDS);
            this.button9.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_BELGIUM);
            this.button10.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ITALY);
            this.label21.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_DELAY);
            this.label19.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_MARGIN);
            this.button11.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_AUTOMATIC);
            this.checkBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_AUTOMATICACTIVATE);
            this.button13.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_FROMGCPROJECT);
        }
Exemplo n.º 33
0
 public BaseUIChildWindowForm(Framework.Interfaces.IPlugin owner, Framework.Interfaces.ICore core)
     : this()
 {
     _core = core;
     _owner = owner;
     LanguageSupport.Instance.UpdateLanguageSupportPlugins(core);
     core.SelectedLanguageChanged += new EventHandler(core_SelectedLanguageChanged);
     Utils.ImageSupport.Instance.UpdateImageSupportPlugins(core);
     Utils.GeometrySupport.Instance.UpdateGeometrySupportPlugins(core);
 }
Exemplo n.º 34
0
 public override bool PrepareRun()
 {
     _favoritesPlugin = Utils.PluginSupport.PluginByName(Core, "GlobalcachingApplication.Plugins.APIFavorites.SelectFavorites");
     if (_favoritesPlugin != null)
     {
         _method = _favoritesPlugin.GetType().GetMethod("GetFavorite");
         _params = new string[1];
     }
     else
     {
         _method = null;
     }
     return base.PrepareRun();
 }
Exemplo n.º 35
0
 public PluginEventArgs(Framework.Interfaces.IPlugin plugin)
 {
     Plugin = plugin;
 }