Canvas > Using Canvas > Canvas User Interface > Workspace > Script View

Screen Pane — Script View

Script view toolbar

Script tab The Script view of the Screen pane contains a scripting environment where you can create or edit screen content. In this environment you can write script, add and remove references, and introduce custom elements to further refine the objects in your screens. Supported script languages are C# and VB.NET. The Script view has a context menu and a toolbar, which contains options to validate script and manage assemblies for the currently selected screen.

See Scripting in Canvas for more information about using this view.

Validating Script

On the Script view toolbar in the Screen page, click Validate script (Validate script) to compile the script for the screen currently open in your application window. The compiled results appear in the Output pane. Use the validate script feature to find any syntax errors with your script so that you can fix them before running it.

Managing Assemblies

On the Script view toolbar, click Manage external assemblies loaded for script (Manage external assemblies loaded for script) to access the Assembly Manager dialog box where you can view and select assemblies you have loaded into your system, to make them available for use in the current script. These can include several types of assemblies available to link in for use in your Canvas screens. Once selected, an assembly file can be referenced in your script when creating or editing screens.

Assembly Manager

Assembly Manager dialog box

Use the list on the left to filter the types of assemblies:

Using the Assembly Manager

Assembly Storage

How you store your assembly files matters, so that the files are accessible at run-time.

Preferably locate all your assembly files in your Canvas application folder, the same folder as your Canvas.exe application file. For most usages this is the CygNet\Bin folder.

Alternatively, you can share assemblies by installing them into the Global Assembly Cache (GAC) of your .NET Framework, if necessary. If you have access to the Windows Software Development Kit (SDK), you can use the Global Assembly Cache tool (Gacutil.exe) to facilitate deployment of system assemblies to your GAC.

At run-time all assembly files must be in one of two locations: co-located in the same folder as the Canvas application file, or in the GAC. Assemblies stored in any other location will be inaccessible to Canvas (or Canvas View) and may cause your screen to fail.


Let us know how we can improve this topic.

CygNet at weatherford.com

© 2020 Weatherford. All rights reserved.