Skip to main content
Version: 2024.2

6.3. How to Use Data Virtualization

To enable the data virtualization, you should apply a custom attribute to your field. In order to do that, you can use the instructions below.

Instructions on enabling data virtualization

  1. Locate the declaration of a field you want to virtualize

  2. Add a custom attribute as shown below (C#):

    using System;
    using System.Reflection;

    class YourClass
    {
    [Obfuscation(Feature = "virtualization", Exclude = false)]
    bool yourField;
    }

    For Visual Basic .NET:

    Imports System
    Imports System.Reflection

    Class YourClass

    <Obfuscation(Feature:="virtualization", Exclude:=False)>
    Dim yourField As Boolean

    End Class
Note

Virtualization can significantly slow down the speed of code execution, so please use this feature wisely.

Note

Data virtualization can only be applied to the fields of the following types:

Primitive types

  • System.Boolean
  • System.Byte
  • System.Char
  • System.Decimal
  • System.Double
  • System.Int16
  • System.Int32
  • System.Int64
  • System.SByte
  • System.Single
  • System.UInt16
  • System.UInt32
  • System.UInt64

One-dimensional arrays of primitive types

  • System.Boolean[]
  • System.Byte[]
  • System.Char[]
  • System.Double[]
  • System.Int16[]
  • System.Int32[]
  • System.Int64[]
  • System.SByte[]
  • System.Single[]
  • System.UInt16[]
  • System.UInt32[]
  • System.UInt64[]

Other types

  • System.DateTime
  • System.Enum
  • System.Guid
  • System.String
  • System.TimeSpan