Click or drag to resize

How to secure your dynamic objects

Securise your dynamic objects

Introduction

This class lets you secure your dynamic objects.

Dynamic objects are objects that are not visible in the Visual-Guard "Property Action" editor's treeview. In general, these objects are created by writing code and stored in an object list. Because they do not have a direct reference in the object, you cannot select them from the treeview.

Example:

  • Winform: If you directly add a "Label" in your "Form" in your Constructor.
    C#
    Label lbl = new Label(); 
    lbl.Name = "mylabel"; 
    this.Controls.Add(lbl);
  • Webform: If you directly add a "Label" in your page in the "Page_Load" method.
    C#
    Label lbl = new Label(); 
    lbl.Name = "mylabel";
    this.Controls.Add(lbl);

By using VGExpression, you can select and modify a "Label" property such as these:

C#
#this.Controls['mylabel'].Visible = false

Requirements

To use dynamic objects you must have Visual-Guard version 2.8 or higher.

Specifications
  • Objects used in VGExpression must have their "Namespace". (For example: New System.Windows.Forms.Label())

  • You can classify the execution order of the "Expressions" by using the "Up" and "Down" buttons

Usage
  1. Open a VGRepository

  2. Open an application

  3. Open a permission

  4. Create or edit a "Property Action"

  5. Go to "Select the component and edit the properties"

  6. Click "Add Expression"

  7. Submit your VGExpression

  8. Click "Finish"

Modifying a property of a dynamic object

To do this your property must have a get function in write mode. Your VGExpression is made up of two parts: The first is the target, the second is the value.

Example:

  • #this.MyProperty = myValue
  • #this.MyObject.MyProperty = myValue

Calling an object method

You can call a method via a dynamic action.

Example:

  • #this.MyMethod()
  • #this.MyObject.MyMethod()

Restrictions
  • "ReadOnly" list: You cannot change a value in a list that is "ReadOnly".
See also: