Well, its time for some fun - educated, professional fun, before the Easter break !!
Below is an image of two Enums that I coded recently, into my test app for making data Input Masks.
Now then, without cheating, or doing any deep research, you have to guesstimate the number of similar Enum structures available for us to use in the standard set of assemblies making up the References 'set' in a reasonably standard WPF app in X#. lets say an MVVM app with Entity Framework and Galasoft MVVM framework.
I am currently working on a WPF demo app to allow us to see those that are in the DLLs, and view the full details on screen - in an interesting way. Along with the total count.
I expect guys (friends and colleagues, and all X# Forum readers) to post their guesses in short posts - before I post my app solution - so get estimating ;-0) Answers to be posted starting NOW !
Their is more to Enums than we first think - they appear so simple on the surface - BUT - in fact have a big impact on our .NET coding. I am still coming to terms with them - years after I first found how good they are. I am sure we all need to use them more than we do.
You obviously need some help on this topic / question !
I now know the answer BUT am not going to tell until a few of you guys post a guess. Come on Karl you are always game for this sort of a challenge ;-0)
Attached is an image of my early test / trial app running - you can only see the collection of Assemblies which I am scanning, and examining.
I plan to have a much more fun and interactive WPF form to allow users to select individual assemblies, and then any Enums found, to see their members and values.
Does anyone out there know how to easily get hold of all the DLLs in the Reference section. I have previously used the 'Assembly.GetExecutiveAssembly()' but this is limited it which DLLs it seems to find and make available.
Okay then folks, a hint on the grand total of Enums in these bunch of assemblies.
Let me say that there are more than the number of goals that Sunderland have scored in the Premiere League this season ;-0)
I may give you a more precise hint later. Possibly you need some more time to reflect on the question, and even reflect on the answer too !
Now then, some 5k i'd suspect. What reminds me of the frontispiz of one of Ivo Wessel's books, citing Ockham's razor: "non sunt multiplicanda entia sine necessitate" - don't introduce "new things" if not really, but really, necessary...
Now that you are loosening up a little, and letting you feelings guide you, as a team you are getting there ;-0) And how long does a quick guess take, as Frank so rightly said ?
Although what Ockham has to do with this I could not fathom out Karl !? But I did like Ivo's style of doing things. Anything.
And all my original point was about, was - we all need and use Enums, but often without much thought as to their importance, even if they are not as complex as the rest of the stuff we often need to use in .NET, we can't do without them. And our code would break if the underlying values were in any way re-mapped. Break big-time.
Below the image shows that from the large pile of 'found' enums we can in fact find the one which caused all of this fun in the first place.
'RegexOptions' is required for the Mask code I have been discussing recently.
Notice that the long list is now in alphabetical order - and this was done by a simple and small bit of LINQ code. See this next image and the code beneath it :-
In fact I have used quite a few bits of LINQ code in my lines of code to find Assemblies and Enums - and values etc. Long live LINQ - or 'LLL' for short ;-0)
And with an extra bit of code we can list and see the members of this Enum structure 'RegexOptions'.
The values allow multiple use of the members - in a bit-wise fashion (more another time).
Oh! and I still have not given the answer I found ;-0)
Lets wait to see if some guy comes up with an even better guess ! Even a second Team answer.
New hint - billions is just a bit too far to imagine etc..
OR - divide the height of the 'thumb' into the length of the vertical scroll bar, and get the wrong answer !!??
I have a slight confession to make - something to do with a small piece of NASA type spacecraft code getting into my solution.
So my craft got to Mars when I was headed for Venus, or even the Moon ! ;-0))
So numerically speaking LARGE became 'large', and it looks like all of you guys who guessed will have to fight it out between you for who gets the champagne to drink.
Yes, now that I have made a new clean demo app for Enums, Assemblies, Classes and Masks etc. it would appear that a small error on one line caused me to count all Types in the assembly, for the grand total - SORRY !
The answer is actually 2363 and can be clearly seen in the image below :-
If you wish to check the code I have left the image attached but not displayed in the body of this post.
What I will add to the post itself is the code to open and display the blue form - its done in the classical way an MVVM form should be displayed.
The assemblies in the data Model are injected into the ViewModel and the VM bound to the View. Easy!
Now then, if you inspect the top blue line in the grid you will see a number you know well by now - 22449 - yes, it is actually all of the types in the collection of assemblies.
However, we still have almost 11 % of all assembly types being of type Enum - so it is still quite substantial.
The unfortunate thing from my point of view was that my first (and correct) try gave me 499, which led me to false expectations for the group of assemblies - that's my excuse.
Anyone seen a space ship cruising around ? If you have then send it back to me please ;-0)