コード例 #1
0
        private void RecordTimerWorkerThread(object theArg)
        {
            // Create the VisualTargetPresentationSource and then signal the
            // calling thread, so that it can continue without waiting for us.
            var aHostVisual     = (HostVisual)theArg;
            var aVisualTargetPs = new VisualTargetPresentationSource(aHostVisual);

            myChildVisualTargetEvent.Set();
            // Create a Label and use it as the root visual for the
            // VisualTarget.
            aVisualTargetPs.RootVisual = CreateRecordTimerLabel();
            // Run a dispatcher for this worker thread.  This is the central
            // processing loop for WPF.
            Log.Info("Running dispatcher for thread: " + Thread.CurrentThread.ManagedThreadId);
            Dispatcher.Run();
        }
コード例 #2
0
 private void RecordTimerWorkerThread(object theArg)
 {
     // Create the VisualTargetPresentationSource and then signal the
     // calling thread, so that it can continue without waiting for us.
     var aHostVisual = (HostVisual) theArg;
     var aVisualTargetPs = new VisualTargetPresentationSource(aHostVisual);
     myChildVisualTargetEvent.Set();
     // Create a Label and use it as the root visual for the
     // VisualTarget.
     aVisualTargetPs.RootVisual = CreateRecordTimerLabel();
     // Run a dispatcher for this worker thread.  This is the central
     // processing loop for WPF.
     Log.Info("Running dispatcher for thread: " + Thread.CurrentThread.ManagedThreadId);
     Dispatcher.Run();
 }