Click here to Skip to main content
15,919,422 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to release memory in c# Pin
S. Senthil Kumar3-Jul-05 22:05
S. Senthil Kumar3-Jul-05 22:05 
GeneralRe: How to release memory in c# Pin
Matt Gerrans3-Jul-05 22:44
Matt Gerrans3-Jul-05 22:44 
GeneralMain calendar in Outlook Pin
kloakenratte3-Jul-05 20:56
kloakenratte3-Jul-05 20:56 
GeneralEventhandling in Outlook Pin
kloakenratte3-Jul-05 20:51
kloakenratte3-Jul-05 20:51 
GeneralRe: Eventhandling in Outlook Pin
S. Senthil Kumar3-Jul-05 21:03
S. Senthil Kumar3-Jul-05 21:03 
GeneralClass properties Pin
1nsp1r3d3-Jul-05 20:21
1nsp1r3d3-Jul-05 20:21 
GeneralRe: Class properties Pin
S. Senthil Kumar3-Jul-05 21:02
S. Senthil Kumar3-Jul-05 21:02 
GeneralRe: Class properties Pin
Colin Angus Mackay3-Jul-05 21:06
Colin Angus Mackay3-Jul-05 21:06 
First, to correct the words that you are using, this is not a property, it is called a field in .NET (although many ex-C++ developers will call it a member variable).


1nsp1r3d wrote:
How can a class have a property of itself?

A class can have "fields" of any type. Including itself. As to how? Well, the code snipped you gave shows you how.


1nsp1r3d wrote:
Or the static keyword makes it not act as a class property?

The static keyword makes the "field" available at the class level rather than at the object instance level.

A better question would have been "why did they do this?"

If you are creating a "singleton" (that is a class that only ever has one instance through the lift of the application) then you need to create a static reference to the one and only instance of the class in the class.

If an object is part of a chain of object then it will need to reference another object of the same type. For example, the "decarator pattern" does this.

Does this help?


My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More


GeneralRe: Class properties Pin
1nsp1r3d3-Jul-05 21:12
1nsp1r3d3-Jul-05 21:12 
GeneralAnd Another One question Pin
Rassul Yunussov3-Jul-05 19:20
Rassul Yunussov3-Jul-05 19:20 
GeneralRe: And Another One question Pin
S. Senthil Kumar3-Jul-05 19:37
S. Senthil Kumar3-Jul-05 19:37 
GeneralPaging in Datagrid Pin
skrishnasarma3-Jul-05 19:06
skrishnasarma3-Jul-05 19:06 
GeneralRe: Paging in Datagrid Pin
WillemM4-Jul-05 0:12
WillemM4-Jul-05 0:12 
GeneralBigEndian Format Pin
Rassul Yunussov3-Jul-05 19:04
Rassul Yunussov3-Jul-05 19:04 
GeneralRe: BigEndian Format Pin
S. Senthil Kumar3-Jul-05 19:18
S. Senthil Kumar3-Jul-05 19:18 
GeneralRe: BigEndian Format Pin
Kri53-Jul-05 22:17
Kri53-Jul-05 22:17 
GeneralRe: BigEndian Format Pin
S. Senthil Kumar3-Jul-05 23:42
S. Senthil Kumar3-Jul-05 23:42 
GeneralRe: BigEndian Format Pin
S. Senthil Kumar3-Jul-05 23:40
S. Senthil Kumar3-Jul-05 23:40 
Questionnetworking ? Pin
Anonymous3-Jul-05 17:05
Anonymous3-Jul-05 17:05 
AnswerRe: networking ? Pin
Yulianto.3-Jul-05 18:32
Yulianto.3-Jul-05 18:32 
GeneralOutlook express add in Pin
Wessam Fathi3-Jul-05 14:15
Wessam Fathi3-Jul-05 14:15 
GeneralRe: Outlook express add in Pin
Carsten Zeumer3-Jul-05 22:16
Carsten Zeumer3-Jul-05 22:16 
GeneralFree resources Pin
Libor Tinka3-Jul-05 13:15
Libor Tinka3-Jul-05 13:15 
GeneralRe: Free resources Pin
Dave Kreskowiak3-Jul-05 16:21
mveDave Kreskowiak3-Jul-05 16:21 
GeneralC# and ASP.NET Pin
valvet3-Jul-05 12:59
valvet3-Jul-05 12:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.