foreach( i=0; i < getdata (); i++) { // }

should be

var data=GetData();
foreach( i=0; i < data ; i++) { // }

The call to GetData() is reduced to one, and thus increased performance overheads.

Another example:

///////////////////////////////////////////////////////////


if (IsolatedStorageWrapper.LoadString(“ShowTipsAndTricks”) == “”)
{
IsolatedStorageWrapper.SaveString(“ShowTipsAndTricks”, “true”);
}
else
{
IsolatedStorageWrapper.SaveString(“ShowTipsAndTricks”, “”);
}


could be written as

IsolatedStorageWrapper.SaveString(“ShowTipsAndTricks”, IsolatedStorageWrapper.LoadString(“ShowTipsAndTricks”) == “” ? “true” : “”);

could be written as

var loadedStringValue=IsolatedStorageWrapper.LoadString(“ShowTipsAndTricks”) == “” ? “true” : “”;

IsolatedStorageWrapper.SaveString(“ShowTipsAndTricks”, loadedStringValue);


could again be written as

var loadedStringValue = IsolatedStorageWrapper.LoadString( “ShowTipsAndTricks” ) == “” ? “true” : “”;
IsolatedStorageWrapper.SaveString( “ShowTipsAndTricks” , loadedStringValue );