Canvas > Using Canvas Controls and Objects > Screen > Screen Methods

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

AddLayer

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

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.

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.

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 stores the object in memory so that it can be recreated when needed.

ShowLayer

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

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.


Let us know how we can improve this topic.

CygNet at weatherford.com

© 2020 Weatherford. All rights reserved.