Esempio n. 1
0
        /**
         * <summary>Sets up a proper Shutdown for the given system if one exists.  Call
         * this method rather than attempting to setup your own.</summary>
         * <returns>The native shutdown class is returned.</returns>
         */
        public static Shutdown GetShutdown()
        {
            Shutdown sd = null;

            try {
                if (OSDependent.OSVersion == OSDependent.OS.Linux)
                {
                    sd = new LinuxShutdown();
                }
                else if (OSDependent.OSVersion == OSDependent.OS.Windows)
                {
                    sd = new WindowsShutdown();
                }
                else
                {
                    sd = new Shutdown();
                }
            }
            catch {
                if (OSDependent.OSVersion == OSDependent.OS.Linux)
                {
                    Console.WriteLine("Shutting down via ctrl-c will not work, perhaps " +
                                      "you do not have the Mono.Posix libraries installed");
                }
                sd = new Shutdown();
            }
            return(sd);
        }
Esempio n. 2
0
 /**
 <summary>Sets up a proper Shutdown for the given system if one exists.  Call
 this method rather than attempting to setup your own.</summary>
 <returns>The native shutdown class is returned.</returns>
 */
 public static Shutdown GetShutdown() {
   Shutdown sd = null;
   try {
     if(OSDependent.OSVersion == OSDependent.OS.Linux) {
       sd = new LinuxShutdown();
     }
     else if(OSDependent.OSVersion == OSDependent.OS.Windows) {
       sd = null;
     }
     else {
       throw new Exception("Unknown OS!");
     }
   }
   catch {}
   return sd;
 }
Esempio n. 3
0
 /**
 <summary>Sets up a proper Shutdown for the given system if one exists.  Call
 this method rather than attempting to setup your own.</summary>
 <returns>The native shutdown class is returned.</returns>
 */
 public static Shutdown GetShutdown() {
   Shutdown sd = null;
   try {
     if(OSDependent.OSVersion == OSDependent.OS.Linux) {
       sd = new LinuxShutdown();
     }
     else if(OSDependent.OSVersion == OSDependent.OS.Windows) {
       sd = new WindowsShutdown();
     }
     else {
       sd = new Shutdown();
     }
   }
   catch {
     if(OSDependent.OSVersion == OSDependent.OS.Linux) {
       Console.WriteLine("Shutting down via ctrl-c will not work, perhaps " +
           "you do not have the Mono.Posix libraries installed");
     }
     sd = new Shutdown();
   }
   return sd;
 }