WPF架构分析
1.DisptcherObject提供了线程和并发模型,实现了消息系统。
呈现层 0 无图形硬件加速。 所有图形功能都使用软件加速。 DirectX 版本级别低于 9.0。
呈现层 1 某些图形功能使用图形硬件加速。 DirectX 版本级别高于或等于 9.0。
呈现层 2 大多数图形功能都使用图形硬件加速。 DirectX 版本级别高于或等于 9.0。
{private SomeEventWeakEventManager(){}/// <summary>/// Add a handler for the given source's event./// </summary>public static void AddHandler(EventSource source,EventHandler<SomeEventEventArgs> handler){if (source == null)throw new ArgumentNullException("source");if (handler == null)throw new ArgumentNullException("handler");CurrentManager.ProtectedAddHandler(source, handler);}/// <summary>/// Remove a handler for the given source's event./// </summary>public static void RemoveHandler(EventSource source,EventHandler<SomeEventEventArgs> handler){if (source == null)throw new ArgumentNullException("source");if (handler == null)throw new ArgumentNullException("handler");CurrentManager.ProtectedRemoveHandler(source, handler);}/// <summary>/// Get the event manager for the current thread./// </summary>private static SomeEventWeakEventManager CurrentManager{get{Type managerType = typeof(SomeEventWeakEventManager);SomeEventWeakEventManager manager =(SomeEventWeakEventManager)GetCurrentManager(managerType);// at first use, create and register a new managerif (manager == null){manager = new SomeEventWeakEventManager();SetCurrentManager(managerType, manager);}return manager;}}
/// <summary>/// Return a new list to hold listeners to the event./// </summary>protected override ListenerList NewListenerList(){return new ListenerList<SomeEventEventArgs>();}/// <summary>/// Listen to the given source for the event./// </summary>protected override void StartListening(object source){EventSource typedSource = (EventSource)source;typedSource.SomeEvent += new EventHandler<SomeEventEventArgs>(OnSomeEvent);}/// <summary>/// Stop listening to the given source for the event./// </summary>protected override void StopListening(object source){EventSource typedSource = (EventSource)source;typedSource.SomeEvent -= new EventHandler<SomeEventEventArgs>(OnSomeEvent);}/// <summary>/// Event handler for the SomeEvent event./// </summary>void OnSomeEvent(object sender, SomeEventEventArgs e){DeliverEvent(sender, e);}}
WPF架构分析的更多相关文章
- 【WPF系列】基础学习-WPF架构概览
引言 WPF从.net framewok3.0加入以来,经历了很多跟新.每次更新都给用户带来了新的功能或者优化性能.下面我们首先看下WPF再.netFramework中的位置,接着介绍下WPF的架构框 ...
- tomcat架构分析 (Session管理)
Session管理是JavaEE容器比较重要的一部分,在app中也经常会用到.在开发app时,我们只是获取一个session,然后向session中存取数据,然后再销毁session.那么如何产生se ...
- Magento架构分析,Magento MVC 设计分析
Magento架构分析,Magento MVC 设计分析 分类:Magento 标签:Magento MVC.Magento架构 669人浏览 Magento 采用类似 JAVA的架构,其扩展与稳定性 ...
- Flickr 网站架构分析
Flickr 网站架构分析 Flickr.com 是网上最受欢迎的照片共享网站之一,还记得那位给Windows Vista拍摄壁纸的Hamad Darwish吗?他就是将照片上传到Flickr,后而被 ...
- Android架构分析之Android消息处理机制(二)
作者:刘昊昱 博客:http://blog.csdn.net/liuhaoyutz Android版本号:4.4.2 在上一篇文章中我们看了一个使用Handler处理Message消息的样例,本文我们 ...
- NopCommerce架构分析(转载)
原文 一,NopCommerce架构分析之开篇 NopCommerce是.net开源项目中比较成熟的一款业务应用框架,也是电子商务系统中的典范.所以很想多学习一下里面的设计和实现方式. 二,NopCo ...
- Qualcomm Android display架构分析
Android display架构分析(一) http://blog.csdn.net/BonderWu/archive/2010/08/12/5805961.aspx http://hi.baidu ...
- tomcat架构分析-索引
出处:http://gearever.iteye.com tomcat架构分析 (概览) tomcat架构分析 (容器类) tomcat架构分析 (valve机制) tomcat架构分析 (valve ...
- [转载] 关于“淘宝应对"双11"的技术架构分析”
微博上一篇最新的关于“淘宝应对"双11"的技术架构分析”.数据产品的一个最大特点是数据的非实时写入.
随机推荐
- sqlserver中的时间比较
例子: select count(*) from table where DATEDIFF ([second], '2004-09-18 00:00:18', '2004-09-18 00:00:19 ...
- redis数据迁移操作
redis客户端连接命令,分别连接旧环境中的主从redis Src目录下./redis-cli -h IP -p PORT 使用info replication 命令找出主redis使用客户端命令连接 ...
- mongodb的IO测试工具 mongoperf
之前没发现mongoperf这个工具,测试IO的状态用的是iostat来进行观察. mongoperf < myjsonconfigfile echo "{nThreads:2,fi ...
- Grunt实战 --- 通过nodejs和Grunt实现项目在线构建
本文主要说明,实现在线自动构建项目的实现方法.
- 响应式布局【3】 --- bootstrap
本片文章主要讲解Bootstrap中如何实现响应式布局的. 参考资料&内容来源: https://code.ziqiangxuetang.com/bootstrap/bootstrap-gri ...
- 【题解】 P5022旅行
[题解]P5022 旅行 当给定你一颗树的时候,这题就是一道送分题,凉心啊! 但是给定你一颗基环树呢? 暴力断环直接跑. 但是数据范围\(n\le 1000\) 乱做就完事了. 考场上这样想的,对于\ ...
- install_driver(mysql) failed
安装好了mysql监控神器innotop,正得意,innotoop不可用,其错误提示为install_driver(mysql) failed: Can't load '/usr/lib64/ ...
- oracle-jforum论坛链接Oracle
问题描述 jforum论坛链接Oracle jforum论坛链接Oracle数据库 论坛主题页面不显示 是权限引起的吗 解决方案 页面不显示,你需要看一下错误,估计是配置不对引起的 参考一下这个 jf ...
- PAT 甲级 1116. Come on! Let's C (20) 【循环判断】
题目链接 https://www.patest.cn/contests/pat-a-practise/1116 思路 注意一个细节 如果没有本来 ID 的 后来又查了这个ID 不是输出 checked ...
- 用ant编译打包时 警告:编码 GBK 的不可映射字符
原因,参考http://zhidao.baidu.com/question/26901568.html 添加如下的红色一行后编译通过<target name="compile" ...