silverlight browse information
public class Browser
{ /// <summary> /// During static instantiation, only the Netscape flag is checked
/// /// </summary>
///
static Browser()
{
_isNavigator = HtmlPage.BrowserInformation.Name.Contains("Netscape");
}
/// <summary> /// Flag indicating Navigator/Firefox/Safari or Internet Explorer /// </summary>
private static bool _isNavigator;
/// <summary> /// Provides quick access to the window.screen ScriptObject /// </summary>
///
private static ScriptObject Screen
{
get
{
ScriptObject screen = (ScriptObject)HtmlPage.Window.GetProperty("screen");
if (screen == null)
{
throw new InvalidOperationException();
} return screen;
}
}
/// <summary> /// Gets the window object's client width /// </summary>
public static double ClientWidth
{
get
{
return _isNavigator ? (double)HtmlPage.Window.GetProperty("innerWidth")
: (double)HtmlPage.Document.Body.GetProperty("clientWidth");
}
}
/// <summary> /// Gets the window object's client height /// </summary>
public static double ClientHeight
{
get
{
return _isNavigator ? (double)HtmlPage.Window.GetProperty("innerHeight")
: (double)HtmlPage.Document.Body.GetProperty("clientHeight");
}
}
/// <summary> /// Gets the current horizontal scrolling offset /// </summary>
///
///
public static double ScrollLeft
{
get
{
return _isNavigator ? (double)HtmlPage.Window.GetProperty("pageXOffset")
: (double)HtmlPage.Document.Body.GetProperty("scrollLeft");
}
}
/// <summary>
/// Gets the current vertical scrolling offset /// </summary>
///
public static double ScrollTop
{
get
{
return _isNavigator ? (double)HtmlPage.Window.GetProperty("pageYOffset")
: (double)HtmlPage.Document.Body.GetProperty("scrollHeight");
}
}
/// <summary> /// Gets the width of the entire display /// </summary>
public static double ScreenWidth
{
get
{
return (double)Screen.GetProperty("width");
}
}
/// <summary> /// Gets the height of the entire display /// </summary>
public static double ScreenHeight
{
get
{
return (double)Screen.GetProperty("height");
}
}
/// <summary> /// Gets the width of the available screen real estate, excluding the dock /// or task bar /// </summary>
///
///
public static double AvailableScreenWidth
{
get
{
return (double)Screen.GetProperty("availWidth");
}
}
/// <summary> /// Gets the height of the available screen real estate, excluding the dock /// or task bar /// </summary>
///
///
public static double AvailableScreenHeight
{
get
{
return (double)Screen.GetProperty("availHeight");
}
}
/// <summary> /// Gets the absolute left pixel position of the window in display coordinates /// </summary>
public static double ScreenPositionLeft
{
get
{
return _isNavigator ? (double)HtmlPage.Window.GetProperty("screenX")
: (double)HtmlPage.Window.GetProperty("screenLeft");
}
} /// <summary> /// Gets the absolute top pixel position of the window in display coordinates /// </summary>
public static double ScreenPositionTop
{
get
{
return _isNavigator ? (double)HtmlPage.Window.GetProperty("screenY")
: (double)HtmlPage.Window.GetProperty("screenTop");
}
}
}
silverlight browse information的更多相关文章
- Keil c51现No Browse information available
keil c51 不能使用:Go to Definition of....的解决方法 最近使用keil c51 开发usb固件,当向vc一样使用Go to Definition of....时,出现警 ...
- Silverlight第三方控件专题
原文http://www.cnblogs.com/nasa/archive/2008/12/01/1344927.html 这里我收集整理了目前网上silverlight第三方控件的专题,若果有所遗漏 ...
- STM32环境搭建/学习观点/自学方法 入门必看
文章转自armfly开发板V4软件开发手册,分享学习~ 今天有幸看到armfly的开发板软件开发手册,开头的基础知识,真的很有用,还好有看到,一切都不迟,感悟很多,摘抄部分,学习分享~ 关于开发环境的 ...
- error BK1506 : cannot open file '.\Debug\????????.sbr': No such file or dire
http://blog.csdn.net/shuilan0066/article/details/8738035 分类: 调试错误信息2013-03-29 19:08492人阅读 ...
- IAR右键无法跳转到定义 的解决方法
用IAR编译程序,有时候编译通过了,但是右键无法GO TO Definition 解决方法有两个: 第一.Tools -> Option -> Project 把Generate br ...
- Keil工程文件的建立、设置与目标文件的获得
单片机开发中除必要的硬件外,同样离不开软件,我们写的汇编语言源程序要变为 CPU 可以执行的机器码有两种方法,一种是手工汇编,另一种是机器汇编,目前已极少使用手工 汇编的方法了.机器汇编是通过汇编软件 ...
- keil教程
KEIL C51标准C编译器为8051微控制器的软件开发提供了C语言环境,但是界面是英文的好多初学者看很多教程都是一头雾水,这个相对简单的教程.KEIL C51编译器的功能不断增强,使你可以更加贴近C ...
- Keil - 编译错误总结 01
Keil 编译 STM32project,出现下述错误. 并且. Options for Target -> Output - Browse Information 选项无法勾选. ...
- 【STM32H7教程】第4章 STM32H7工程模板建立(MDK5)
完整教程下载地址:http://forum.armfly.com/forum.php?mod=viewthread&tid=86980 第4章 STM32H7工程模板建立(MDK5) 本章 ...
随机推荐
- maven jetty 配置
对于jdk8增加如下配置: <plugin> <groupId>org.eclipse.jetty</groupId> <artifactId>jett ...
- springmvc----demo---login---bai
web.xml配置: <?xml version="1.0" encoding="UTF-8"?> <web-app version=&quo ...
- DLL 演示
编写DLL时的函数与一般的函数方法基本一样.但要对库中的函数进行必要的声明,以说明哪些函数是可以导出的,哪些函数是不可以导出的. 把DLL中的函数声明为导出函数的方法有两种: 一是使用关键字_decl ...
- 记一次完整的android源码截屏事件的捕获<标记砖>
http://blog.csdn.net/buptgshengod/article/details/19911909?utm_source=tuicool&utm_medium=referra ...
- Elasticsearch之curl创建索引
前提,是 Elasticsearch之curl创建索引库 [hadoop@djt002 elasticsearch-2.4.3]$ curl -XPUT 'http://192.168.80.200: ...
- URL网址参数解析类
/** * Created by myc on 2015/12/9. */ import android.text.TextUtils; import java.util.HashMap; impor ...
- [Elasticsearch2.x] 多字段搜索 (三) - multi_match查询和多数字段 <译>
multi_match查询 multi_match查询提供了一个简便的方法用来对多个字段执行相同的查询. NOTE 存在几种类型的multi_match查询,其中的3种正好和在“了解你的数据”一节中提 ...
- GitHub Blog创建以及本地管理(转)
GitHub Blog创建以及本地管理 创建 注册GitHub账户 首页点击新建仓库 New repository repository name必须为 Owner.github.io EX:我的 ...
- gym - 101673I Twenty Four, Again (表达式树枚举)
题意及思路 模拟场上用一般方法枚举非常麻烦,一个小时没写出来,还是自己太菜了...用表达式树枚举有一个好处,判断需不需要加括号非常方便,只有当前节点运算符的优先级高于子节点的时候,才需要给子节点加一个 ...
- 如何将.jpg图片 转换成.eps 格式图片
在使用latex写作论文的时候,需要插入一些图片,但是往往有些图片不是eps格式的.虽然网上有如何插入jpg格式的图片方法,但是经过我实验后发现都不太管用.最后找到一个比较靠谱的方法,使用latx本身 ...