示例#1
0
        /// <summary>
        /// Initializes an instance of the starter form.
        /// The starter form shows a splashscreen and initializes the plugin infrastructure.
        /// </summary>
        public StarterForm()
            : base()
        {
            InitializeComponent();
            largeImageList.Images.Add(HeuristicLab.PluginInfrastructure.Resources.HeuristicLab.ToBitmap());
            largeImageList.Images.Add(HeuristicLab.PluginInfrastructure.Resources.UpdateAvailable.ToBitmap());
            smallImageList.Images.Add(HeuristicLab.PluginInfrastructure.Resources.HeuristicLab.ToBitmap());
            smallImageList.Images.Add(HeuristicLab.PluginInfrastructure.Resources.UpdateAvailable.ToBitmap());
            Text = "HeuristicLab " + AssemblyHelpers.GetFileVersion(GetType().Assembly);

            string pluginPath = Path.GetFullPath(Application.StartupPath);

            pluginManager = new PluginManager(pluginPath);
            splashScreen  = new SplashScreen(pluginManager, 1000);
            splashScreen.VisibleChanged += new EventHandler(splashScreen_VisibleChanged);
            splashScreen.Show(this, "Loading HeuristicLab...");

            if (CheckSavedStarterFormSettings())
            {
                Location    = Settings.Default.StarterFormLocation;
                Size        = Settings.Default.StarterFormSize;
                WindowState = Settings.Default.StarterFormWindowState;
            }

            pluginManager.DiscoverAndCheckPlugins();
            UpdateApplicationsList();

            CheckUpdatesAvailableAsync();
        }
示例#2
0
        public PluginUpdaterForm(PluginManager pluginManager)
            : base()
        {
            InitializeComponent();
            Text = "HeuristicLab Plugin Manager " + AssemblyHelpers.GetFileVersion(GetType().Assembly);
            pluginManager.PluginLoaded   += pluginManager_PluginLoaded;
            pluginManager.PluginUnloaded += pluginManager_PluginUnloaded;
            pluginManager.Initializing   += pluginManager_Initializing;
            pluginManager.Initialized    += pluginManager_Initialized;

            pluginDir = Application.StartupPath;

            installationManager = new InstallationManager(pluginDir);
            installationManager.PluginInstalled  += new EventHandler <PluginInfrastructureEventArgs>(installationManager_PluginInstalled);
            installationManager.PluginRemoved    += new EventHandler <PluginInfrastructureEventArgs>(installationManager_PluginRemoved);
            installationManager.PluginUpdated    += new EventHandler <PluginInfrastructureEventArgs>(installationManager_PluginUpdated);
            installationManager.PreInstallPlugin += new EventHandler <PluginInfrastructureCancelEventArgs>(installationManager_PreInstallPlugin);
            installationManager.PreRemovePlugin  += new EventHandler <PluginInfrastructureCancelEventArgs>(installationManager_PreRemovePlugin);
            installationManager.PreUpdatePlugin  += new EventHandler <PluginInfrastructureCancelEventArgs>(installationManager_PreUpdatePlugin);

            this.pluginManager = pluginManager;

            updatePluginsBackgroundWorker                     = new BackgroundWorker();
            updatePluginsBackgroundWorker.DoWork             += new DoWorkEventHandler(updatePluginsBackgroundWorker_DoWork);
            updatePluginsBackgroundWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(updatePluginsBackgroundWorker_RunWorkerCompleted);
        }
示例#3
0
        public InstallationManagerForm(PluginManager pluginManager)
            : base()
        {
            InitializeComponent();
            Text = "HeuristicLab Plugin Manager " + AssemblyHelpers.GetFileVersion(GetType().Assembly);

            pluginManager.PluginLoaded   += pluginManager_PluginLoaded;
            pluginManager.PluginUnloaded += pluginManager_PluginUnloaded;
            pluginManager.Initializing   += pluginManager_Initializing;
            pluginManager.Initialized    += pluginManager_Initialized;

            pluginDir = Application.StartupPath;

            installationManager = new InstallationManager(pluginDir);
            installationManager.PluginInstalled  += new EventHandler <PluginInfrastructureEventArgs>(installationManager_PluginInstalled);
            installationManager.PluginRemoved    += new EventHandler <PluginInfrastructureEventArgs>(installationManager_PluginRemoved);
            installationManager.PluginUpdated    += new EventHandler <PluginInfrastructureEventArgs>(installationManager_PluginUpdated);
            installationManager.PreInstallPlugin += new EventHandler <PluginInfrastructureCancelEventArgs>(installationManager_PreInstallPlugin);
            installationManager.PreRemovePlugin  += new EventHandler <PluginInfrastructureCancelEventArgs>(installationManager_PreRemovePlugin);
            installationManager.PreUpdatePlugin  += new EventHandler <PluginInfrastructureCancelEventArgs>(installationManager_PreUpdatePlugin);

            // show or hide controls for uploading plugins based on setting
            if (!HeuristicLab.PluginInfrastructure.Properties.Settings.Default.ShowPluginUploadControls)
            {
                tabControl.Controls.Remove(uploadPluginsTabPage);
                tabControl.Controls.Remove(manageProductsTabPage);
            }
            else
            {
                pluginEditor.PluginManager = pluginManager;
            }

            localPluginsView.StatusView          = this;
            localPluginsView.PluginManager       = pluginManager;
            localPluginsView.InstallationManager = installationManager;

            remotePluginInstaller.StatusView          = this;
            remotePluginInstaller.InstallationManager = installationManager;
            remotePluginInstaller.PluginManager       = pluginManager;

            pluginEditor.StatusView    = this;
            pluginEditor.PluginManager = pluginManager;

            productEditor.StatusView = this;
        }
示例#4
0
        internal SplashScreen(PluginManager manager, int initialInterval)
            : this()
        {
            this.initialInterval = initialInterval;
            this.pluginManager   = manager;

            RegisterPluginManagerEventHandlers();

            versionLabel.Text = "Version " + AssemblyHelpers.GetFileVersion(GetType().Assembly);
            infoLabel.Text    = "";

            var attr = (AssemblyCopyrightAttribute)this.GetType().Assembly.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false).Single();

            copyrightLabel.Text = "Copyright " + attr.Copyright;

            fadeTimer          = new Timer();
            fadeTimer.Tick    += fadeTimer_Elapsed;
            fadeTimer.Interval = initialInterval;
        }
示例#5
0
 private string GetVersion()
 {
     return(AssemblyHelpers.GetFileVersion(GetType().Assembly));
 }
 public static string GetHLVersion()
 {
     return(AssemblyHelpers.GetFileVersion(Assembly.GetExecutingAssembly()));
 }
示例#7
0
        private void AddPluginManagerItem()
        {
            pluginManagerListViewItem       = new ListViewItem(pluginManagerItemName, 0);
            pluginManagerListViewItem.Group = applicationsListView.Groups["Plugin Management"];
            pluginManagerListViewItem.SubItems.Add(new ListViewItem.ListViewSubItem(pluginManagerListViewItem, AssemblyHelpers.GetFileVersion(GetType().Assembly)));
            pluginManagerListViewItem.SubItems.Add(new ListViewItem.ListViewSubItem(pluginManagerListViewItem, "Install, upgrade or delete plugins"));
            pluginManagerListViewItem.ToolTipText = "Install, upgrade or delete plugins";

            applicationsListView.Items.Add(pluginManagerListViewItem);
        }