Go Back   RunUO - Ultima Online Emulation > RunUO > New Join Forum

New Join Forum So your new to RunUO and looking to work with people that are new, this is the place.

Reply
 
Thread Tools Display Modes
Old 02-14-2005, 03:12 AM   #1 (permalink)
 
Join Date: Apr 2003
Age: 26
Posts: 49
Send a message via ICQ to isildil
Default Quick question about C#

Since it's not really scripting related.

Is it possible to define a method outside a class (even outside the original cs file) like it is possible to define function outside of class in C++ ? If so, how, google is not friendly with me about that (did search for the last hours)
__________________
I'm immortal unless proven otherwise :D
isildil is offline   Reply With Quote
Old 02-14-2005, 03:47 PM   #2 (permalink)
Master of the Internet
 
TMSTKSBK's Avatar
 
Join Date: Feb 2004
Location: NC/NC State Univ
Age: 23
Posts: 16,424
Default

I doubt it...but I'm not sure...
__________________
Goodbye, folks.
TMSTKSBK is offline   Reply With Quote
Old 02-14-2005, 04:01 PM   #3 (permalink)
 
Join Date: Apr 2003
Age: 26
Posts: 49
Send a message via ICQ to isildil
Default

Dont worry about that anymore.

Phantom said yesterday that the C# support that, but runUO doesn't.

So I'll not do that.
__________________
I'm immortal unless proven otherwise :D
isildil is offline   Reply With Quote
Old 02-16-2005, 01:10 AM   #4 (permalink)
Forum Expert
 
Join Date: Aug 2004
Location: Redmond, WA
Age: 21
Posts: 1,288
Send a message via AIM to Sep102 Send a message via MSN to Sep102
Default

Taken from msdn.com

Quote:
No global methods or variables in C#: Methods and variables must be contained within a type declaration (such as class or struct).
Unless they just recently added it, I would assume that this is still true.

I believe the closest that you can get is to declare a public static method in a public class.
Sep102 is offline   Reply With Quote
Old 02-16-2005, 01:32 AM   #5 (permalink)
Account Terminated
 
Join Date: Sep 2002
Age: 26
Posts: 3,846
Send a message via ICQ to Phantom Send a message via AIM to Phantom Send a message via MSN to Phantom
Default

Quote:
Originally Posted by isildil
Since it's not really scripting related.

Is it possible to define a method outside a class (even outside the original cs file) like it is possible to define function outside of class in C++ ? If so, how, google is not friendly with me about that (did search for the last hours)
The current version of C# doesn't support this.

C# 2.0 allows you to use partial classes, but I don't think it would support what you want to do.
Phantom is offline   Reply With Quote
Old 02-16-2005, 12:23 PM   #6 (permalink)
 
Join Date: Apr 2003
Age: 26
Posts: 49
Send a message via ICQ to isildil
Default

well that's just sad. It could have been usefull to declare a method outside is class.
__________________
I'm immortal unless proven otherwise :D
isildil is offline   Reply With Quote
Old 02-16-2005, 01:42 PM   #7 (permalink)
Account Terminated
 
Join Date: Sep 2002
Age: 26
Posts: 3,846
Send a message via ICQ to Phantom Send a message via AIM to Phantom Send a message via MSN to Phantom
Default

Quote:
Originally Posted by isildil
well that's just sad. It could have been usefull to declare a method outside is class.
But a real programmer sees no use in this support.
Phantom is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5