Exemplo n.º 1
0
 private static void StartProcessViewer()
 {
     SIP processViewerSIP = new SIP(delegate()
     {
         Logging.Info("Starting XaeiOS.ProcessViewer");
         ProcessViewer processViewer = new ProcessViewer();
         processViewer.UpdateInterval = 2000;
         processViewer.Start();
     }, ThreadPriority.Normal, "XaeiOS.ProcessViewer");
     processViewerSIP.Start();
 }
Exemplo n.º 2
0
 public static void Start()
 {
     string processName = typeof(SignalDaemon).FullName;
     if (_signalDaemonProcess != null)
     {
         throw new InvalidOperationException(processName + " is already started. Only one signal daemon is allowed.");
     }
     _signalDaemonProcess = new SIP(delegate(){}, ThreadPriority.High, processName, true);
     _exitLoop = new ManualResetEvent();
     _signalDaemonProcess.Start();
 }
Exemplo n.º 3
0
 public static void StartDriver()
 {
     string processName = typeof(XmlHttpRequestManager).Name + ".Driver";
     if (_driverProcess != null)
     {
         throw new InvalidOperationException(processName + " is already started. Only one signal daemon is allowed.");
     }
     _driverExit = new ManualResetEvent();
     _driverProcess = new SIP(delegate() { }, ThreadPriority.High, processName, true);
     _driverProcess.CustomSignal += HandleCustomSignal;
     _driverProcess.Start();
 }
Exemplo n.º 4
0
        static void StartPhotoSlideshow()
        {
            SIP slideshowProcess = new SIP(delegate()
            {
                // TODO: Fetch photo database from an XML/JSON file using REST
                Photo[] photos = new Photo[]{
                    new Photo("Photos/michaelten-pow.jpg", "My two sisters, Kaya and Alicia, and me"),
                    new Photo("Photos/lounging_at_pool.jpg", "Lounging by the pool at the Planet Hollywood Hotel, Las Vegas"),
                    new Photo("Photos/coaster.jpg", "Autumn and me on the roller coaster at New York, New York, Las Vegas"),
                    new Photo("Photos/just_michael.jpg", "Just me"),
                    new Photo("Photos/paris_vegas.jpg", "Autumn and me at Paris, Las Vegas"),
                    new Photo("Photos/checking_in.jpg", "Checking into the Planet Hollywood Hotel, Las Vegas"),
                    new Photo("Photos/autumn_and_michael.jpg", "Autumn and me"),
                    new Photo("Photos/wii_at_earls.jpg", "Playing Wii Sports Golf at Earl's house"),
                    new Photo("Photos/packed_jeep.jpg", "My Jeep packed full of my cousin Michelle's belongings.  I was helping her move.")
                };

                _slideshow = new PhotoSlideshow(photos, 10 * 1000);
                SignalDaemon.Start();
                ExportDelegate("ShowNextPhoto", ExportedShowNextPhoto);
                ExportDelegate("ShowPreviousPhoto", ExportedShowPreviousPhoto);
                _slideshow.ShowPhoto(0);
                _slideshow.StartSlideshow();
            }, ThreadPriority.Normal, "Tenpow.PhotoSlideshow");

            // install a custom signal handler to call the appropriate method based upon the PhotoSlideshowSignal that we receive
            slideshowProcess.CustomSignal += delegate(int data)
            {
                PhotoSlideshowSignal signal = (PhotoSlideshowSignal)data;
                if (signal == PhotoSlideshowSignal.ShowNextPhoto)
                {
                    _slideshow.ShowNextPhoto();
                }
                else if (signal == PhotoSlideshowSignal.ShowPreviousPhoto)
                {
                    _slideshow.ShowPreviousPhoto();
                }
                else
                {
                    // TODO: Write to standard error
                    Console.WriteLine("Received unknown signal " + data);
                }
            };
            slideshowProcess.Start();
            _slideshowPid = slideshowProcess.PID;
        }
Exemplo n.º 5
0
 private static void StartTwitterWall()
 {
     SIP twitterWallProcess = new SIP(delegate()
     {
         string screenName = "mtenpow";
         int maxItems = 6;
         TwitterWall twitterWall = new TwitterWall(screenName, maxItems);
         twitterWall.DisplayLoading();
         int refreshInterval = 20 * 1000;
         while (true)
         {
             twitterWall.Refresh();
             Logging.Info("TwitterWall will refresh in " + (refreshInterval / 1000) + " seconds");
             Thread.Sleep(refreshInterval);
         }
     }, ThreadPriority.Normal, "Tenpow.TwitterWall");
     twitterWallProcess.Start();
 }