I tried to google but didn't find any class, maybe im using the wrong keywords.
Im looking for a class which has a "CurrentValue" and "MaxValue" (int) Property.
Everytime the CurrentValue is set, it should be checked and clamped to the MaxValue. For example if the MaxValue is 10 and CurrentValue is set to 20, it should be set to 10 instead (but not throw a exception!)
Currently I wrote my own class which his behavior, but i was wondering if there is any built in C# class with this kind of "clamping"?