Basically, yes. The author should be complimented for writing a specific collection-class, as opposed to using generics throughout the app for each collection. It makes changes easier, as one can easily change the collection-class, without having to check each method that uses the collection.
that defines a useless enum?
I'm not sure whether it's "useless"; it's merely defined in the collection-class, implying that it's used there, or in conjunction with that class. If it's not used (place the cursor there an hit F12 to find all references) than it'd be better to remove it.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
I don't see the point in having an Enum that only defines one value. What possible purpose could that have? I can make it private and the app still builds - nobody is using it, and I posted all the code for the class, it's not using it. My concern is not about the unused code though, it's about and Enum with only one value. How do you think that might be used? It can only ever have one value, and it can't be null. I don't see the point. I was kind of wondering if it's done for some reason I've never heard of - a lot of this codebase is copied straight from the MSDN.
I agree that sometimes a named class that doesn't extend the "system" class makes sense. However, I don't have any issues with using ArrayList, if that's what you need. It is a waste of code and a useless increase in complexity - I don't need my own special ArrayList class, the system one is fine. I agree with what you're saying, but I don't think it's enough of an advantage in most cases. "Don't use the generic class" is often used to increase complexity for no reason at all. When the code is not very well documented, it puts me in the position of "OK, I see this class doesn't do anything extra from ArrayList, so why is it here?" and I can go and look at places where it's used and it's doing nothing special, and then I think "certainly the guy before me didn't write extra code just because someone told him not to use the generic classes" - sends me down a rabbit hole of trying to understand reasoning I didn't participate in.
In this question, I'm looking for someone to say, "oh yeah, that's the Lipshitz design pattern, here's a link"
I don't know where they got it from. I only had access to the previous developer for 'not long enough' and he showed me only the things he thought were important. He would be happy to admit that he has zero experience with ASP.Net - the site was converted from PHP, so it has some weird patterns and an overall odd style.
It's not a useless enum! The enum is simply scoped to the class MyCollection (a terrible name, if that's the actual name). So you can do stuff like this (for example). It's assumed that Foo has a member of type MyCollection.MyUpdateFields.
MyCollection coll = new MyCollection();
Foo f = new Foo();
foo.UpdateField = MyCollection.MyGroupName;
It's too bad the author hasn't commented their code. (This wouldn't even be accepted for a code review where I work).
I can see in your sample code that you have created a variable of the enum type, and set the value to be the only possible value for that enum - that is all fine and good, but what are you going to use that value for? Remember, setting values that don't get used is a waste of memory - the compiler even warns you about it sometimes.
And yeah, I've changed the names to protect the innocent.
I'd rather think the code stayed incomplete for some reason.
When overriding the Add() method of the collection (which he hasn't done yet), he could e.g. check that the item to be added has the correct value in its MyUpdateFields property and otherwise throw an exception.
Of course, Generics are a better way to solve it, but they were not available in e.g. .Net 1.1. And since the application was originally written in PHP, some odd ways of doing things might have their origin there.
Why even bother to try and figure out what this little-code-monster is, when you can get busy, and write better code
Because I'm in a testing phase right now and can't write additional code until that's done. The best I can do at the moment is try to understand what's here already. That is pretty important when taking over maintenance of undocumented apps.
If your report is running against SQL Server 2005, you can't use inline formatting.
If it's running against SQL Server 2008 or higher, the "Markup type" property should work. Depending on your version of BIDS, you might need to open the report in Report Builder to access the property.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer