Pretty cool feature of C#, for a newbie this is awesome unlike PHP. Say you have 4 class properties
class blah
{
string freddy;
string dafney;
string cave;
string flintstones;
}
And you declared it like:
blah mycartoon;
mycartoon = new blah();
If I wanted to access my classes I wouldn't use a period then the property like:
mycartoon.flintstones;
I can do:
mycartoon[3];
Pretty cool right?
Have fun learning C#
Sunday, March 1, 2009
Saturday, February 28, 2009
C# Changing Types the correct way
C# is simple, but changing variable types might get people confused. Heres the illegal way to change variable types:
Incorrect Way
int x;
long value = 10;
x = value;
Correct Way
int x;
long value = 10;
x = (int) value;
Have Fun
Incorrect Way
int x;
long value = 10;
x = value;
Correct Way
int x;
long value = 10;
x = (int) value;
Have Fun
C# Testing Applications without publishing
Alright, it took me a while but I finally figured out how to do this.
Or you can press F6 in VC# 2008 Express Edition
- Visual C# 08 go to Build => Build Solution
Or you can press F6 in VC# 2008 Express Edition
C# Enabling Auto Completion Property Drop Down
Here is what you do when the auto complete drop down doesn't show.
- Hold CTRL + Space
C# Refactor Menu Tip
Always use the refactor menu tip when renaming event classes to help debugging in the future.
Steps:
Steps:
- Go to Menu
- Select Refactor
- Select Rename
- Enter method name
- Press Enter Twice
- Press F2
- Safest way to make changes to code
- Could cause reference debug errors when something elsewhere is trying to reference that function
Subscribe to:
Posts (Atom)