Please see my comments to the question. From your question, it's hard to understand if you really understand how even the existing
syntactic sugar works.
I suspect that you don't. I think so because you did not even try to demonstrate how the usage of syntactic sugar should work. For this kind, the essence is not just the interface itself, but the VB.NET or C#
using statement:
https://msdn.microsoft.com/en-us/library/htd05whh.aspx[
^],
https://msdn.microsoft.com/en-us/library/system.idisposable%28v=vs.110%29.aspx[
^].
If I'm mistaken about you; and you are really do understand how it works, I would be only very glad.
See also:
http://en.wikipedia.org/wiki/Syntactic_sugar[
^].
You never showed anything like
Using... End using
. Besides, your
Protected Overridable Sub Dispose(disposing As Boolean)
is
totally irrelevant.
As you can see from the code sample, "End using" take place in the code. This is the point on code where the
IDisposable.Dispose
methods of "resourcelist | resourceexpression" are called.
Note: nothing else. All you can do is to implement
IDisposable
in different ways. If, instead of
IDisposable
, you derive your own interface instead from this interface, everything will work exactly the same, because you will still have to implement
IDisposable.Dispose
, and this implementation will be called exactly in the same way. You only will add some more members and will have to implement them.
Now, pay attention that
Using... End using
is the part of the
language syntax.
And you cannot alter the language syntax. You can only change the syntax if you implement your own language, which is also possible. Otherwise, your question makes little sense.
This way, you got the answer. If you have some other ideas, you have to explain that. Right now, it's pretty much nothing. Sorry, but I hope you got some food for thought.
—SA