C#
文章平均质量分 85
iteye_13882
这个作者很懒,什么都没留下…
展开
-
wpf - example to enhance ComboBox for AutoComplete
first let’s see an example of the code (the behavior code that turns a combobox to a source of autocomplete source) using System;using System.Collections.Generic;using System.Linq;using ...原创 2014-09-19 15:56:19 · 259 阅读 · 0 评论 -
c# - Syntax Evolution form delegate to lambda expression
First let's see the code example upfront, to give readers the feeling of topic that we are going to cover in this post. Func<string, int> func = delegate(string text) { return text...原创 2012-10-10 17:16:55 · 72 阅读 · 0 评论 -
C# - Calling an extension methods on null references
As many of you already know, extension methods gives you the ability to write code in such a way that you can call a.ExtensionMethods() while ExtensionMethods is with such signature public stat...原创 2012-10-10 16:57:03 · 74 阅读 · 0 评论 -
Reprint - MVVM Lambda vs INotifyPropertyChanged vs DependencyObject
THis page is a reprint of the document at http://blog.quantumbitdesigns.com/2010/01/26/mvvm-lambda-vs-inotifypropertychanged-vs-dependencyobject/, under the same title of "MVVM - Lambad vs INotify...原创 2012-06-15 11:01:37 · 133 阅读 · 0 评论 -
Jumptlist in WPF and win7 explained
THis article is based on the study of the page http://wpftutorial.net/Jumplists.html and it demonstrate the use of a cool feature that is called Jumplist which is avaialbe in Windows 7. her...原创 2012-06-14 15:53:39 · 98 阅读 · 0 评论 -
Use of Interface to express constraint
let's first see some live example of how to use the Interfaces to express the idea of something abstract. First of all, let 's see the Ikey interface and some of the other interfaces. ...原创 2012-06-13 11:19:16 · 59 阅读 · 0 评论 -
C# – CoerceValueCallback合并、替换元数据值
Topic: C# – CoerceValueCallback标题: C# – CoerceValueCallback合并、替换元数据值像在the PropertyMetadta.CoerceValueCallback property中说道As in the references page the PropertyMetadta.CoerceValueCallback proper...原创 2013-08-05 21:59:08 · 510 阅读 · 0 评论 -
wpf – ListView交替背景色
Wpf – Alternate background color of ListView.Topic: Wpf – Alternate background color of ListView.标题: wpf – ListView交替背景色总的来说有三种变换背景色的方法,他们是· 定义一个IValueConverter的Style· 扩展Lis...原创 2013-07-02 20:56:46 · 1046 阅读 · 0 评论 -
wpf - Customize the grid lines for original wpf Grid control
The System.WIndows.Controls.Grid classes does provide a ShowGridLines method, while it does not provide means to override the style of the grid lines. Ian Oakes has shows some good ways to use...原创 2012-09-27 12:01:24 · 78 阅读 · 0 评论 -
C# - Timers from different namespaces and use tips
We have discussed timers, see the post zz - reprint of Comparing the Timer Classes in the .NET Framework Class Library C# have provided four kinds of timers for user to use. They are in t...原创 2012-09-26 13:19:31 · 72 阅读 · 0 评论 -
c# - Convert from System.Drawing.Image to System.WIndows.Media.ImageSource
In Previous discussion, we have seen the code Convert from System.Drawing.Icon to System.Media.ImageSource and vice versa System.Windows.Drawing.Image is the base class of and System.Drawing....原创 2012-09-25 14:27:56 · 540 阅读 · 0 评论 -
c# - BitVecttor and its use
BitVector is something that provided by the .net Framework, which is provided to aim the development in the memory effecient way. You can use the BitVector to create some bit flags construct; T...原创 2012-09-20 10:53:34 · 75 阅读 · 0 评论 -
c# - Bit fields in C#
this is a thread that is inspired by the thoght and discusson from the stackoverflow. and hte original post is here: Bit fields in C#. As a background/foundamental knowledge,or the first quest...原创 2012-09-20 10:25:14 · 485 阅读 · 0 评论 -
c# - upgrade a project to target 4.0
When you upgrade a project to 4.0, you may need to do the following to make it compile. The reasos is because the reference has gone through some structure changes. System.Core.dll 3.0 - to re...原创 2012-09-18 17:51:46 · 99 阅读 · 0 评论 -
c# - .net 4.0 security permission attributes
In some enterprise environment, where the corporation may have their own deployment strategy that every assemblies is centrallized deployed to some remote shared locations. Then it might have the...原创 2012-09-18 16:39:27 · 281 阅读 · 0 评论 -
c# - class designer: facilitate your design work
it is more powerful to design your work with the help of tools. Inside Visual Studio, the tool is the Class Diagram Designer. this post does not contains any specific guidelien on how to desig...原创 2012-09-14 15:04:07 · 153 阅读 · 0 评论 -
c# - object and collection initializer
Since the .net 4.0 there introduce the concept of object initializer and collection initializer. They are especially handy to cut the amount of code to write expiclity and delegate the work to Compile...原创 2012-09-14 14:16:14 · 84 阅读 · 0 评论 -
c# - define new excptions
If appropriate, you should best use built-in exceptions if the meansing is obvious. however, you do have the need to define your own set of exception. The custom exception that you defined may/may not...原创 2012-09-14 12:36:44 · 81 阅读 · 0 评论 -
c# - Sample of Lambda expression on List<T> and Events
This is not rocket science, but it does do server a good example on how to use the expression on List<T> and event so that you can refer back some point in life. First, we see List<T> ...原创 2012-10-10 18:00:50 · 76 阅读 · 0 评论 -
c# - Collection initializing divergence in array and collection such as List
You may have seen the comment that I have put in the code in the post : c# - Sample of Lambda expression on List<T> and Events.. And also, I have keep some post on the discussion of Collection I...原创 2012-10-10 18:22:43 · 79 阅读 · 0 评论 -
C# - some debugger aid and tricks
you can employe some tricks or employ some aids that helps you effecient at the C# debugger, generally with the smart tricks or aids, you want to help debugger to print more useful informationhi...原创 2013-03-27 11:14:20 · 80 阅读 · 0 评论 -
Anatomy on the event add/remove handler
If you open a C# class, and if the C# class has event delcared, then you might be able to see code as follow. // Events internal event EventHandler<ModuleInitializeArgs> AfterModuleI...原创 2013-03-01 18:24:19 · 84 阅读 · 0 评论 -
C# - glance over the Type and related to Generic
You may wonder if List<> is the same type as List<String> and what is the relation between those Two. Here is some example to show you how to find the relationship between the two and wha...原创 2013-01-25 10:45:37 · 69 阅读 · 0 评论 -
c# :design of generic version of interface with its non generic verion - Part 2
This is an follow up discussion on the previous impl of the c# - design of generic version of interface with its non generic verion. In this example, I will introduce a more real world like example (...原创 2013-01-25 10:25:19 · 78 阅读 · 0 评论 -
c# - design of generic version of interface with its non generic verion
sometimes you may want to design some interfaces so that it can handle both generic classes and the non-generic classes. The reason for oding this is 1. for backward compatability 2. you may deal wi...原创 2013-01-25 10:05:46 · 73 阅读 · 0 评论 -
C# 4.5 - the await and async return types
In .net 4.5, there are new keyword, which are await and async. which is used widely in the asynchronous programming. In this post we are going to examining in the language level , what is the require...原创 2013-01-21 15:25:14 · 87 阅读 · 0 评论 -
c# - DataSet and Xml
you can work with DataSet with a lot of controls, include the infragistics XamDataGrid and the DataGrid controls. DataSet has this ReadXml method to allow you to read data from Xml, so that you c...原创 2012-12-18 15:20:55 · 78 阅读 · 0 评论 -
wpf - IG xamDataGrid bind to XmlDataProvider with Xml Island
Sometimes you may bind to some XmlDataProvider with the data provided as Xml Island. with XmlDataProvider, you may write something as follow. <XmlDataProvider x:Key="OrderData2" ...原创 2012-12-18 14:28:48 · 134 阅读 · 0 评论 -
Why you cannot create instance of XName
If you are familiar with XDocument, you will know that this is now lega. var xname = new XName("Condition"); however, you may need to use XName in some occasions, so how can the XName ins...原创 2012-06-28 14:50:56 · 72 阅读 · 0 评论 -
XDocument and XPath
To use XDocument with XPath, you will need to reference the following namespace. using System.Xmlusing System.Xml.XPath The former is useful to introduce XDocument, the later will add t...原创 2012-06-28 14:42:05 · 196 阅读 · 0 评论 -
zz - Reprint - How do I create an immutable Class?
Guide lines to make a immutable C# classes. the article is based on the post here: http://stackoverflow.com/questions/352471/how-do-i-create-an-immutable-class You cannot asssume that the C...原创 2012-06-18 12:55:27 · 93 阅读 · 0 评论 -
Reprint - atomicity, volatility and immutability are different, part one
There is one of the triplet of the Eric Lippert's blog on "Atomicity, volatility and Immutability" part I, the original post is availabe here : http://blogs.msdn.com/b/ericlippert/archive/2011/05/2...原创 2012-06-18 11:25:17 · 116 阅读 · 0 评论 -
wpf - translate winform button/mouse event to wpf events
It is common that we sometimes have to host some winforms controls, things like the you have a WPF control which is called NoitfyIcon where you want to wrap a winform Notify, but to enhance the Winfor...原创 2012-12-12 17:37:01 · 184 阅读 · 0 评论 -
C# - Example to Refactor-proof reference to members
as we have discussed on the previous example that we have introduce the code snippet like this (see here): serializationContext.AddProperty(x => x.BirthDate); in this post, we are going ...原创 2012-11-12 19:01:02 · 95 阅读 · 0 评论 -
C# - Select many as the flatMap in Scala
If you are faimiar with Scala, you must have heard or used the function flatMap which is a very useful function that enable you to flat a collection. There is no such flatMap or Map method as in ...2012-10-26 15:19:22 · 177 阅读 · 0 评论 -
c# - expression tree and lambda - serie 2
We have covered the topic of expression tree and lambda - serie 1. Serie 2 is like a complementary to serie 1 to cover something that is not the core but may come useful when you are in need of it. ...原创 2012-10-12 14:22:18 · 127 阅读 · 0 评论 -
c# - expression tree and lambda - serie 1
In this post, we are going to discuss the topic on the Expression Tree and Delegate and Lambda, we are going to go through from simple expresison, then expression converted to delegate (lambda), and t...原创 2012-10-12 13:45:04 · 143 阅读 · 0 评论 -
c# - get time of accuracy of nanoseconds
To get time of nanoseconds accuracy, what you can do inside C# is to use the Stopwatch classes from the System.Stopwatch class. below is the code that shows how to program on nanoseconds . ...原创 2012-09-13 16:52:13 · 168 阅读 · 0 评论 -
C# - 简单介绍TaskScheduler
标题: C# - 简单介绍TaskSchedulerTitle: C# - A Brief bump to the TaskSchedulertask Scheduler根据定义The task Scheduler by the definition blurb.“Is the class where the usage context is within the task libra...原创 2013-06-29 17:18:36 · 776 阅读 · 0 评论 -
C# - Dabble with IObservable<T> and IObserver<T>
Delegate offers some nice features of observable pattern, however, there are some limiation on the delgate implemented observable patterns. Why not Delegate For onething, there is no way to kn...原创 2012-09-04 13:44:25 · 209 阅读 · 0 评论