diff --git a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Plain/CsPlainSourceBuilder.cs b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Plain/CsPlainSourceBuilder.cs index 144da0ec1..7af3e64db 100644 --- a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Plain/CsPlainSourceBuilder.cs +++ b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Plain/CsPlainSourceBuilder.cs @@ -66,8 +66,13 @@ public void CreateClassDeclaration(IClassDeclarationSyntax classDeclarationSynta { TypeCommAccessibility = eCommAccessibility.ReadOnly; } - + classDeclarationSyntax.UsingDirectives.ToList().ForEach(p => p.Visit(visitor, this)); + + var classDeclarations = this.Compilation.GetSemanticTree().Classes + .Where(p => p.FullyQualifiedName == classDeclaration.GetQualifiedName()); + AddToSource(classDeclaration.Pragmas.AddedPropertiesAsAttributes()); + AddToSource($"{classDeclaration.AccessModifier.Transform()}partial class {classDeclaration.Name}"); var isExtended = Compilation.GetSemanticTree().Types @@ -109,6 +114,8 @@ public void CreateFieldDeclaration(IFieldDeclaration fieldDeclaration, IxNodeVis { if (fieldDeclaration.IsMemberEligibleForTranspile(this)) { + AddToSource(fieldDeclaration.Pragmas.AddAttributes()); + AddToSource(fieldDeclaration.Pragmas.AddedPropertiesAsAttributes()); switch (fieldDeclaration.Type) { case IArrayTypeDeclaration arrayType: @@ -182,6 +189,7 @@ public void CreateFile(IFileSyntax fileSyntax, IxNodeVisitor visitor) { AddToSource("using System;"); AddToSource("using AXSharp.Abstractions.Presentation;"); + AddToSource("using AXSharp.Connector;"); foreach (var fileSyntaxUsingDirective in fileSyntax.UsingDirectives @@ -259,6 +267,8 @@ public void CreateVariableDeclaration(IVariableDeclaration fieldDeclaration, IxN { if (fieldDeclaration.IsMemberEligibleForTranspile(this)) { + AddToSource(fieldDeclaration.Pragmas.AddAttributes()); + AddToSource(fieldDeclaration.Pragmas.AddedPropertiesAsAttributes()); switch (fieldDeclaration.Type) { case IArrayTypeDeclaration arrayType: diff --git a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Pragmas/PragmaExtensions.cs b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Pragmas/PragmaExtensions.cs index ccb052fdd..fdfe2c79c 100644 --- a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Pragmas/PragmaExtensions.cs +++ b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Pragmas/PragmaExtensions.cs @@ -11,6 +11,7 @@ using AX.ST.Semantic.Pragmas; using AXSharp.Compiler.Core; using AXSharp.Compiler.Cs.Pragmas.PragmaParser; +using AXSharp.Connector; namespace AXSharp.Compiler.Cs; @@ -40,6 +41,29 @@ public static string AddAttributes(this IEnumerable pragmas) .Select(p => Pragmas.PragmaParser.PragmaCompiler.Compile(p).Product)); } + public static string AddedPropertiesAsAttributes(this IEnumerable pragmas) + { + var properties = pragmas.Where(p => + p.Content.StartsWith(PRAGMA_PROPERTY_SET_SIGNATURE)) + .Select(p => Pragmas.PragmaParser.PragmaCompiler.Compile(p).Property); + + + var valueTuples = properties as (string PropertyName, string InitValue)[] ?? properties.ToArray(); + if (valueTuples.Count() > 0) + { + var sb = new StringBuilder(); + + foreach (var property in valueTuples) + { + sb.AppendLine($"[AXSharp.Connector.AddedPropertiesAttribute(\"{property.PropertyName}\", {property.InitValue})]\n"); + } + + return sb.ToString(); + } + + return string.Empty; + } + /// /// Produces property from list of ix pragmas declared on type declaration. /// @@ -74,7 +98,7 @@ public static string SetProperties(this IFieldDeclaration fieldDeclaration) return string.Join("\r\n", fieldDeclaration.Pragmas.Where(p => p.Content.StartsWith(PRAGMA_PROPERTY_SET_SIGNATURE)).Select(p => Pragmas.PragmaParser.PragmaCompiler.Compile(p, fieldDeclaration).Product)); } - + public static VisitorProduct GetGenericAttributes(this ITypeDeclaration typeDeclaration) { return typeDeclaration.Pragmas diff --git a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Pragmas/PragmaParser/Ast/AddedPropertySetterAstNode.cs b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Pragmas/PragmaParser/Ast/AddedPropertySetterAstNode.cs index db682e3a0..8e6864689 100644 --- a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Pragmas/PragmaParser/Ast/AddedPropertySetterAstNode.cs +++ b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Pragmas/PragmaParser/Ast/AddedPropertySetterAstNode.cs @@ -32,8 +32,12 @@ public override void AcceptVisitor(IAstVisitor visitor) { if (visitor is PragmaVisitor v) + { v.Product.Product = MemberName != null ? $"{MemberName}.{PropertyName} = {InitValue};" : $"{PropertyName} = {InitValue};"; + + if (PropertyName != null) v.Product.Property = (PropertyName, InitValue); + } } } \ No newline at end of file diff --git a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Pragmas/PragmaParser/PragmaVisitor.cs b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Pragmas/PragmaParser/PragmaVisitor.cs index 8040138de..e41c1c98e 100644 --- a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Pragmas/PragmaParser/PragmaVisitor.cs +++ b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Pragmas/PragmaParser/PragmaVisitor.cs @@ -31,4 +31,6 @@ public class VisitorProduct public string? GenericConstrains { get; set; } public IEnumerable GenericTypes { get; set; } public (string type, bool isPoco) GenericTypeAssignment { get; set; } + + public (string PropertyName, string? InitValue) Property { get; set; } } \ No newline at end of file diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/abstract_members.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/abstract_members.g.cs index a541d2fcd..89ec4046b 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/abstract_members.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/abstract_members.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/array_declaration.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/array_declaration.g.cs index b77ea8aec..4be77021f 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/array_declaration.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/array_declaration.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_all_primitives.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_all_primitives.g.cs index ac7225ce3..d6d0b616a 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_all_primitives.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_all_primitives.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_extended_by_known_type.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_extended_by_known_type.g.cs index 018ee378d..a02dfcfd9 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_extended_by_known_type.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_extended_by_known_type.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_extends.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_extends.g.cs index 4987d4713..4ce871c91 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_extends.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_extends.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_extends_and_implements.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_extends_and_implements.g.cs index f3e256082..91481513b 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_extends_and_implements.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_extends_and_implements.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_generic_extension.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_generic_extension.g.cs index af9ac664b..906b0bc07 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_generic_extension.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_generic_extension.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_implements.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_implements.g.cs index 26416e846..5eb39ed0d 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_implements.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_implements.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_implements_multiple.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_implements_multiple.g.cs index 69f951fb3..aca3704d2 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_implements_multiple.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_implements_multiple.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_internal.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_internal.g.cs index 536cad9f6..e4ba926f3 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_internal.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_internal.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_no_access_modifier.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_no_access_modifier.g.cs index b24259932..43b8cdaaf 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_no_access_modifier.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_no_access_modifier.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_complex_members.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_complex_members.g.cs index 93ad69369..27f5f1d89 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_complex_members.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_complex_members.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_non_public_members.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_non_public_members.g.cs index 2aef116e4..7f96b8734 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_non_public_members.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_non_public_members.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_pragmas.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_pragmas.g.cs index 06b6bc587..874c95304 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_pragmas.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_pragmas.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { @@ -11,6 +12,7 @@ public ClassWithPragmas() { } + [Container(Layout.Wrap)] public ClassWithPragmasNamespace.ComplexType1 myComplexType { get; set; } = new ClassWithPragmasNamespace.ComplexType1(); } diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_primitive_members.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_primitive_members.g.cs index 249a2199b..130080570 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_primitive_members.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_primitive_members.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_using_directives.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_using_directives.g.cs index 63bfb3936..ca595c931 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_using_directives.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/class_with_using_directives.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/compileromitsattribute.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/compileromitsattribute.g.cs index 54dd5001d..fd3e74f63 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/compileromitsattribute.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/compileromitsattribute.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { @@ -11,6 +12,7 @@ public ClassWithArrays() { } + [CompilerOmitsAttribute("Onliner")] public CompilerOmmits.Complex _must_be_omitted_in_onliner { get; set; } = new CompilerOmmits.Complex(); public Byte[] _primitive { get; set; } = new Byte[11]; } diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/configuration.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/configuration.g.cs index 308f7eef5..bf5892631 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/configuration.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/configuration.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { @@ -50,14 +51,19 @@ public partial class unitsTwinController public string mySTRING { get; set; } = string.Empty; public string myWSTRING { get; set; } = string.Empty; + [ReadOnce()] public string myWSTRING_readOnce { get; set; } = string.Empty; + [ReadOnly()] public string myWSTRING_readOnly { get; set; } = string.Empty; + [ReadOnce()] public ComplexForConfig cReadOnce { get; set; } = new ComplexForConfig(); + [ReadOnly()] public ComplexForConfig cReadOnly { get; set; } = new ComplexForConfig(); public global::Colorss Colorss { get; set; } public UInt64 Colorsss { get; set; } + [CompilerOmitsAttribute("Onliner")] public Boolean _must_be_omitted_in_onliner { get; set; } } diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/enum_simple.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/enum_simple.g.cs index a0b88721c..e23d372b9 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/enum_simple.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/enum_simple.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/file_with_unsupported.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/file_with_unsupported.g.cs index fcca51513..56cacaa1e 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/file_with_unsupported.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/file_with_unsupported.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/file_with_usings.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/file_with_usings.g.cs index 9de21a2db..1fecb9332 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/file_with_usings.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/file_with_usings.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; using Pocos.FileWithUsingsSimpleFirstLevelNamespace; using Pocos.FileWithUsingsSimpleQualifiedNamespace.Qualified; using Pocos.FileWithUsingsHelloLevelOne.FileWithUsingsHelloLevelTwo; diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/generics.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/generics.g.cs index 55d946a7f..c950e084b 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/generics.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/generics.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { @@ -29,6 +30,9 @@ public Extendee2() : base() { } + [AXOpen.Data.AxoDataEntityAttribute] + [Container(Layout.Stack)] + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "Shared Header")] public GenericsTests.SomeTypeToBeGeneric SomeData { get; set; } = new GenericsTests.SomeTypeToBeGeneric(); } } diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/makereadonce.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/makereadonce.g.cs index db62bac41..32d6a7428 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/makereadonce.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/makereadonce.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { @@ -11,8 +12,10 @@ public MembersWithMakeReadOnce() { } + [ReadOnce()] public string makeReadOnceMember { get; set; } = string.Empty; public string someOtherMember { get; set; } = string.Empty; + [ReadOnce()] public makereadonce.ComplexMember makeReadComplexMember { get; set; } = new makereadonce.ComplexMember(); public makereadonce.ComplexMember someotherComplexMember { get; set; } = new makereadonce.ComplexMember(); } diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/makereadonly.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/makereadonly.g.cs index 18f0b3e2a..e4a569d8f 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/makereadonly.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/makereadonly.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { @@ -11,8 +12,10 @@ public MembersWithMakeReadOnly() { } + [ReadOnly()] public string makeReadOnceMember { get; set; } = string.Empty; public string someOtherMember { get; set; } = string.Empty; + [ReadOnly()] public makereadonly.ComplexMember makeReadComplexMember { get; set; } = new makereadonly.ComplexMember(); public makereadonly.ComplexMember someotherComplexMember { get; set; } = new makereadonly.ComplexMember(); } diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/misc.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/misc.g.cs index 026eb5e49..c1d3efe39 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/misc.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/misc.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/mixed_access.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/mixed_access.g.cs index de45b70d0..ef826ab87 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/mixed_access.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/mixed_access.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/program.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/program.g.cs index a0b88721c..e23d372b9 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/program.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/program.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/ref_to_simple.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/ref_to_simple.g.cs index 1ec3d9996..22248e832 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/ref_to_simple.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/ref_to_simple.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/simple_empty_class.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/simple_empty_class.g.cs index 7e14c9fff..49d5fd250 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/simple_empty_class.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/simple_empty_class.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/simple_empty_class_within_namespace.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/simple_empty_class_within_namespace.g.cs index b57595c0c..3cf279ae8 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/simple_empty_class_within_namespace.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/simple_empty_class_within_namespace.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/struct_simple.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/struct_simple.g.cs index 96f9ba335..0c0b4d7c5 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/struct_simple.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/struct_simple.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/type_named_values.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/type_named_values.g.cs index 90d7f5cba..a5e6936b1 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/type_named_values.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/type_named_values.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/type_named_values_literals.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/type_named_values_literals.g.cs index 53a824a8d..14b4df591 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/type_named_values_literals.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/type_named_values_literals.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/type_with_enum.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/type_with_enum.g.cs index 660fe53e8..3a3c5da53 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/type_with_enum.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/type_with_enum.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/types_with_name_attributes.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/types_with_name_attributes.g.cs index 97142b376..2c9aba9fb 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/types_with_name_attributes.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/types_with_name_attributes.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/types_with_property_attributes.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/types_with_property_attributes.g.cs index 0470f2431..85e0d82b0 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/types_with_property_attributes.g.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/types_with_property_attributes.g.cs @@ -1,16 +1,19 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { namespace TypesWithPropertyAttributes { + [AXSharp.Connector.AddedPropertiesAttribute("Description", "Some added property name value")] public partial class SomeAddedProperties : AXSharp.Connector.IPlain { public SomeAddedProperties() { } + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "Pocitadlo")] public Int16 Counter { get; set; } } } diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/units.csproj b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/units.csproj index 912973e03..826d6fc1a 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/units.csproj +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/units.csproj @@ -6,8 +6,8 @@ - - + + diff --git a/src/AXSharp.compiler/tests/integration/expected/app/ix/.g/POCO/configuration.g.cs b/src/AXSharp.compiler/tests/integration/expected/app/ix/.g/POCO/configuration.g.cs index 39a1edd60..842fa3b13 100644 --- a/src/AXSharp.compiler/tests/integration/expected/app/ix/.g/POCO/configuration.g.cs +++ b/src/AXSharp.compiler/tests/integration/expected/app/ix/.g/POCO/configuration.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/AXSharp.compiler/tests/integration/expected/app/ix/.g/POCO/program.g.cs b/src/AXSharp.compiler/tests/integration/expected/app/ix/.g/POCO/program.g.cs index a0b88721c..e23d372b9 100644 --- a/src/AXSharp.compiler/tests/integration/expected/app/ix/.g/POCO/program.g.cs +++ b/src/AXSharp.compiler/tests/integration/expected/app/ix/.g/POCO/program.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/AXSharp.compiler/tests/integration/expected/lib1/src/library.st b/src/AXSharp.compiler/tests/integration/expected/lib1/src/library.st index 0a3258559..aeac64f5f 100644 --- a/src/AXSharp.compiler/tests/integration/expected/lib1/src/library.st +++ b/src/AXSharp.compiler/tests/integration/expected/lib1/src/library.st @@ -1,5 +1,5 @@ NAMESPACE lib1 - + {S7.extern=ReadWrite} CLASS PUBLIC MyClass VAR PUBLIC MyString : STRING; diff --git a/src/AXSharp.compiler/tests/integration/expected/lib1/test/test.st b/src/AXSharp.compiler/tests/integration/expected/lib1/test/test.st index b43340ece..96f330083 100644 --- a/src/AXSharp.compiler/tests/integration/expected/lib1/test/test.st +++ b/src/AXSharp.compiler/tests/integration/expected/lib1/test/test.st @@ -4,6 +4,7 @@ USING MyLibrary; NAMESPACE MyTest {TestFixture} + {S7.extern=ReadWrite} CLASS MyTestFixture VAR PROTECTED diff --git a/src/AXSharp.compiler/tests/integration/expected/lib2/src/library.st b/src/AXSharp.compiler/tests/integration/expected/lib2/src/library.st index d94c021e6..afec9373b 100644 --- a/src/AXSharp.compiler/tests/integration/expected/lib2/src/library.st +++ b/src/AXSharp.compiler/tests/integration/expected/lib2/src/library.st @@ -1,5 +1,6 @@ NAMESPACE lib2 + {S7.extern=ReadWrite} CLASS PUBLIC MyClass VAR PUBLIC MyString : STRING; diff --git a/src/AXSharp.compiler/tests/integration/expected/lib2/test/test.st b/src/AXSharp.compiler/tests/integration/expected/lib2/test/test.st index b43340ece..96f330083 100644 --- a/src/AXSharp.compiler/tests/integration/expected/lib2/test/test.st +++ b/src/AXSharp.compiler/tests/integration/expected/lib2/test/test.st @@ -4,6 +4,7 @@ USING MyLibrary; NAMESPACE MyTest {TestFixture} + {S7.extern=ReadWrite} CLASS MyTestFixture VAR PROTECTED diff --git a/src/AXSharp.connectors/src/AXSharp.Connector/Attributes/AddedPropertiesAttribute.cs b/src/AXSharp.connectors/src/AXSharp.Connector/Attributes/AddedPropertiesAttribute.cs new file mode 100644 index 000000000..4a2d2ff1b --- /dev/null +++ b/src/AXSharp.connectors/src/AXSharp.Connector/Attributes/AddedPropertiesAttribute.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; + +namespace AXSharp.Connector; + + +[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property, AllowMultiple = true)] +public class AddedPropertiesAttribute : Attribute +{ + public string PropertyName { get; set; } + public object PropertyValue { get; set; } + + public AddedPropertiesAttribute(string propertyName, object propertyValue) + { + PropertyName = propertyName; + PropertyValue = propertyValue; + } +} \ No newline at end of file diff --git a/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/all_primitives.g.cs b/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/all_primitives.g.cs index 0d2eb3d66..582540d76 100644 --- a/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/all_primitives.g.cs +++ b/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/all_primitives.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/configuration.g.cs b/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/configuration.g.cs index 58fd75e94..c892c64a2 100644 --- a/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/configuration.g.cs +++ b/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/configuration.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; using Pocos.MonsterData; namespace Pocos @@ -9,10 +10,17 @@ public partial class ix_integration_plcTwinController public all_primitives all_primitives { get; set; } = new all_primitives(); public weather weather { get; set; } = new weather(); public weathers weathers { get; set; } = new weathers(); + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "Weather in a stack pannel and grouped in group box")] public Layouts.Stacked.weather weather_stacked { get; set; } = new Layouts.Stacked.weather(); + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "Weather in a wrap pannel and grouped in group box")] public Layouts.Wrapped.weather weather_wrapped { get; set; } = new Layouts.Wrapped.weather(); + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "Weather in a tabs and grouped in group box")] public Layouts.Tabbed.weather weather_tabbed { get; set; } = new Layouts.Tabbed.weather(); + [ReadOnce()] + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "Weather structure set to read once")] public Layouts.Stacked.weather weather_readOnce { get; set; } = new Layouts.Stacked.weather(); + [ReadOnly()] + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "Weather structure set to read only")] public Layouts.Stacked.weather weather_readOnly { get; set; } = new Layouts.Stacked.weather(); public example test_example { get; set; } = new example(); public MeasurementExample.Measurements measurements { get; set; } = new MeasurementExample.Measurements(); diff --git a/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/example.g.cs b/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/example.g.cs index 4697931d5..82a32939e 100644 --- a/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/example.g.cs +++ b/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/example.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { @@ -9,20 +10,34 @@ public example() { } + [Container(Layout.Stack)] public test_primitive primitives_stack { get; set; } = new test_primitive(); + [Container(Layout.Wrap)] public test_primitive primitives_wrap { get; set; } = new test_primitive(); + [Container(Layout.Tabs)] public test_primitive primitives_tabs { get; set; } = new test_primitive(); + [Container(Layout.UniformGrid)] public test_primitive primitives_uniform { get; set; } = new test_primitive(); + [Container(Layout.Stack)] + [Group(GroupLayout.GroupBox)] public test_primitive test_groupbox { get; set; } = new test_primitive(); + [Container(Layout.Stack)] + [Group(GroupLayout.Border)] public test_primitive test_border { get; set; } = new test_primitive(); + [Container(Layout.Tabs)] + [Group(GroupLayout.GroupBox)] public groupbox testgroupbox { get; set; } = new groupbox(); public border testborder { get; set; } = new border(); public ixcomponent ixcomponent_instance { get; set; } = new ixcomponent(); public MySecondNamespace.ixcomponent ixcomponent_instance2 { get; set; } = new MySecondNamespace.ixcomponent(); public ThirdNamespace.ixcomponent ixcomponent_instance3 { get; set; } = new ThirdNamespace.ixcomponent(); + [Container(Layout.Stack)] public compositeLayout compositeStack { get; set; } = new compositeLayout(); + [Container(Layout.Wrap)] public compositeLayout compositeWrap { get; set; } = new compositeLayout(); + [Container(Layout.UniformGrid)] public compositeLayout compositeUniform { get; set; } = new compositeLayout(); + [Container(Layout.Tabs)] public compositeLayout compositeTabs { get; set; } = new compositeLayout(); } } \ No newline at end of file diff --git a/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/geolocation.g.cs b/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/geolocation.g.cs index 50657fd42..a3b524f2a 100644 --- a/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/geolocation.g.cs +++ b/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/geolocation.g.cs @@ -1,21 +1,32 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "Location")] public partial class GeoLocation : AXSharp.Connector.IPlain { public GeoLocation() { } + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "Latitude [°]")] + [AXSharp.Connector.AddedPropertiesAttribute("AttributeMinimum", -90.0f)] + [AXSharp.Connector.AddedPropertiesAttribute("AttributeMaximum", 90.0f)] public Single Latitude { get; set; } + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "Logitude [°]")] + [AXSharp.Connector.AddedPropertiesAttribute("AttributeMinimum", 0.0f)] + [AXSharp.Connector.AddedPropertiesAttribute("AttributeMaximum", 180.0f)] public Single Longitude { get; set; } + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "Altitude [m]")] public Single Altitude { get; set; } + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "Short descriptor")] public string Description { get; set; } = string.Empty; + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "Long descriptor")] public string LongDescription { get; set; } = string.Empty; } } \ No newline at end of file diff --git a/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/ixcomponent.g.cs b/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/ixcomponent.g.cs index a1d97ef5a..d1e660f4f 100644 --- a/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/ixcomponent.g.cs +++ b/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/ixcomponent.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { @@ -9,9 +10,12 @@ public ixcomponent() { } + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "My integer")] public Int16 my_int { get; set; } + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "My string")] public string my_string { get; set; } = string.Empty; + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "My bool")] public Boolean my_bool { get; set; } } @@ -23,9 +27,12 @@ public ixcomponent() { } + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "My integer")] public Int16 my_int { get; set; } + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "My string")] public string my_string { get; set; } = string.Empty; + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "My bool")] public Boolean my_bool { get; set; } } } @@ -38,9 +45,12 @@ public ixcomponent() { } + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "My integer")] public Int16 my_int { get; set; } + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "My string")] public string my_string { get; set; } = string.Empty; + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "My bool")] public Boolean my_bool { get; set; } } } diff --git a/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/measurement.g.cs b/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/measurement.g.cs index 57ce2a68b..7904dd16d 100644 --- a/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/measurement.g.cs +++ b/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/measurement.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { @@ -11,12 +12,17 @@ public Measurement() { } + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "Minimum")] public Single Min { get; set; } + [ReadOnly()] + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "Measured")] public Single Acquired { get; set; } + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "Maximum")] public Single Max { get; set; } + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "Measurement Result")] public Int16 Result { get; set; } } @@ -26,9 +32,21 @@ public Measurements() { } + [Container(Layout.Stack)] + [Group(GroupLayout.GroupBox)] + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "Stack panel")] public MeasurementExample.Measurement measurement_stack { get; set; } = new MeasurementExample.Measurement(); + [Container(Layout.Wrap)] + [Group(GroupLayout.GroupBox)] + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "Wrap panel")] public MeasurementExample.Measurement measurement_wrap { get; set; } = new MeasurementExample.Measurement(); + [Container(Layout.UniformGrid)] + [Group(GroupLayout.GroupBox)] + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "Grid")] public MeasurementExample.Measurement measurement_grid { get; set; } = new MeasurementExample.Measurement(); + [Container(Layout.Tabs)] + [Group(GroupLayout.GroupBox)] + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "Tabs")] public MeasurementExample.Measurement measurement_tabs { get; set; } = new MeasurementExample.Measurement(); } } diff --git a/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/monster.g.cs b/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/monster.g.cs index 491c573bd..e895f70d1 100644 --- a/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/monster.g.cs +++ b/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/monster.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/program.g.cs b/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/program.g.cs index a0b88721c..e23d372b9 100644 --- a/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/program.g.cs +++ b/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/program.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/stacked/weather.g.cs b/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/stacked/weather.g.cs index ab347e98c..9f5f7a0b6 100644 --- a/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/stacked/weather.g.cs +++ b/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/stacked/weather.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/tabbed/weather.g.cs b/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/tabbed/weather.g.cs index a44f79eca..fd02cdd14 100644 --- a/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/tabbed/weather.g.cs +++ b/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/tabbed/weather.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/test/border.g.cs b/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/test/border.g.cs index 51ca5c5cc..57910bd89 100644 --- a/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/test/border.g.cs +++ b/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/test/border.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { @@ -9,24 +10,36 @@ public border() { } + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "<#Integer From PLC#>")] public Int16 testInteger { get; set; } + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "<#UInteger From PLC#>")] public Int16 testUInteger { get; set; } + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "<#STRING From PLC#>")] public string testString { get; set; } = string.Empty; + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "<#WORD From PLC#>")] public UInt16 testWord { get; set; } + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "<#BYTE From PLC#>")] public Byte testByte { get; set; } + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "<#REAL From PLC#>")] public Single testReal { get; set; } + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "<#LREAL From PLC#>")] public Double testLReal { get; set; } + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "<#BOOL From PLC#>")] public Boolean testBool { get; set; } + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "<#DATE From PLC#>")] public DateOnly TestDate { get; set; } = default(DateOnly); + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "<#DATE_AND_TIME From PLC#>")] public DateTime TestDateTime { get; set; } = default(DateTime); + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "<#TIME_OF_DAY From PLC#>")] public TimeSpan TestTimeOfDay { get; set; } = default(TimeSpan); + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "<#ENUM Station status#>")] public global::enumStationStatus Status { get; set; } } } \ No newline at end of file diff --git a/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/test/enumStationStatus.g.cs b/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/test/enumStationStatus.g.cs index a0b88721c..e23d372b9 100644 --- a/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/test/enumStationStatus.g.cs +++ b/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/test/enumStationStatus.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/test/groupbox.g.cs b/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/test/groupbox.g.cs index 8e8d80341..2052b51de 100644 --- a/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/test/groupbox.g.cs +++ b/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/test/groupbox.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { @@ -9,24 +10,36 @@ public groupbox() { } + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "<#Integer From PLC#>")] public Int16 testInteger { get; set; } + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "<#UInteger From PLC#>")] public Int16 testUInteger { get; set; } + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "<#STRING From PLC#>")] public string testString { get; set; } = string.Empty; + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "<#WORD From PLC#>")] public UInt16 testWord { get; set; } + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "<#BYTE From PLC#>")] public Byte testByte { get; set; } + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "<#REAL From PLC#>")] public Single testReal { get; set; } + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "<#LREAL From PLC#>")] public Double testLReal { get; set; } + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "<#BOOL From PLC#>")] public Boolean testBool { get; set; } + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "<#DATE From PLC#>")] public DateOnly TestDate { get; set; } = default(DateOnly); + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "<#DATE_AND_TIME From PLC#>")] public DateTime TestDateTime { get; set; } = default(DateTime); + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "<#TIME_OF_DAY From PLC#>")] public TimeSpan TestTimeOfDay { get; set; } = default(TimeSpan); + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "<#ENUM Station status#>")] public global::enumStationStatus Status { get; set; } } } \ No newline at end of file diff --git a/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/test/test_primitive.g.cs b/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/test/test_primitive.g.cs index ef0349e17..7ce74e85a 100644 --- a/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/test/test_primitive.g.cs +++ b/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/test/test_primitive.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { @@ -9,24 +10,36 @@ public test_primitive() { } + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "<#Integer From PLC#>")] public Int16 testInteger { get; set; } + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "<#UInteger From PLC#>")] public Int16 testUInteger { get; set; } + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "<#STRING From PLC#>")] public string testString { get; set; } = string.Empty; + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "<#WORD From PLC#>")] public UInt16 testWord { get; set; } + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "<#BYTE From PLC#>")] public Byte testByte { get; set; } + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "<#REAL From PLC#>")] public Single testReal { get; set; } + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "<#LREAL From PLC#>")] public Double testLReal { get; set; } + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "<#BOOL From PLC#>")] public Boolean testBool { get; set; } + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "<#DATE From PLC#>")] public DateOnly TestDate { get; set; } = default(DateOnly); + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "<#DATE_AND_TIME From PLC#>")] public DateTime TestDateTime { get; set; } = default(DateTime); + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "<#TIME_OF_DAY From PLC#>")] public TimeSpan TestTimeOfDay { get; set; } = default(TimeSpan); + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "<#ENUM Station status#>")] public global::enumStationStatus Status { get; set; } } } \ No newline at end of file diff --git a/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/weather.g.cs b/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/weather.g.cs index 58bbe2435..34bdaab5a 100644 --- a/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/weather.g.cs +++ b/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/weather.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/weatherBase.g.cs b/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/weatherBase.g.cs index 75abe6ad5..2f8211a49 100644 --- a/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/weatherBase.g.cs +++ b/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/weatherBase.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { @@ -16,13 +17,26 @@ public weatherBase() public Single Altitude { get; set; } public string Description { get; set; } = string.Empty; + [ReadOnly()] public string LongDescription { get; set; } = string.Empty; + [ReadOnce()] + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "this has [ReadOnce()] attribute will be readon only once...")] public Int16 StartCounter { get; set; } + [RenderIgnore()] + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "[RenderIgnore()] must not be displayed!")] public string RenderIgnoreAllToghether { get; set; } = string.Empty; + [RenderIgnore("Control")] + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "[RenderIgnore(''Control'')]")] public string RenderIgnoreWhenControl { get; set; } = string.Empty; + [RenderIgnore("Display")] + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "[RenderIgnore(''Display'')]")] public string RenderIgnoreWhenDisplay { get; set; } = string.Empty; + [RenderIgnore("Control", "ShadowControl")] + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "[RenderIgnore(''Control'', ''ShadowControl'')]")] public string RenderIgnoreWhenControlAndShadow { get; set; } = string.Empty; + [RenderIgnore("Display", "ShadowDisplay")] + [AXSharp.Connector.AddedPropertiesAttribute("AttributeName", "[RenderIgnore(''Display'', ''ShadowDisplay'')]")] public string RenderIgnoreWhenDisplayAndShadow { get; set; } = string.Empty; } } \ No newline at end of file diff --git a/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/wrapped/weather.g.cs b/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/wrapped/weather.g.cs index f1e9aa0d0..0236c8dd1 100644 --- a/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/wrapped/weather.g.cs +++ b/src/sanbox/integration/ix-integration-plc/ix/.g/POCO/wrapped/weather.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/tests.integrations/integrated/src/integrated.twin/.g/POCO/configuration.g.cs b/src/tests.integrations/integrated/src/integrated.twin/.g/POCO/configuration.g.cs index 0e8e1ad4f..b3d4996be 100644 --- a/src/tests.integrations/integrated/src/integrated.twin/.g/POCO/configuration.g.cs +++ b/src/tests.integrations/integrated/src/integrated.twin/.g/POCO/configuration.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; using Pocos.RealMonsterData; namespace Pocos diff --git a/src/tests.integrations/integrated/src/integrated.twin/.g/POCO/dataswapping/all_primitives.g.cs b/src/tests.integrations/integrated/src/integrated.twin/.g/POCO/dataswapping/all_primitives.g.cs index ec93d9863..5e0cad613 100644 --- a/src/tests.integrations/integrated/src/integrated.twin/.g/POCO/dataswapping/all_primitives.g.cs +++ b/src/tests.integrations/integrated/src/integrated.twin/.g/POCO/dataswapping/all_primitives.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/tests.integrations/integrated/src/integrated.twin/.g/POCO/dataswapping/moster.g.cs b/src/tests.integrations/integrated/src/integrated.twin/.g/POCO/dataswapping/moster.g.cs index edef61eef..f1f264d58 100644 --- a/src/tests.integrations/integrated/src/integrated.twin/.g/POCO/dataswapping/moster.g.cs +++ b/src/tests.integrations/integrated/src/integrated.twin/.g/POCO/dataswapping/moster.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { @@ -19,7 +20,9 @@ public MonsterBase() public Byte[] ArrayOfBytes { get; set; } = new Byte[4]; public MonsterData.DriveBase[] ArrayOfDrives { get; set; } = new MonsterData.DriveBase[4]; + [IgnoreOnPocoOperation()] public MonsterData.DriveBase DriveBase_tobeignoredbypocooperations { get; set; } = new MonsterData.DriveBase(); + [IgnoreOnPocoOperation()] public string Description_tobeignoredbypocooperations { get; set; } = string.Empty; } diff --git a/src/tests.integrations/integrated/src/integrated.twin/.g/POCO/dataswapping/myEnum.g.cs b/src/tests.integrations/integrated/src/integrated.twin/.g/POCO/dataswapping/myEnum.g.cs index a0b88721c..e23d372b9 100644 --- a/src/tests.integrations/integrated/src/integrated.twin/.g/POCO/dataswapping/myEnum.g.cs +++ b/src/tests.integrations/integrated/src/integrated.twin/.g/POCO/dataswapping/myEnum.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/tests.integrations/integrated/src/integrated.twin/.g/POCO/dataswapping/realmonster.g.cs b/src/tests.integrations/integrated/src/integrated.twin/.g/POCO/dataswapping/realmonster.g.cs index b75557c51..4796ea11a 100644 --- a/src/tests.integrations/integrated/src/integrated.twin/.g/POCO/dataswapping/realmonster.g.cs +++ b/src/tests.integrations/integrated/src/integrated.twin/.g/POCO/dataswapping/realmonster.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos { diff --git a/src/tests.integrations/integrated/src/integrated.twin/.g/POCO/program.g.cs b/src/tests.integrations/integrated/src/integrated.twin/.g/POCO/program.g.cs index a0b88721c..e23d372b9 100644 --- a/src/tests.integrations/integrated/src/integrated.twin/.g/POCO/program.g.cs +++ b/src/tests.integrations/integrated/src/integrated.twin/.g/POCO/program.g.cs @@ -1,5 +1,6 @@ using System; using AXSharp.Abstractions.Presentation; +using AXSharp.Connector; namespace Pocos {