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的更多相关文章

  1. Keil c51现No Browse information available

    keil c51 不能使用:Go to Definition of....的解决方法 最近使用keil c51 开发usb固件,当向vc一样使用Go to Definition of....时,出现警 ...

  2. Silverlight第三方控件专题

    原文http://www.cnblogs.com/nasa/archive/2008/12/01/1344927.html 这里我收集整理了目前网上silverlight第三方控件的专题,若果有所遗漏 ...

  3. STM32环境搭建/学习观点/自学方法 入门必看

    文章转自armfly开发板V4软件开发手册,分享学习~ 今天有幸看到armfly的开发板软件开发手册,开头的基础知识,真的很有用,还好有看到,一切都不迟,感悟很多,摘抄部分,学习分享~ 关于开发环境的 ...

  4. 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人阅读 ...

  5. IAR右键无法跳转到定义 的解决方法

    用IAR编译程序,有时候编译通过了,但是右键无法GO TO Definition  解决方法有两个: 第一.Tools -> Option  -> Project 把Generate br ...

  6. Keil工程文件的建立、设置与目标文件的获得

    单片机开发中除必要的硬件外,同样离不开软件,我们写的汇编语言源程序要变为 CPU 可以执行的机器码有两种方法,一种是手工汇编,另一种是机器汇编,目前已极少使用手工 汇编的方法了.机器汇编是通过汇编软件 ...

  7. keil教程

    KEIL C51标准C编译器为8051微控制器的软件开发提供了C语言环境,但是界面是英文的好多初学者看很多教程都是一头雾水,这个相对简单的教程.KEIL C51编译器的功能不断增强,使你可以更加贴近C ...

  8. Keil - 编译错误总结 01

    Keil 编译 STM32project,出现下述错误. 并且.   Options for Target  -> Output   -  Browse  Information 选项无法勾选. ...

  9. 【STM32H7教程】第4章 STM32H7工程模板建立(MDK5)

    完整教程下载地址:http://forum.armfly.com/forum.php?mod=viewthread&tid=86980 第4章   STM32H7工程模板建立(MDK5) 本章 ...

随机推荐

  1. Excel开发学习笔记:界面交互与控件的布局

    遇到一个数据处理自动化的问题,于是打算开发一个基于excel的小工具.在业余时间一边自学一边实践,抽空把一些知识写下来以备今后参考,因为走的是盲人摸象的野路子,幼稚与错误请多包涵. , ).value ...

  2. BIOS简单设置 解析“集成显卡”内存占用问题

    很多使用集成显卡的用户会发现,在系统信息窗口中,内存容量和实际不一样.比如系统内存显示4GB,可用3.48G之类.这不可用的一部分内存到哪去了? 其实减少的这部分内存是被集成显卡占用当做显存使用了.而 ...

  3. redis学习一 大体概述

    redis 命令查找:http://doc.redisfans.com/ 1,redis 技术简介以及疑问      redis是一个开源的,内存存储的数据结构服务器.可以用做数据库,高速缓存和消息队 ...

  4. SqlServer——事务—隔离级别

    隔离实际上是通过锁来实现的,作用于整个事务,它通常在事务开始前指定,如 SET TRANSACTION ISOLATION LEVEL READ Committed,指定后面的事务为 已提交读:而锁是 ...

  5. struts1.2里的ActionMessages的使用

    转自:https://blog.csdn.net/oswin_jiang/article/details/4582187

  6. Shell编程进阶 2.2 shell数组

    给一个字符指定一个数组 怎么显示数组 a= echo $a a=( ) echo $a echo ${a[@]} echo ${a[*]} 指定显示数组中第几个数字 echo ${a[]} echo ...

  7. 部署和调优 2.9 mysql主从配置-3

    测试 先给主mysql解锁 > unlock tables; 删除一个表 > use db1; > show tables; > drop table help_categor ...

  8. Android Studio 第一次配置及其使用

    第一次使用Android Studio时你应该知道的一切配置 http://www.cnblogs.com/smyhvae/p/4390905.html gradle V2.10 版: http:// ...

  9. java,js判断全角半角

    function chkHalf(str){ for(var i=0;i { strCode=str.charCodeAt(i); if((strCode>65248)||(strCode==1 ...

  10. Android 数据库 OrmLite Failed to open database

    04-01 16:49:32.720: E/SQLiteLog(1894): (14) cannot open file at line 30204 of [00bb9c9ce4]04-01 16:4 ...