Exemple #1
0
        private void PopulateProfileList()
        {
            XMLProfileSettings profile = new XMLProfileSettings();

            listBoxProfiles.BeginUpdate();
            //Make sure we start with an empty listbox since we may repopulate after editing profiles
            listBoxProfiles.Items.Clear();
            int profileCount = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "ProfileCount", 0);

            for (int i = 0; i < profileCount; i++)
            {
                var dataFolder = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "Profile" + i.ToString() + "/DataFolder", string.Empty);
                // if (!VixenApplication.IsProfileLocked(dataFolder)) //Only add the profile if it is not locked.
                //{
                ProfileItem item = new ProfileItem();
                item.Name = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "Profile" + i.ToString() + "/Name",
                                               "New Profile");
                item.DataFolder = dataFolder;
                item.IsLocked   = VixenApplication.IsProfileLocked(dataFolder);
                listBoxProfiles.Items.Add(item);

                //}
            }

            listBoxProfiles.EndUpdate();
        }
Exemple #2
0
        private void PopulateProfileList()
        {
            XMLProfileSettings profile  = new XMLProfileSettings();
            List <ProfileItem> profiles = new List <ProfileItem>();


            listBoxProfiles.BeginUpdate();
            //Make sure we start with an empty listbox since we may repopulate after editing profiles
            listBoxProfiles.Items.Clear();
            int profileCount = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "ProfileCount", 0);

            for (int i = 0; i < profileCount; i++)
            {
                var dataFolder = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "Profile" + i.ToString() + "/DataFolder", string.Empty);
                // if (!VixenApplication.IsProfileLocked(dataFolder)) //Only add the profile if it is not locked.
                //{
                ProfileItem item = new ProfileItem
                {
                    Name = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "Profile" + i.ToString() + "/Name",
                                              "New Profile"),
                    DataFolder     = dataFolder,
                    IsLocked       = VixenApplication.IsProfileLocked(dataFolder),
                    DateLastLoaded = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "Profile" + i.ToString() + "/DateLastLoaded", DateTime.MinValue),
                    ProfileNumber  = i
                };

                profiles.Add(item);
                //}
            }

            profiles.Sort((x, y) => y.DateLastLoaded.CompareTo(x.DateLastLoaded));
            listBoxProfiles.DataSource = profiles;

            listBoxProfiles.EndUpdate();
        }
Exemple #3
0
 private static void Main()
 {
     try
     {
         AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
         Application.ThreadException += Application_ThreadException;
         Application.EnableVisualStyles();
         Application.SetCompatibleTextRenderingDefault(false);
         _app = new VixenApplication();
         Application.Run(_app);
     }
     catch (Exception ex)
     {
         LogMessageAndExit(ex);
     }
 }
Exemple #4
0
 private static void Main()
 {
     try
     {
         AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
         Application.ThreadException += Application_ThreadException;
         Application.EnableVisualStyles();
         Application.SetCompatibleTextRenderingDefault(false);
         _app = new VixenApplication();
         Application.Run(_app);
     }
     catch (Exception ex)
     {
         LogMessageAndExit(ex);
     }
 }
Exemple #5
0
        private static void Main()
        {
            try
            {
                Logging.Info("Vixen app starting.");
                LogManager.AddListener(new NLogListener());
                AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
                Application.ThreadException += Application_ThreadException;
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                _app = new VixenApplication();
                Application.Run(_app);
            }
            catch (Exception ex)
            {
                LogMessageAndExit(ex);
            }
        }
Exemple #6
0
 private static void LogMessageAndExit(Exception ex)
 {
     // Since we can't prevent the app from terminating, log this to the event log.
     Logging.Fatal(ex, ErrorMsg);
     if (VixenSystem.IsSaving())
     {
         Logging.Fatal("Save was in progress during the fatal crash. Trying to pause 5 seconds to give it a chance to complete.");
         Thread.Sleep(5000);
     }
     if (_app != null)
     {
         _app.RemoveLockFile();
     }
     else
     {
         //try the failsafe to clean up the lock file.
         VixenApplication.RemoveLockFile(LockFilePath);
     }
     Environment.Exit(1);
 }