Thursday, December 16, 2010

PQP200 letcure

today we are going learn about website

Tuesday, September 14, 2010

[silverlight] Always scrolling the scroll bar to the bottom of a TextBox

found this at http://www.gamedev.net/community/forums/topic.asp?topic_id=550283
very useful.

// If there is current text and it does not end in a newline, add one. 
if (!string.IsNullOrEmpty(outputWindow.Text) && !outputWindow.Text.EndsWith(Environment.NewLine)) 
{  
outputWindow.Text += Environment.NewLine; 
} 
// Append the text. 
outputWindow.Text += DateTime.Now.ToString(); 
// Set the selection to the end of the text, zero length. 
outputWindow.SelectionLength = 0; 
outputWindow.SelectionStart = outputWindow.Text.Length;

Monday, June 14, 2010

Extension Method

public static {Method Return type} {Method Name}(this {The Class to Extend} {Parameter Name})

public static int IsOdd(this int value)
{
return value%2 != 0
}

Extension method must in static class.
must declared as public and static.

delegate

{Modifier} delegate {Method Return type} {Delegate Name}({Parameter type} {Parameter Name})

public delegate int MyIntDelegate(int number);

Tuesday, May 4, 2010

First day of 70-536 training

Lesson 1
1)Making a variable nullable

bool? mybool = null;
int? myint = null;

2)System.Drawing.Point p;
p.Offset() : translates the points by specified amount.

3)Console.WriteLine() will call ToString() Automatically.

4)String is a reference type not value type.

Lesson 4

Boxing converts a value type to a reference type, and Unboxing converts a reference type to a value type.