- 浏览: 403152 次
- 性别:
- 来自: 上海
-
最新评论
文章列表
Most when you are dealing with the printing, you are dealing with the System.Printing namespaces. And if the particular UI is wpf, another extra namespace that you will deal with is the System.Drawing.Printing namespace.
However, what if you are dealing with is the Winforms? Two classes that ar ...
It is a common practise to check if a variable is null, and if it is null, assign some value to it, then return the assigned variable, or just return the cached value if the variable is not nulll..
suppose you have a field called m_mydelegateCommand, and you want to ensure non-null value is retu ...
The original post is available here: MVVM Infrastructure: DelegateCommand; it is one of the quartet of Kent Boogaart's MVVM pattern's infrastructure.
the reason to respost the thread is because there is long debate over whether or not the RoutedCommand is too heavy due to its complexity in MVVM ...
Following to How to: Create a RoutedCommand, which demonstrate how to use the Static field to create a RoutedEvent rather than reuse the System RoutedCommand.
Based on that documentaion, and based on the discussion in my previous post - WPF the routed event and routed command, I have come up a s ...
The topic originate/induce/beget/engender from the discussion of the DelegateCommand vs RoutedCommand. However, there are a grand topic covering with first the routed event.
Below is transcribed from the blog that is available WPF Routed Commands: Overview and Exampels ;
And it has several ex ...
Martin Odersky has written a good artle on explaining some of the new construct he conceived/conceptualized in his new artile.
the article is available here in this site: http://lampwww.epfl.ch/~odersky/papers/ScalableComponent.pdf
the key to his conjured construct to support scalable compo ...
The with() {} statement is meant to provide convenience.
and there are some golden laws about the with() {} statement.
it only use/assign existing properties
it does not affect what is 'this'
the scoped variable inside with statement take precedence over others with the same name
i ...
there is some research by Steven Levithan, who ventured to find various kind of way to implement the code that do string trimming.
he published his algorithms on this link:
http://blog.stevenlevithan.com/archives/faster-trim-javascript
Below shows some of the implementaiton that us ...
string.replace method accept a regexpression as the seperator, also, you can pass some anonymous function which will work on each of the matched method;
let's see the example.
/**************************************
*@Summary
* this file demonstrate the use of string.replace method, ...
this is a rather simplied version of some asynchronous unit test framework, it is indeed far away from being able to be used as some real-world, production quality of unit test framework; however, it shows the basic/meat and potatos of what is required of a async unit test suite.
/********* ...
a centralized timers has benefit over non-centralized timers. the benefit including .
1. have one timers object that excute per page at a time.
2. you can start, stop, resume the timer
3. process of removing the timer callback is trivilized
and one special note about the javascipt gar ...
nowadays the browser is much more smarter and they normally possed some features that intelligently monitor the status of the web applications. If some process overruns, say, 5 seconds non-stop (browser suc as FireFox, and Opera does this, the Iphone actually kills any script that are running for mo ...
You can subclass native object, the most often sub-classed object is the Object class itself.
Let's first see some cases that you do with sub-classing the object class.
Object.prototype.keys1 = function () {
var keys1 = [];
for (var i in this) {
keys1.push(i);
}
return k ...
Javascript is featured of something that is special among other object oriented or object based language, where you do not have class, and there is some mechanism which is called the prototype inheritance that can help you achieve something that fimiliar with most OO programmer.
With object inhe ...
This is a repost of the dev center document, under the same title. you can find the same document under DPI and Device-Independent Pixels
To program effectively with Windows graphics, you must understand two related concepts:
Dots per inch (DPI)
Device-independent pixel (DIPs).
Let's ...