EntityDefinitionV1 Constructor

Initializes a new instance of the EntityDefinitionV1 class.

Namespace: Gamanet.C4.SimpleInterfaces
Assembly: Gamanet.C4.SimpleInterfaces (in Gamanet.C4.SimpleInterfaces.dll) Version: 2026.0.0.242
Syntax
C#
public EntityDefinitionV1(
	Guid id,
	Guid parentId,
	Guid categoryId,
	Guid entityType
)

Parameters

id  Guid
The identifier.
parentId  Guid
The parent identifier.
categoryId  Guid
The category identifier.
entityType  Guid
Type of the entity.
Example
The following example illustrates how to create EntityDefinition
C#
using Gamanet.C4.SDK.Enums.Core;
using Gamanet.C4.SDK.Enums.Devices; 
using Gamanet.C4.SimpleInterfaces; 
using SCExampleCore;
using System;
using System.Collections.Generic; 

public class CreateEntityDefinition()
{
    static void Main()
    {
      // crete new instance of EntityDefinition
      var entityDefinition = new EntityDefinition(Guid.NewGuid(), // entity definition's Id
          Guid.Parse("4c2efe4d-9d05-4106-adc6-45f9802d3e8d"), // entity type root id
          DeviceCategory.FireDetector, // category Id
          EntityType.Devices); // entity type Id

      entityDefinition.Name = "Fire detector XX";

      // add new definition commands
      entityDefinition.Commands = new List<Guid>()
      {
          CommandCategory.Arm,
          CommandCategory.Disable,
          CommandCategory.Enable,
          CommandCategory.AudioOn,
          CommandCategory.AudioOff,
      };

      // add custom enums
      entityDefinition.CustomEnums = new List<CustomEnum>()
      {
          new CustomEnum()
          {
              Name = "SignalsEnum",
              Values = new Dictionary<int, string>()
              {
                  [0] = "Fire",
                  [1] = "Smoke",
                  [2] = "Spark"
              }
          }
      };

      // add new extended properies
      entityDefinition.ExtendedProperties = new List<Property>()
      {
          new Property()
          {
              Name = "IPAddress",
              DefaultValue = "127.0.0.1",
              GroupCategory = "txtCategoryDriverSettings",
              Protected = false,
              Required = true,
              Type = "System.String"
          },

          new Property()
          {
              Name = "Port",
              DefaultValue = "90",
              GroupCategory = "txtCategoryDriverSettings",
              Protected = false,
              Required = true,
              Type = "System.Int32"
          }
      };

      // add statuses
      entityDefinition.Statuses = new List<Guid>()
      {
          DeviceStatusCategory.Arm, DeviceStatusCategory.Disabled, DeviceStatusCategory.Disconnected
      };

      // other data
      entityDefinition.Data["DefineAccess"] = true;
      entityDefinition.Data["Licensed"] = true;
      entityDefinition.Data["CredentialOwner"] = false;
    }
}
See Also

Reference

EntityDefinitionV1 Class
Gamanet.C4.SimpleInterfaces Namespace
PropertyV1
CustomEnumV1