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. Oracle Flushback 学习测试

    Oracle Flushback 学习测试:三思笔记 Flashback恢复 从9i开始,利用oracle查询的多版本一致的特点,实现从回滚段中读取一定时间内在表中操作的数据,被称为 flashbac ...

  2. win10/server2019 系统安装 详解

    https://www.microsoft.com/zh-cn/software-download/windows10 https://go.microsoft.com/fwlink/?LinkId= ...

  3. Rails、Nginx、Passenger、bundle之间的协作关系

    引自:http://www.zhihu.com/question/20062163 Bundle是Gem包的依赖管理工具,RubyGem本身有依赖管理为何还要Bundle呢?有时候两个gem虽然都依赖 ...

  4. 2015.3.7 Dll CString不能作为传入参数而要用char*

    extern "C" __declspec(dllexport) void CalcArc_2(Point2D& pm, double am, double an, CSt ...

  5. C# Remoting 简单实现

    此处下载源代码(VS2010编译通过)   http://files.cnblogs.com/files/qqhfeng/%E8%BF%9C%E7%A8%8B%E8%B0%83%E7%94%A8%E6 ...

  6. awk简要使用

    1          前言 awk是Unix环境下一种非常好的语言,适合于文本处理和报表生成,它还有许多精心设计的特性,允许进行特殊技巧程序设计.对于短消息来说,比如处理话单文件,使用awk就非常方便 ...

  7. Android指针管理:RefBase,SP,WP (二)

    (1)在Android中,RefBase结合了sp和wp,实现了一套通过引用计数的方法来控制对象声明周期的方法. RefBase的定义在/frameworks/base/include/utils/R ...

  8. CSS技巧: CSS隐藏文字的方法(CSS text-indent: -9999px;)

    建站过过程中朋友喜欢把网站名称用H1表示,但从美观考虑,要用logo图片来代替h1,这时需要隐藏h1内的这段文字,但又不能对搜索引擎不友好,否则就失去了定义h1标签的意义. 在CSS中如何以图代字,找 ...

  9. js面试题知识点全解(一原型和原型链)

    1.如何准确判断一个变量是数组类型2.写一个原型链继承的例子3.描述new一个对象的过程4.zepto(或其他框架)源码中如何使用原型链知识点:1.构造函数2.构造函数-扩展3.原型规则和示例4.原型 ...

  10. 列表控件JList的使用

    --------------siwuxie095                             工程名:TestUI 包名:com.siwuxie095.ui 类名:TestList.jav ...