Quantcast
Channel: Questions in topic: "namespace"
Viewing all articles
Browse latest Browse all 398

How to implement custom using directives?

$
0
0
My Application is getting quite big and therefore I need a way to reduce the amount of code in my scripts. ---------- I figured out that I could save a lot of space by putting certain methods (that I use in multiple scripts) in classes `class` in a separate namespace `namespace`. That way I want to be able to write an using directive `using namespace` on top of the classes where I need those methods. Then I can just use `class.method()` when I want to call that method, just like with `using System` or `using Event.System`. ---------- The Problem is that I have to create an Instance of `class` first. Why isn't that necessary for native using directives and how can I avoid it?

Viewing all articles
Browse latest Browse all 398

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>