| | |
forcing set list in parameter list prompts?
Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Mar 2008
Posts: 10
Reputation:
Solved Threads: 0
When building classes I thought if I just added an enum to the parameter list it would pop up the list of the enums, sort of like intellisence.. But I clearly am missing something..
Only has the intellisense if I do the following
or
Anyway to get it to pop up the weekday list without the prefix of GeneralDates.efullweekdays????
C# Syntax (Toggle Plain Text)
public enum eFullWeekDays { Sunday = 1, Monday = 2, Tuesday = 3, Wednesday = 4, Thursday = 5, Friday = 6, Saturday = 7, } public DateTime PrevDayofWeek(DateTime datepassed, eFullWeekDays FullWeekDay,bool subtractWeekIfPassCorrectDay) { : : }
Only has the intellisense if I do the following
C# Syntax (Toggle Plain Text)
dteNewDate = GenDates.PrevDayofWeek(testdate, (GeneralDates.eFullWeekDays)intWKDay, boolIFCorrectDay);
C# Syntax (Toggle Plain Text)
dteNewDate = GenDates.PrevDayofWeek(testdate, GeneralDates.eFullWeekDays.Thursday, boolIFCorrectDay);
Anyway to get it to pop up the weekday list without the prefix of GeneralDates.efullweekdays????
What the **** are you naming your enum type "eFullWeekDays" for and not "FullWeekDays"? Unless you have actual evidence that prefixing your variables with the names of their types increases your productivity, you are just a superstitious nutjob.
No, because you could also theoretically type in a variable of type GeneralDates.eFullWeekDays.
•
•
•
•
Anyway to get it to pop up the weekday list without the prefix of GeneralDates.efullweekdays????
•
•
Join Date: Mar 2008
Posts: 10
Reputation:
Solved Threads: 0
Just a newbie with an incredible learning curve. C#, asp.net, java, html, Linq, AJAx.... etc etc.. Yes at this point you could call me a nutjob from overload..
Since I name the enum in the library and then have to call it in the calling programs it is just helping my overloaded brain. Rather then guessing if I call it Weekday, FullWeekday, DaysOfTheWeek.etc.. Right now the e... helps me get to the list of enums I created and figure out what I need, and helps me seperate them from the long list of objects and properties in the library..
Sorry if my code is offensive, but right now the need is to learn and accomplish.. Quickly...
Since I name the enum in the library and then have to call it in the calling programs it is just helping my overloaded brain. Rather then guessing if I call it Weekday, FullWeekday, DaysOfTheWeek.etc.. Right now the e... helps me get to the list of enums I created and figure out what I need, and helps me seperate them from the long list of objects and properties in the library..
Sorry if my code is offensive, but right now the need is to learn and accomplish.. Quickly...
There is a System.DayOfWeek enumeration.
There is a DateTime structure with a property DayOfWeek which returns this enumeration.
So why would you feel the need to make your own?
.Net is HUGE, perhaps you did not know it existed?
Join the club, I had the same experience already...
There is a DateTime structure with a property DayOfWeek which returns this enumeration.
So why would you feel the need to make your own?
.Net is HUGE, perhaps you did not know it existed?
Join the club, I had the same experience already...
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Make love, no war. Cave ab homine unius libri.
Danny
•
•
Join Date: Jan 2009
Posts: 21
Reputation:
Solved Threads: 7
ddanbe beat me to it. I'd go with the System.DayOfWeek, however to answer the general enum question, you would only need the GeneralDates if the eFullWeekDays enum instance is outside the scope of your class or namespace.
Example:
If you bring it out one level, then you have:
Or if it's in the same namespace:
Intellisense works in all scenarios....
-Nelis
Example:
C# Syntax (Toggle Plain Text)
namespace TestA { public class Class1 { public enum Values { Val1, Val2, Val3 } } } namespace TestB { public class Class2 { public Class2() { // have to use namespace and class path TestA.Class1.Values.Val1; } } }
C# Syntax (Toggle Plain Text)
namespace TestA { public enum Values { Val1, Val2, Val3 } public class Class1 { } } namespace TestB { public class Class2 { public Class2() { // have to use namespace path TestA.Values.Val2; } } }
C# Syntax (Toggle Plain Text)
namespace TestA { public enum Values { Val1, Val2, Val3 } public class Class1 { } public class Class2 { public Class2() { // same namespace, nothing but enum is needed Values.Val3; } } }
-Nelis
Last edited by nelis; Jan 23rd, 2009 at 1:01 pm.
![]() |
Other Threads in the C# Forum
- Previous Thread: start IE without addressbar, status bar
- Next Thread: Wait while file write in C#
Views: 653 | Replies: 5
| Thread Tools | Search this Thread |
Tag cloud for C#
.net access ado.net algorithm array barchart bitmap box broadcast button buttons c# chat check checkbox class code color combobox control conversion csharp custom database datagridview dataset datetime degrees draganddrop drawing encryption enum excel file files form format forms ftp function gdi+ http image index input install java label list listbox listener login mandelbrot math mouseclick mysql networking object operator oracle path photoshop picturebox post prime programming radians regex remote remoting resource richtextbox save saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml







