How to define virtual properties in Class Model definition

Questions regarding the use of UaModeler

Moderator: uamodeler

Post Reply
prebecchi
Jr. Member
Jr. Member
Posts: 1
Joined: 02 Oct 2017, 10:34

How to define virtual properties in Class Model definition

Post by prebecchi »

Hi everyone,
when i compile my project in UAModeler I need to create .NET classes which have virtual properties defined, in order to be able to inherit these classes and override properties with custom methods.
Example:

Code: Select all

    [UaTypeDefinition(NodeId=ObjectTypes.StorageInputType, NamespaceUri=MyServerOpcUaServer.Namespaces.MyNamespace)]
    public partial class MyClassModel : BaseObjectModel
    {
        public MyClassModel () : this((MyClassModel )null) {       }
        public MyClassModel (MyClassModel template) : base(template) {        }

        #region Public Properties

        [UaInstanceDeclaration(NamespaceUri = Namespaces.MyNamespace)]
        public virtual Command Command { get; set; }

        ....

I've tried to flag every single ObjectType I've defined as "IsAbstract" = TRUE, but nothing changed.
Could someone tell me how to achieve it?

Thanks in advance
Paolo

Post Reply