xenwinsvc.ClipboardManager.Run C# (CSharp) Method

Run() public method

public Run ( ) : WaitHandle
return System.Threading.WaitHandle
        public WaitHandle Run()
        {
            WmiBase.Singleton.DebugMsg("Clipboard thread starting");
            wmisession = WmiBase.Singleton.GetXenStoreSession("Clipboard");
            clipboard = new ClipboardAccess(wmisession);

            state = new ClipboardStateMachine(clipboard, wmisession, exceptionhandler);
            lock (statelock)
            {
                running = true;
                WaitHandle threadhandle = state.Run();
                shutdowncallback = ThreadPool.RegisterWaitForSingleObject(threadhandle, shutdownCallback, null, Timeout.Infinite, true);
            }
            return done;
        }

Usage Example

Example #1
0
        void WmiCapableServiceThreadHandler()
        {
            try
            {
                wmisession = WmiBase.Singleton.GetXenStoreSession("Features");

                wmisession.Log("Guest Agent Starting");
                Refresher.Add(new PVInstallation(this));

                wmisession.Log("About to run apps");

                RunProcess("wmiadap", "/f", "refresh WMI ADAP");
                RunProcess("diskperf", "-y", "enable disk perf counters");


                wmisession.Log("About to run features");
                new FeatureLicensed(this);
                new FeatureVSSLicensed(this);
                new FeatureDumpLog(this);
                new FeatureGC(this);
                new FeaturePing(this);
                new FeatureDomainJoin(this);
                new FeatureSetComputerName(this);
                new FeatureXSBatchCommand(this);
                new FeatureAutoUpdate(this);

                wmisession.Log("About to try snapshot");
                if (FeatureSnapshot.IsSnapshotSupported())
                {
                    Refresher.Add(new FeatureSnapshot(this));
                }
                else
                {
                    wmisession.Log("Snapshot not supported on this platform");
                    FeatureSnapshot.removeSnapshot(wmisession);
                }
                new FeatureTerminalServicesReset(this);
                new FeatureTerminalServices(this);
                new FeatureStaticIpSetting(this);
                wmisession.Log("About to add refreshers");

                Refresher.Add(new NetInfo(this));
                Refresher.Add(new VolumeInfo());
                Refresher.Add(new MemoryInfo());

                wmisession.Log("About to add handlers ");
                clipboardhandler = new ClipboardManager(this);
                Disposer.Add(clipboardhandler);
                clipboardhandler.Run();
                Disposer.Add(WmiBase.Singleton.ListenForEvent("CitrixXenStoreUnsuspendedEvent", new EventArrivedEventHandler(handleUnsuspended)));

                Refresher.RefreshAll(true);
                wmisession.Log("running ");
                Refresher.Run(this);
            }
            catch (Exception e)
            {
                HandleException("Service handler", e);
            }
        }
All Usage Examples Of xenwinsvc.ClipboardManager::Run