using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using AutoUpdaterDotNET; using IOB_UT; using NLog; using NLog.Targets; using NLog.Config; namespace IOB_WIN { public partial class MainForm : Form { /// /// URL stringa di UPDATE... /// protected string updateUrl { get { //string branchName = utils.CRS("appVers"); return string.Format("http://seriate.steamware.net:8083/SWS/MAPO/IOB-WIN/{0}/manifest.xml", branchName); } } /// /// Ramo applicazione (x update) /// protected string branchName = "develop"; public MainForm() { InitializeComponent(); myInit(); } protected void myInit() { loadIniFile(utils.defConfFilePath); } /// /// Carica file ini della configurazione richiesta /// /// private void loadIniFile(string iniConfFile) { #if false displayTaskAndLog(string.Format("Loading iniConfFile: {0}", iniConfFile)); #endif IniFile fIni = new IniFile(iniConfFile); // salvo branchName... branchName = fIni.ReadString("BRANCH", "NAME", "develop"); // se NON sono in DEBUG faccio check update... #if !(DEBUG) // avvio autoupdater... AutoUpdater.Start(updateUrl); #endif } private void mCheckUpdates_Click(object sender, EventArgs e) { AutoUpdater.ShowSkipButton = false; AutoUpdater.ShowRemindLaterButton = false; AutoUpdater.Start(updateUrl); } protected void closeActiveChild() { if (this.HasChildren) { try { this.ActiveMdiChild.Close(); this.LayoutMdi(MdiLayout.TileHorizontal); } catch { } } } protected void openChild() { TestForm child = new TestForm(); child.MdiParent = this; child.Show(); this.LayoutMdi(MdiLayout.TileHorizontal); } private void closeChildToolStripMenuItem_Click(object sender, EventArgs e) { closeActiveChild(); } private void openChildToolStripMenuItem_Click(object sender, EventArgs e) { openChild(); } } }