Exemplo n.º 1
0
        /// <summary>
        /// Checks that a single instance of the application is running, and if another is found it notifies the user and exits.
        /// </summary>
        /// <returns>Result of instance check.</returns>
        private static bool SingleInstanceCheck()
        {
            // get the list of all processes by that name
            Process[] processes = Process.GetProcessesByName(procName);

            // if there is more than one process...
            if (processes.Length > 1)
            {
                System.Threading.Thread.Sleep(1000);
                Process[] processes2 = Process.GetProcessesByName(procName);
                if (processes2.Length > 1)
                {
                    System.Threading.Thread.Sleep(3000);
                    Process[] processes3 = Process.GetProcessesByName(procName);
                    if (processes3.Length > 1)
                    {
                        CairoMessage.ShowAlert("If it's not responding, end it from Task Manager before trying to run Cairo again.", "Cairo is already running!", MessageBoxImage.Stop);
                        return(false);
                    }
                    else
                    {
                        return(true);
                    }
                }
                else
                {
                    return(true);
                }
            }
            else
            {
                return(true);
            }
        }
Exemplo n.º 2
0
        private void AboutCairo(object sender, RoutedEventArgs e)
        {
            System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
            FileVersionInfo            fvi      = FileVersionInfo.GetVersionInfo(assembly.Location);
            string version = fvi.FileVersion;

            CairoMessage.ShowAlert(
                Localization.DisplayString.sAbout_Version + " " + version + " - " + Localization.DisplayString.sAbout_PreRelease
                + "\n\n" + String.Format(Localization.DisplayString.sAbout_Copyright, DateTime.Now.Year.ToString()), "Cairo Desktop Environment", MessageBoxImage.None);
        }
Exemplo n.º 3
0
        private void AboutCairo(object sender, RoutedEventArgs e)
        {
            System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
            FileVersionInfo            fvi      = FileVersionInfo.GetVersionInfo(assembly.Location);
            string version = fvi.FileVersion;

            CairoMessage.ShowAlert(
                "Version " + version + " - Pre-release"
                + "\n\nCopyright © 2007-" + DateTime.Now.Year.ToString() + " Cairo Development Team and community contributors.  All rights reserved.", "Cairo Desktop Environment", MessageBoxImage.None);
        }
Exemplo n.º 4
0
        private void programsMenu_Properties(object sender, RoutedEventArgs e)
        {
            MenuItem        item = (MenuItem)sender;
            ApplicationInfo app  = item.DataContext as ApplicationInfo;


            if (app.IsStoreApp)
            {
                CairoMessage.ShowAlert("This is a Universal Windows Platform (UWP) application.", app.Name, MessageBoxImage.None);
            }
            else
            {
                Shell.ShowFileProperties(app.Path);
            }
        }
Exemplo n.º 5
0
 /// <summary>
 /// Executes the first run sequence.
 /// </summary>
 private static void FirstRun()
 {
     try
     {
         if (Settings.IsFirstRun == true || isTour)
         {
             Welcome welcome = new Welcome();
             welcome.Show();
         }
     }
     catch (Exception ex)
     {
         CairoMessage.ShowAlert(string.Format("Whoops! Something bad happened in the startup process.\nCairo will probably run, but please report the following details (preferably as a screen shot...)\n\n{0}", ex),
                                "Unexpected error!",
                                MessageBoxImage.Error);
     }
 }
Exemplo n.º 6
0
 /// <summary>
 /// Executes the first run sequence.
 /// </summary>
 private static void FirstRun()
 {
     try
     {
         if (Settings.IsFirstRun == true)
         {
             Settings.IsFirstRun = false;
             AppGrabber.AppGrabber.Instance.ShowDialog();
         }
     }
     catch (Exception ex)
     {
         CairoMessage.ShowAlert(string.Format("Whoops! Something bad happened in the startup process.\nCairo will probably run, but please report the following details (preferably as a screen shot...)\n\n{0}", ex),
                                "Unexpected error!",
                                MessageBoxImage.Error);
     }
 }