private void OnStatusChanged(object sender, Model.StatusChangedEventArgs e) { SplashManager.ShowSplashScreen(e.Status, e.Description); }
static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); DevExpress.Skins.SkinManager.EnableFormSkins(); DevExpress.UserSkins.BonusSkins.Register(); UserLookAndFeel.Default.SetSkinStyle("DevExpress Style"); Log.Configure(); Log.Info("Entering application."); bool runnAll = false; bool compress = false; bool channelsMap = false; bool gzip = false; if (args.ToList().Any(x => x.ToLower() == "/runall")) { runnAll = true; if (args.ToList().Any(x => x.ToLower() == "/compress")) { compress = true; if (args.ToList().Any(x => x.ToLower() == "/gzip")) { gzip = true; } } if (args.ToList().Any(x => x.ToLower() == "/channelsmap")) { channelsMap = true; } } var sitePackDirLocation = Path.Combine(Locations.WorkingDirectory.FullName, Settings.Default.SiteIniPack); if (!Directory.Exists(sitePackDirLocation)) { if (runnAll) { Log.Error(string.Format("Can't continue without siteini.pack.{0}Application will exit.", Environment.NewLine)); Application.Exit(); } if (mainForm.AskQuestion("siteini.pack not found in working folder. Download new?")) { var siteIniUpdater = new SiteIniPackUpdater(Locations.WorkingDirectory); siteIniUpdater.StatusChanged += (sender, e) => SplashManager.ShowSplashScreen(e.Status, e.Description); siteIniUpdater.Execute().GetAwaiter().GetResult(); } else { Log.Error(string.Format("Can't continue without siteini.pack.{0}Application will exit.", Environment.NewLine)); XtraMessageBox.Show(string.Format("Can't continue without siteini.pack.{0}Application will exit.", Environment.NewLine)); Application.Exit(); } } if (runnAll) { RunAll(compress, channelsMap, gzip); return; } Application.Run(new mainForm()); Log.Info("Exiting application."); }