摘要: Pause and Play with AwaitMads TorgersenDownload the Code SampleAsynchronous methods in the upcoming versions of Visual Basic and C# are a great way to get the callbacks out of your asynchronous programming. In this article, I’ll take a closer look at what the new await keyword actually does, startin 阅读全文
posted @ 2011-10-18 10:16 yedafeng 阅读(741) 评论(0) 推荐(0) 编辑
摘要: OperationContextDispatchRuntimeEndpointDispatcherDispatcherBuilderChannelDispatcherChannelHandlerIChannelListenerMessageRpcServiceHostServiceThrottleInstanceContextProviderOtherExtensible interfaces我突然有个想法,希望能够找出Server端的OperationContext是在何时何处被初始化,这样我就可以准确判断出合适能够访问OperationContext.Current。但是,随着研究的深入, 阅读全文
posted @ 2011-08-06 11:21 yedafeng 阅读(302) 评论(0) 推荐(0) 编辑
摘要: .NET 4引入了一个新的概念:dynamic,简单地说就是支持运行时判断类型。它的实现依赖于编译器以及DLR,前者用于根据调用的函数来决定使用哪个CallSiteBinder,同时决定使用何种类型的delegate,最后在IL中动态生成代码。以上面的代码片段为例,通过IL DASN可以得知,它并没有直接访问Test属性,编译器显然不会这么做因为sampleObject并没有这个属性。编译器会产生一个称为dynamic call site的东西,它会在运行时通过C# runtime binder以及DLR管理方法或属性的访问。下面的代码片段是从Reflector中截取出来的,它清楚地展现了对T 阅读全文
posted @ 2011-03-15 21:37 yedafeng 阅读(727) 评论(0) 推荐(0) 编辑
摘要: Recently, I am curious about what WCF client really does when creating proxy object (ClientBase) or use the ChannelFactory directly.If service reference is added by using the Visual Studio directly, it will automatically create a service client for you, it implements the service contract and inherit 阅读全文
posted @ 2011-03-02 15:34 yedafeng 阅读(398) 评论(0) 推荐(0) 编辑
摘要: How to create a new DependencyProperty?Let’s start from creating a new DependencyProperty. This example is simple, a new UserControl is created, which is named TestCtrl. In this UserControl, I create a new DependencyProperty as the following codes.public partial class TestCtrl : UserControl{public s 阅读全文
posted @ 2011-03-02 15:30 yedafeng 阅读(276) 评论(0) 推荐(0) 编辑
摘要: Set the value of DPIn the preceding sections, it shows you how to register and what .NET does for you. If we want to set the value of MyContent, we just need to dot this:this.TestCtrl1.MyContent = "Button Clicked!";According to the definition of this property, you can find that it invokes 阅读全文
posted @ 2011-03-02 15:28 yedafeng 阅读(207) 评论(0) 推荐(0) 编辑
摘要: How does this class serialize the contract? And why does it have performance issue? These questions make me mad these days, because my project suffers a lot from this class. I have to spend several hours to figure this thing out. Here is what it does.There is an internal class named DataContract use 阅读全文
posted @ 2011-03-02 15:24 yedafeng 阅读(320) 评论(0) 推荐(0) 编辑
摘要: 在WPF中, 我们可以通过调用ChangeLogicalParent 来改变一个元素的logical parent, 但是这个过程是非常耗时的,以下是该函数的运行过程。 阅读全文
posted @ 2011-03-02 15:21 yedafeng 阅读(194) 评论(1) 推荐(0) 编辑