C# Class Opc.Ua.Client.Controls.GuiUtils

A class that provide various common utility functions and shared resources.
Inheritance: System.Windows.Forms.UserControl
Mostra file Open project: OPCFoundation/UA-.NET Class Usage Examples

Public Properties

Property Type Description
ImageList System.Windows.Forms.ImageList

Public Methods

Method Description
AddToTrustedStore ( ApplicationConfiguration configuration, X509Certificate2 certificate ) : void

Adds the certificate to the Trusted Certificate Store

CheckApplicationInstanceCertificate ( ApplicationConfiguration configuration ) : X509Certificate2

Creates an application instance certificate if one does not already exist.

CheckApplicationInstanceCertificate ( ApplicationConfiguration configuration, ushort keySize, bool interactive, bool updateFile ) : X509Certificate2

Creates an application instance certificate if one does not already exist.

ConfigureFirewall ( ApplicationConfiguration configuration, bool interactive ) : void

Configures the firewall.

DeleteApplicationInstanceCertificate ( ApplicationConfiguration configuration ) : void

Deletes an existing application instance certificate.

DisplayUaTcpImplementation ( Form form, ApplicationConfiguration configuration ) : void

Displays the UA-TCP configuration in the form.

DoStartupChecks ( string configSectionName, ApplicationType applicationType, string defaultConfigFile, bool interactive ) : ApplicationConfiguration

Does any configuration checks before starting up.

EditValue ( Session session, object value ) : object

Displays a dialog that allows a use to edit a value.

EditValue ( Session session, object value, NodeId datatypeId, int valueRank ) : object

Displays a dialog that allows a use to edit a value.

GetDefaultValue ( NodeId datatypeId, int valueRank ) : object

Returns a default value for the data type.

GetTargetIcon ( Session session, NodeClass nodeClass, ExpandedNodeId typeDefinitionId ) : string

Returns to display icon for the target of a reference.

GetTargetIcon ( Session session, ReferenceDescription reference ) : string

Returns to display icon for the target of a reference.

GuiUtils ( ) : System

Initializes a new instance of the GuiUtils class.

HandleCertificateValidationError ( Form caller, CertificateValidator validator, CertificateValidationEventArgs e ) : void

Handles a certificate validation error.

HandleException ( string caption, MethodBase method, Exception e ) : void

Displays the details of an exception.

LoadConfiguration ( string configSectionName, ApplicationType applicationType, string defaultConfigFile, bool interactive ) : ApplicationConfiguration

Does any configuration checks before starting up.

OverrideUaTcpImplementation ( ApplicationConfiguration configuration ) : void

Uses the command line to override the UA TCP implementation specified in the configuration.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Clean up any resources being used.

Private Methods

Method Description
InitializeComponent ( ) : void

Required method for Designer support - do not modify the contents of this method with the code editor.

Method Details

AddToTrustedStore() public static method

Adds the certificate to the Trusted Certificate Store
public static AddToTrustedStore ( ApplicationConfiguration configuration, X509Certificate2 certificate ) : void
configuration ApplicationConfiguration The application's configuration which specifies the location of the TrustedStore.
certificate System.Security.Cryptography.X509Certificates.X509Certificate2 The certificate to register.
return void

CheckApplicationInstanceCertificate() public static method

Creates an application instance certificate if one does not already exist.
public static CheckApplicationInstanceCertificate ( ApplicationConfiguration configuration ) : X509Certificate2
configuration ApplicationConfiguration
return System.Security.Cryptography.X509Certificates.X509Certificate2

CheckApplicationInstanceCertificate() public static method

Creates an application instance certificate if one does not already exist.
public static CheckApplicationInstanceCertificate ( ApplicationConfiguration configuration, ushort keySize, bool interactive, bool updateFile ) : X509Certificate2
configuration ApplicationConfiguration
keySize ushort
interactive bool
updateFile bool
return System.Security.Cryptography.X509Certificates.X509Certificate2

