Screen Methods

Method icon The Screen supports the following scripting methods.

See Accessing Screen Objects for more information about how to view control objects in script in the Canvas application.

Methods Description

AddControl

The AddControl method dynamically adds a control to a screen object at runtime.

See Adding a Control Via Script for more information about using this method.

AddLayer

The AddLayer method dynamically adds a layer to a screen object at runtime.

Example

The script call is as follows:

Objects.Screen.AddLayer("Layer 1");

where "Layer 1" is the layer name.

See Scripting Layers for more information about using this method.

CalculateRelativeTime

 

CloseScreen

The CloseScreen method closes a screen.

Equals

The Equals method determines whether the specified object is equal to the current object.

GetAllScreenControls

The GetAllScreenControls method retrieves all objects on a screen allowing programmatic interaction with all controls on a screen.

GetColorPaletteSubstitution

 

GetGlobalDictionary

The GetGlobalDictionary method returns the dictionary itself, allowing a script writer to manipulate the dictionary directly or inspect its contents.

Example

public Canvas.Shared.CanvasGlobalDictionary GetGlobalDictionary()

The Canvas.Shared class, "CanvasGlobalDictionary," is a C# System.Collections.Generic.Dictionary<string, object>. The string represents the key and the object represents the value. This collection allows you to store any data you want and reference it later by the key assigned when it was added. If the same key is used multiple times, the original value would be replaced by the latest update.

See Global Dictionary for more information about using this method.

GetHashCode

The GetHashCode method returns a hash code for the current object.

GetType

The GetType method returns the runtime type of the current instance.

HideLayer

The HideLayer method dynamically hides a layer on a screen object at runtime.

Example

The script call is as follows:

Objects.Screen.HideLayer("Layer 1");

where "Layer 1" is the layer name.

See Scripting Layers for more information about using this method.

Hyperlink

Hyperlinking in Canvas allows you to open another Canvas screen via script from the screen you are currently viewing. This is accomplished via script using the Hyperlink method on the sending (hyperlinking) screen and the OpenedViaHyperlink event on the receiving (hyperlinked) screen. Hyperlinking is supported between screens, objects, and nested views in Canvas, Canvas View, and Canvas View Lite.

See Hyperlinking Screens for more information about using this method.

IsOrderInTypeConfiguredForDefinition

The IsOrderInTypeConfiguredForDefinition method checks to see if an order in type (facility ordinal) is configured for the selected relative facility definition.

IsScreenOpen

The IsScreenOpen method checks to see if a screen is open in that instance of Canvas or Canvas View. This method is case-insensitive.

NavigateToDefaultScreen

 

NavigateToScreenByFacility

The NavigateToScreenByFacility method is included on the screen object and allows you to navigate to a specific screen by selecting a CygNet facility.

Example

The script call is as follows:

Objects.Screen.NavigateToScreenByFacility(facility);

The correlation between a facility and its associated screen is done via a facility attribute. You will need to configure the facility attribute that references the associated screen in your CygNet system for each facility using CygNet Explorer.

See Navigation by Facility for more information about using this method.

ReadFromGlobalDictionary

The ReadFromGlobalDictionary method reads a complex script object from another screen.

See Global Dictionary for more information about using this method.

RemoveControl

The RemoveControl method dynamically removes a control to a screen object at runtime.

See Adding a Control Via Script for more information about using this method.

ResetMouseCursor

 

ResolveRelativeFacility

The ResolveRelativeFacility method returns the resolved relative facility.

SendFacilityBroadcast

The SendFacilityBroadcast method broadcasts a facility to any open screen set to receive the facility.

See Broadcast a Message Via Script for more information about using this method.

SendMessageBroadcast

The SendMessageBroadcast method broadcasts a message to any open screen set to receive the broadcast.

See Broadcast a Message Via Script for more information about using this method.

SendParentMessage

The SendParentMessage method sends a message from a child screen to a parent screen.

See Broadcast a Message Via Script for more information about using this method.

SendSiteServiceBroadcast

The SendSiteServiceBroadcast method broadcasts a SiteService to any open screen set to receive the SiteService.

See Broadcast a Message Via Script for more information about using this method.

SerializeObject

The SerializeObject method serializes the object and its properties to an XML string.

SetLayerVisibility

The SetLayerVisibility method dynamically shows or hides a layer on a screen object at runtime.

Example

The script call is as follows:

Objects.Screen.SetLayerVisibility("Layer 1", false);

 

Objects.Screen.SetLayerVisibility("Layer 1", true);

where "Layer 1" is the layer name.

See Scripting Layers for more information about using this method.

SetMouseCursor

 

ShowLayer

The ShowLayer method dynamically shows a layer on a screen object at runtime.

Example

The script call is as follows:

Objects.Screen.ShowLayer("Layer 1");

where "Layer 1" is the layer name.

ShowPopup

The ShowPopup method creates a popup at the mouse location containing an object specified in the parameters. The path can be either a Canvas screen file (.can) or Canvas object file (.cob).

Example

The script call is as follows:

string path = @"CYGDEMO.BSSCAN\DEMO\Main.can";

Canvas.Helpers.CanvasFileSource source = Canvas.Helpers.CanvasFileSource.BSS;

CygNet.Data.Core.FacilityTag facilityTag = new CygNet.Data.Core.FacilityTag("CYGDEMO.UIS::ASH_WL");

 

Objects.Screen.ShowPopup(path, source, facilityTag);

ToString

The ToString method returns a string that represents the current object.

WriteToGlobalDictionary

The WriteToGlobalDictionary method saves a complex script object to a global dictionary in the Canvas application’s memory. See Global Dictionary for more information about using this method.