- Writing Xbasic wrapper classes for .NET classes
- /documentation/pages/Guides/Dotnet Integration/Writing Xbasic Wrapper Classes for .NET classes.xml
Xbasic has a simple method for defining native wrapper classes for .NET classes that can help you avoid writing registration code every time you use a class. Simply create a class in your project and make the body of your class the desired registration code. Then save the class file as <Namespace>.<Class> and reference it in your code as <Namespace>::<Class>. Note that the class filename includes a dot, while the class reference includes two colons.
While you can use your own namespace and class names, it makes life a whole lot simpler for you and anyone else who uses your class definition if you match the .NET class hierarchy. Also, do not bother to create a class file for a preloaded class.
The following example should make the methodology clear.
- Classes in Namespaces
- /documentation/pages/Guides/Xbasic/Xbasic Classes/Classes in Namespaces.xmlIn Implementing an Xbasic Class we defined a class:
- Xbasic with Classes
- /documentation/pages/Guides/Xbasic/Xbasic Classes/Xbasic with Classes.xmlYou should find the new Xbasic classes to have most of the capabilities of classes in C#, Java, and Visual Basic .NET without being too complex to understand. In general, object-oriented programming and classes attempt to make software more robust and reusable. They do this in a number of ways.
- Encrypting Xbasic function libraries, Modules, and Classes
- /documentation/pages/Guides/Workspaces/Xbasic/Encrypting Xbasic Workspace Files.xmlIf an Xbasic Module, Class, or Function Library contains scripts that need to be encrypted, you can use the *[xb:'ENCRYPT]* and *[xb:'PASSWORD]* comments to encrypt the file and optionally add password protection.
- Learning Xbasic - Classes
- /documentation/pages/Guides/Xbasic/Xbasic Classes/index.xmlLearn how to create Xbasic classes in these articles that discuss everything from the basics of creating a class, inheritance, and testing classes.
- Root Xbasic Classes
- /documentation/pages/Ref/Api/Namespace/Root Classes/index.xmlTop-level Xbasic classes found in the global namespace.
- Server-side onBeforePopulateUXControlsFromTable Event
- /documentation/pages/Guides/Mobile and Web Components/UX/Properties/Advanced/Server side onBeforePopulateUXControlsFromTable Event.xmlAn Xbasic function to call before a data bound UX component is populated with data from one or more tables
- Full List of Preloaded .NET Classes
- /documentation/pages/Guides/Dotnet Integration/Full list of preloaded dotnet classes.xmlFull list of preloaded .NET classes in Alpha Anywhere.
- Xbasic Function Libraries, Modules, and External Classes
- /documentation/pages/Guides/Workspaces/Xbasic/index.xmlXbasic scripts used in mobile and web applications can be added to a workspace as Xbasic Function Libraries, Modules, or Class files.
- Server-side Events
- /documentation/pages/Guides/Mobile and Web Components/TabbedUI/Server-side Events/index.xmlServer-side events for the Tabbed UI Component.