Ejemplo n.º 1
0
        private void uxAdd_Click(object sender, EventArgs e)
        {
            Feed feed = new Feed();

            feed.Name = uxSourceName.Text.Trim();
            feed.Url  = uxSourceUrl.Text.Trim();
            FeedManager.Add(feed);

            ListViewItem listViewItem = new ListViewItem();

            listViewItem.Text = feed.Name;
            listViewItem.SubItems.Add(feed.Url);
            uxFeedSources.Items.Add(listViewItem);

            if (uxFeedSelection.Items.Contains(feed.Url))
            {
                uxSourceName.Clear();
                uxSourceUrl.Clear();
            }
            else
            {
                uxFeedSelection.Items.Add(feed.Url);
                uxFeedSelection2.Items.Add(feed.Url);
                uxSourceName.Clear();
                uxSourceUrl.Clear();
            }
        }
Ejemplo n.º 2
0
        private void ExtensionManagerForm_Load(object sender, EventArgs e)
        {
            tabControl.SelectedTab = tabOnline;
            AddCategory(new ExtensionCategory());
            AddCategory(new ToolsCategory());
            AddCategory(new DataProviderCategory());
            AddCategory(new ApplicationExtensionCategory());

            uxFeedSources.TileSize = new Size(uxFeedSources.Width - 25, 45);

            foreach (Feed feed in FeedManager.GetFeeds())
            {
                ListViewItem source = new ListViewItem();
                source.Text = feed.Name;
                source.SubItems.Add(feed.Url);
                uxFeedSources.Items.Add(source);
                uxFeedSelection.Items.Add(feed.Url);
                uxFeedSelection2.Items.Add(feed.Url);
                source.Checked = FeedManager.isAutoUpdateFeed(feed.Url);
            }
            // Select the first item in the drop down, kicking off a package list update.
            uxFeedSelection.SelectedIndex = 0;
            uxCategoryList.SelectedIndex  = 1;
            SearchAndClearIcons();
            uxClear.Visible = false;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Performs auto updates from the default feed.
        /// </summary>
        /// <param name="app">The AppManager.</param>
        public static void AutoUpdateController(AppManager app)
        {
            Packages packages = new Packages();
            var      feeds    = FeedManager.GetAutoUpdateFeeds();

            if (feeds.Count > 0)
            {
                Update update = new Update(packages, app);
                update.AutoUpdate();
            }
        }
Ejemplo n.º 4
0
 private void checkBox1_CheckedChanged(object sender, EventArgs e)
 {
     if (checkBox1.Checked == true)
     {
         FeedManager.ToggleAutoUpdate(packages.Repo.Source, true);
     }
     else
     {
         FeedManager.ToggleAutoUpdate(packages.Repo.Source, false);
     }
 }
Ejemplo n.º 5
0
        private void ExtensionManagerForm_Load(object sender, EventArgs e)
        {
            tabControl.SelectedTab = tabOnline;

            if (FeedManager.getAutoUpdateFeeds().Count > 0)
            {
                checkBox1.Checked = true;
            }

            SearchAndClearIcons();
        }
Ejemplo n.º 6
0
        //Cycle through feeds from settings and call autoupdate function. If any updates occur, show message box.
        public static void autoUpdateController(AppManager app, ExtensionManagerForm form)
        {
            List <String> updatesOccurred = new List <String>();
            Packages      packages        = new Packages();

            System.Collections.Specialized.StringCollection feeds = FeedManager.getAutoUpdateFeeds();
            Update update = new Update(packages, null, app);

            if (update.IsOnline() == true)
            {
                foreach (String feed in feeds)
                {
                    packages.SetNewSource(feed);
                    update = new Update(packages, null, app);
                    updatesOccurred.AddRange(update.autoUpdate());
                }
            }

            if (updatesOccurred.Count > 0)
            {
                String begin;
                if (updatesOccurred.Count == 1)
                {
                    begin = "The following extension has been updated:";
                }
                else
                {
                    begin = "The following extensions have been updated:";
                }

                StringBuilder sb = new StringBuilder();
                sb.AppendLine(begin);
                sb.AppendLine();
                for (int i = 0; i < updatesOccurred.Count && i < 25; i++)
                {
                    sb.AppendLine("-" + updatesOccurred.ElementAt(i));
                }
                if (updatesOccurred.Count > 25)
                {
                    sb.AppendLine("...");
                }
                sb.AppendLine();
                sb.Append("Updates will finish when HydroDesktop is restarted.");
                sb.AppendLine("\n\n      Do you want to restart HydroDesktop now?");

                DialogResult dialogResult = MessageBox.Show(sb.ToString(), "Update Complete", MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    System.Diagnostics.Process.Start(Application.ExecutablePath);
                    Environment.Exit(-1);
                }
                form.AutoUpdateRestartNeccesary();
            }
        }
Ejemplo n.º 7
0
        private void uxRemove_Click(object sender, EventArgs e)
        {
            ListViewItem selectedItem = uxFeedSources.SelectedItems[0];
            Feed         feed         = new Feed();

            feed.Name = selectedItem.Text;
            feed.Url  = selectedItem.SubItems[1].Text;
            uxFeedSelection.Items.Remove(feed.Url);
            uxFeedSelection2.Items.Remove(feed.Url);
            selectedItem.Remove();
            FeedManager.Remove(feed);
        }
Ejemplo n.º 8
0
 /// <summary>
 /// Sets a feed to be used with auto-updating.
 /// </summary>
 /// <typeparam name="ListViewItem"></typeparam>
 /// <param name="item">The feed that should be used for auto updates</param>
 /// <returns></returns>
 private void changeAutoUpdateSetting(ListViewItem item)
 {
     FeedManager.ToggleAutoUpdate(item.SubItems[1].Text, item.Checked);
 }
Ejemplo n.º 9
0
 private void CheckBox1CheckedChanged(object sender, EventArgs e)
 {
     FeedManager.ToggleAutoUpdate(_packages.Repo.Source, checkBox1.Checked);
 }