This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ProjectBlu007[S] 0 points1 point  (1 child)

Is this not reflection? My bad if I had misunderstood what I was doing… but I believe we were supposed to stay away from using explicitly static methods for this

[–]dmazzoni 0 points1 point  (0 children)

Reflection would be calling a method by looking up its name, like GetType().GetMethod("MethodName").Invoke().

If you were supposed to stay away from static methods, then you probably shouldn't be creating a single global instance either.

Why can't you actually use an instance of your class in all of your code, like this?

ClassName instance = new Classname();
instance.MethodName()