Example #1
0
        private void forceInstallToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (lvModule.SelectedItems.Count > 0)
            {
                if (lvModule.SelectedItems[0].Tag is SynapseModule)
                {
                    SynapseModule module = ((SynapseModule)lvModule.SelectedItems[0].Tag);
                    smallImages.Images.RemoveByKey(module.TECHNICALNAME);
                    largeImages.Images.RemoveByKey(module.TECHNICALNAME);

                    module.ForceUpdate(Application.StartupPath, CurrentMode);
                    string IconFile = Application.StartupPath + (CurrentMode == SynapseModule.SynapseModuleMode.Production ? "\\Prod\\" : "\\Dev\\") + module.TECHNICALNAME + "\\" + module.TECHNICALNAME + ".ico";

                    if (File.Exists(IconFile))
                    {
                        smallImages.Images.Add(module.TECHNICALNAME, Image.FromFile(IconFile));
                        largeImages.Images.Add(module.TECHNICALNAME, Image.FromFile(IconFile));
                    }
                    else
                    {
                        smallImages.Images.Add(module.TECHNICALNAME, Image.FromFile(Application.StartupPath + "\\ModulesIcons\\Default.png"));
                        largeImages.Images.Add(module.TECHNICALNAME, Image.FromFile(Application.StartupPath + "\\ModulesIcons\\Default.png"));
                    }
                }

                lvModule.SelectedItems.Clear();
            }
        }