public AasEventMsgEnvelope( DateTime timestamp, AdminShell.Reference source = null, AdminShell.SemanticId sourceSemanticId = null, AdminShell.Reference observableReference = null, AdminShell.SemanticId observableSemanticId = null, string topic = null, string subject = null, AasPayloadBase payload = null, ListOfAasPayloadBase payloads = null) { Timestamp = timestamp; Source = source; SourceSemanticId = sourceSemanticId; ObservableReference = observableReference; ObservableSemanticId = observableSemanticId; Topic = topic; Subject = subject; if (payload != null) { PayloadItems.Add(payload); } if (payloads != null) { PayloadItems.AddRange(payloads); } }
public ListOfAasPayloadBase(ListOfAasPayloadBase other) : base() { if (other != null) { foreach (var pl in other) { // ReSharper disable once RedundantExplicitParamsArrayCreation var opl = Activator.CreateInstance(pl.GetType(), new object[] { pl }); if (opl is AasPayloadBase npl) { this.Add(npl); } } } }
public AasEventMsgEnvelope(AasEventMsgEnvelope other) { if (other == null) { return; } Timestamp = other.Timestamp; Source = other.Source; SourceSemanticId = other.SourceSemanticId; ObservableReference = other.ObservableReference; ObservableSemanticId = other.ObservableSemanticId; Topic = other.Topic; Subject = other.Subject; if (other.PayloadItems != null) { Payloads = new ListOfAasPayloadBase(other.PayloadItems); } else if (other.PayloadsRaw != null) { Payloads = other; } }