Silverlight判断当前模式是OOB还是Web
来源:互联网 发布:外国社交软件 编辑:程序博客网 时间:2024/04/29 04:00
Silverlight可以以Web方式和OOB模式运行,在OOB模式中有一些功能是不能使用的,我们可以在程序中加一些处理代码来对应不同的操作,这里我修改了App类的代码,加入一个模式判断的代码,原App代码如下:
public partial class App : Application { public App() { this.Startup += this.Application_Startup; this.Exit += this.Application_Exit; this.UnhandledException += this.Application_UnhandledException; InitializeComponent(); }
修改后的代码如下:
public partial class App : Application { public static App self; public bool IsOOB = false; public App() { this.Startup += this.Application_Startup; this.Exit += this.Application_Exit; this.UnhandledException += this.Application_UnhandledException; InitializeComponent(); self = this; try { var win = HtmlPage.Window; } catch { IsOOB = true; } }
使用代码如下:
if (App.self.IsOOB) { //这是OOB模式 } else { //这是Web模式 }
- Silverlight判断当前模式是OOB还是Web
- 判断当前启动模式是EFI还是BIOS
- Silverlight OOB 模式关闭窗口
- Silverlight 客戶端桌面模式(OOB 模式)
- 判断当前页面是刷新还是关闭
- 判断当前环境是中文还是英文
- 判断当前设备是平板还是手机
- 判断当前是手机还是平板
- 判断当前设备是手机还是平板
- 判断当前设备是平板还是手机!
- 判断当前设备是手机还是平板
- 判断当前是DEBUG还是Release构建
- Silverlight OOB 模式调用其它程序
- Silverlight OOB模式中显示摄像头画面
- Silverlight OOB
- 写一个程序判断当前系统存储模式是大端还是小端
- PHP 判断终端是wap还是web
- 判断一个工程是java还是web
- UVA - 11991 Easy Problem from Rujia Liu?
- 托业资料
- 不懂类,对象,包,接口,继承,多态的C++高手
- asp.net 验证码类
- asp.net 工具类 XMLProcess
- Silverlight判断当前模式是OOB还是Web
- wm_concat函数的排序问题
- java线程入门学习1
- Oracle函数wmsys.wm_concat的使用
- 点滴
- 之间的差最小
- DllMain中不当操作导致死锁问题的分析——DllMain中要谨慎写代码(完结篇)
- 用例图 extend include
- linux g++ 库文件搜索路径