在Windows Phone 8中并行

问题描述:

我过去曾在Windows Phone 7应用程序中使用
System.Threading.Tasks.3.0.1库
但它们似乎没有适用于Windows 8的新更新,所以我不确定它现在是内置的还是什么。



这就是我用来库的价格。


      &nbsp ;  Parallel.Invoke(()=> Dispose());
$




     public void Dispose()

        {

            if(photoCamera!= null)

            {

                photoCamera.Dispose();

                photoCamera.Initialized - = PhotoCameraOnInitialized;

                photoCamera.AutoFocusCompleted - = PhotoCameraOnAutoFocusCompleted;

                photoCamera = null;



$
                 recScanArea.Visibility = Visibility.Collapsed;



            }
        }

I have used in the past for Windows Phone 7 apps the System.Threading.Tasks.3.0.1 library but they don't seem to have a new update that works with Windows 8, so I am not sure if it is now built in or what.

This is what I use to do with the library

         Parallel.Invoke(() => Dispose());


     public void Dispose()
        {
            if (photoCamera != null)
            {
                photoCamera.Dispose();
                photoCamera.Initialized -= PhotoCameraOnInitialized;
                photoCamera.AutoFocusCompleted -= PhotoCameraOnAutoFocusCompleted;
                photoCamera = null;


                recScanArea.Visibility = Visibility.Collapsed;

            }
        }

基本上我使用的是Xzing条形码扫描程序库,如果用户离开运行条形码扫描代码的视图,我想要相机(即条形码扫描仪)在后台关闭。

Basically I am using the Xzing barcode scanner library and if a user moves away from the view that runs the barcode scanning code, I want the Camera(ie barcode scanner) to shutdown in the background.

改为使用任务。