在Windows Phone 8中并行 [英] Parallel in Windows Phone 8

查看:62
本文介绍了在Windows Phone 8中并行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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



这就是我用来库的价格。


        ;  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.

推荐答案

改为使用任务。


这篇关于在Windows Phone 8中并行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