Hi, I am new to professional programming, I am writing C# but I think this isn't exactly C# specific. Anyway, I want to ask what's the best way to enable/disable some controls amongst multiple controls under various different condition?
Let's say, there is a GUI with some rows, each represent a person. There are also some buttons, representing some actions, say, "Stand, Sit, Walk, Jump, Eat, Watch TV, Wake, Sleep" and there are some conditions, like if someone is sitting he can eat and watch tv(i.e. enable those button) but can't jump(disable it), if someone is standing he cant sleep........ and so on. Also, the state change is not solely based on an button click. Like, he might just wake up himself after some time or, say, finished eating.
It seems that the most naive way is to write the .Enabled = true/false; code for n states X m buttons times, and check it for every user or non user triggered state change. Is there some better/faster/less-error-prone way to do that?
Also, what are this sort of thing called? I don't know a proper term in English to describe it well and so I can't google it myself.... Please help. Thank you very much.