'Using' encapsulation, and Scope

I have been working with Editor and EditorWindow classes lately, trying to learn them, and recently had to create a scroll bar inside of a box (that’s not on the either side of the window) and searching around for a bit, I found Scope classes inside.

It worked, but I have no clue as to what it is and how it works. It would be really helpful to get some insight into these functions. How do they work? Why do I have to use using {} for these Scope classes?

The idea with these types of classes is that they provide a convenient way to make sure that a context gets created and cleanly exited. Otherwise, you need to make sure to remember to put in pairs of functions like BeginScrollView/EndScrollView, and properly handle any exceptions that might occur in between. You may find information on the IDisposable interface helpful for further reading.