ConfigureFirewall() public static method

Configures the firewall.
public static ConfigureFirewall ( ApplicationConfiguration configuration, bool interactive ) : void
configuration ApplicationConfiguration The configuration.
interactive bool if set to true if the user should be prompted.
return void

DeleteApplicationInstanceCertificate() public static method

Deletes an existing application instance certificate.
public static DeleteApplicationInstanceCertificate ( ApplicationConfiguration configuration ) : void
configuration ApplicationConfiguration The configuration instance that stores the configurable information for a UA application.
return void

DisplayUaTcpImplementation() public static method

Displays the UA-TCP configuration in the form.
public static DisplayUaTcpImplementation ( Form form, ApplicationConfiguration configuration ) : void
form System.Windows.Forms.Form The form to display the UA-TCP configuration.
configuration ApplicationConfiguration The configuration instance that stores the configurable information for a UA application.
return void

Dispose() protected method

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool true if managed resources should be disposed; otherwise, false.
return void

DoStartupChecks() public static method

Does any configuration checks before starting up.
public static DoStartupChecks ( string configSectionName, ApplicationType applicationType, string defaultConfigFile, bool interactive ) : ApplicationConfiguration
configSectionName string
applicationType ApplicationType
defaultConfigFile string
interactive bool
return ApplicationConfiguration

EditValue() public static method

Displays a dialog that allows a use to edit a value.
public static EditValue ( Session session, object value ) : object
session Session
value object
return object

EditValue() public static method

Displays a dialog that allows a use to edit a value.
public static EditValue ( Session session, object value, NodeId datatypeId, int valueRank ) : object
session Session
value object
datatypeId NodeId
valueRank int
return object

GetDefaultValue() public static method

Returns a default value for the data type.
public static GetDefaultValue ( NodeId datatypeId, int valueRank ) : object
datatypeId NodeId
valueRank int
return object

GetTargetIcon() public static method

Returns to display icon for the target of a reference.
public static GetTargetIcon ( Session session, NodeClass nodeClass, ExpandedNodeId typeDefinitionId ) : string
session Session
nodeClass NodeClass
typeDefinitionId ExpandedNodeId
return string

GetTargetIcon() public static method

Returns to display icon for the target of a reference.
public static GetTargetIcon ( Session session, ReferenceDescription reference ) : string
session Session
reference ReferenceDescription
return string

GuiUtils() public method

Initializes a new instance of the GuiUtils class.
public GuiUtils ( ) : System
return System

HandleCertificateValidationError() public static method

Handles a certificate validation error.
public static HandleCertificateValidationError ( Form caller, CertificateValidator validator, CertificateValidationEventArgs e ) : void
caller System.Windows.Forms.Form The caller's text is used as the caption of the shown to provide details about the error.
validator CertificateValidator The validator (not used).
e CertificateValidationEventArgs The instance event arguments provided when a certificate validation error occurs.
return void

HandleException() public static method

Displays the details of an exception.
public static HandleException ( string caption, MethodBase method, Exception e ) : void
caption string
method System.Reflection.MethodBase
e System.Exception
return void

LoadConfiguration() public static method

Does any configuration checks before starting up.
public static LoadConfiguration ( string configSectionName, ApplicationType applicationType, string defaultConfigFile, bool interactive ) : ApplicationConfiguration
configSectionName string
applicationType ApplicationType
defaultConfigFile string
interactive bool
return ApplicationConfiguration

OverrideUaTcpImplementation() public static method

Uses the command line to override the UA TCP implementation specified in the configuration.
public static OverrideUaTcpImplementation ( ApplicationConfiguration configuration ) : void
configuration ApplicationConfiguration The configuration instance that stores the configurable information for a UA application. ///
return void

Property Details

ImageList public_oe property

The list of icon images.
public ImageList,System.Windows.Forms ImageList
return System.Windows.Forms.ImageList