Initial project state: .NET reference, design, Rust port (M0+M1), evidence
rust / build / test / clippy / fmt (push) Has been cancelled
rust / build / test / clippy / fmt (push) Has been cancelled
Layout:
- src/ .NET 10 x64 reference: MxNativeCodec, MxNativeClient,
MxAsbClient, probes, tests, harnesses. Executable spec.
- design/ Architectural plan for the Rust port (M0–M6), error
model, protocol invariants, risks (R1–R16), adversarial
review log (review.md).
- rust/ Rust workspace. M0 skeleton + M1 codec parity.
mxaccess-codec: 215 unit tests + 2 cross-implementation
parity tests (byte-identical against .NET reference).
Other crates are M0 stubs awaiting M2+.
- captures/ Frida + netsh + pcap evidence per CLAUDE.md
("captures are evidence, not throwaway logs").
- analysis/ Decompiled C# (frida/proxy/decompiled-*),
Ghidra exports for native DLLs (`exports/` only —
working state at `projects/` and AVEVA's input
binaries at `input/` are gitignored).
- docs/ Reverse-engineering reference docs.
- tools/ Setup-LiveProbeEnv.ps1 (Infisical credential fetcher),
Compute-Crc.ps1 (.NET parity helper).
- .github/workflows/ Rust CI: fmt + build + test + clippy on Windows.
- LICENSE MIT (Joseph Doherty, 2026).
Verified:
- cargo test --workspace → 217 passed (215 unit + 2 .NET parity), 0 failed
- cargo clippy --workspace -- -D warnings → clean
- cargo fmt --all -- --check → clean
- cargo publish --dry-run -p mxaccess-codec → packages cleanly
Excluded from history (see .gitignore):
- **/bin, **/obj, **/target — build artifacts
- analysis/ghidra/projects/ — Ghidra working state (regenerable)
- analysis/ghidra/input/ — AVEVA proprietary DLLs (vendor IP)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
using ArchestrAServices.Contract;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
public class ASBIDataCustomSerializer : ASBCustomSerializer
|
||||
{
|
||||
public ASBIDataCustomSerializer(Type type, XmlObjectSerializer fallbackSerializer)
|
||||
: base(type, fallbackSerializer)
|
||||
{
|
||||
m_ASBPrefix = "ASBIData";
|
||||
}
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
#define TRACE
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.Serialization;
|
||||
using System.ServiceModel.Description;
|
||||
using System.Xml;
|
||||
using ArchestrAServices.Common;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
public class ASBIDataCustomSerializerOperationBehavior : DataContractSerializerOperationBehavior
|
||||
{
|
||||
public ASBIDataCustomSerializerOperationBehavior(OperationDescription operation)
|
||||
: base(operation)
|
||||
{
|
||||
}
|
||||
|
||||
public override XmlObjectSerializer CreateSerializer(Type type, string name, string ns, IList<Type> knownTypes)
|
||||
{
|
||||
SvcTrace.DiagDiagnostics.TraceEvent(TraceEventType.Information, 0, $"ASBIDataCustomSerializerOperationBehavior:CreateSerializer-creating an instance for ASBIDataCustomSerializer class");
|
||||
return new ASBIDataCustomSerializer(type, base.CreateSerializer(type, name, ns, knownTypes));
|
||||
}
|
||||
|
||||
public override XmlObjectSerializer CreateSerializer(Type type, XmlDictionaryString name, XmlDictionaryString ns, IList<Type> knownTypes)
|
||||
{
|
||||
SvcTrace.DiagDiagnostics.TraceEvent(TraceEventType.Information, 0, $"ASBIDataCustomSerializerOperationBehavior:CreateSerializer-creating an instance for ASBIDataCustomSerializer class");
|
||||
return new ASBIDataCustomSerializer(type, base.CreateSerializer(type, name, ns, knownTypes));
|
||||
}
|
||||
}
|
||||
+1149
File diff suppressed because it is too large
Load Diff
+82
@@ -0,0 +1,82 @@
|
||||
using System;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
public static class ASBSerializer
|
||||
{
|
||||
public static ASBStatus ASBStatusFromArray(ASBStatusElement[] status)
|
||||
{
|
||||
ASBStatus result = new ASBStatus
|
||||
{
|
||||
Count = 0
|
||||
};
|
||||
if (status == null)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
ushort num = 0;
|
||||
ASBStatusElement[] array = status;
|
||||
for (int i = 0; i < array.Length; i++)
|
||||
{
|
||||
num = ((array[i].statusValue != 0) ? ((ushort)(num + 3)) : ((ushort)(num + 1)));
|
||||
}
|
||||
if (num > 255)
|
||||
{
|
||||
throw new IndexOutOfRangeException("Too many ASBStatusElements in ASBStatusFromArray");
|
||||
}
|
||||
byte[] array2 = new byte[num];
|
||||
num = 0;
|
||||
array = status;
|
||||
for (int i = 0; i < array.Length; i++)
|
||||
{
|
||||
ASBStatusElement aSBStatusElement = array[i];
|
||||
if (aSBStatusElement.statusValue == 0)
|
||||
{
|
||||
array2[num++] = (byte)(((byte)aSBStatusElement.statusType & 0x7F) | 0x80);
|
||||
continue;
|
||||
}
|
||||
array2[num++] = (byte)((byte)aSBStatusElement.statusType & 0x7F);
|
||||
byte[] array3 = new byte[2];
|
||||
array3 = BitConverter.GetBytes(aSBStatusElement.statusValue);
|
||||
array2[num++] = array3[0];
|
||||
array2[num++] = array3[1];
|
||||
}
|
||||
result.Count = (sbyte)num;
|
||||
result.Payload = array2;
|
||||
return result;
|
||||
}
|
||||
|
||||
public static ASBStatusElement[] ASBStatusToArray(ASBStatus status)
|
||||
{
|
||||
if (status.Payload == null)
|
||||
{
|
||||
return new ASBStatusElement[0];
|
||||
}
|
||||
byte[] payload = status.Payload;
|
||||
ushort num = 0;
|
||||
ushort num2 = 0;
|
||||
while (num2 < status.Count)
|
||||
{
|
||||
num2 = (((payload[num2] & 0x80) == 0) ? ((ushort)(num2 + 3)) : ((ushort)(num2 + 1)));
|
||||
num++;
|
||||
}
|
||||
ASBStatusElement[] array = new ASBStatusElement[num];
|
||||
num2 = 0;
|
||||
for (ushort num3 = 0; num3 < num; num3++)
|
||||
{
|
||||
if ((payload[num2] & 0x80) != 0)
|
||||
{
|
||||
array[num3].statusType = (ASBStatusType)(payload[num2] & 0x7F);
|
||||
array[num3].statusValue = 0;
|
||||
num2++;
|
||||
}
|
||||
else
|
||||
{
|
||||
array[num3].statusType = (ASBStatusType)payload[num2++];
|
||||
array[num3].statusValue = BitConverter.ToUInt16(payload, num2);
|
||||
num2 += 2;
|
||||
}
|
||||
}
|
||||
return array;
|
||||
}
|
||||
}
|
||||
+165
@@ -0,0 +1,165 @@
|
||||
#define TRACE
|
||||
using System;
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Xml.Serialization;
|
||||
using ArchestrAServices.Common;
|
||||
using ArchestrAServices.Contract;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[Serializable]
|
||||
[GeneratedCode("System.Xml", "4.0.30319.18054")]
|
||||
[DebuggerStepThrough]
|
||||
[XmlType(Namespace = "http://asb.contracts.idata.data/20111111")]
|
||||
public struct ASBStatus : IASBCustomSerializableType
|
||||
{
|
||||
private sbyte countField;
|
||||
|
||||
private byte[] payloadField;
|
||||
|
||||
public sbyte Count
|
||||
{
|
||||
get
|
||||
{
|
||||
return countField;
|
||||
}
|
||||
set
|
||||
{
|
||||
countField = value;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlElement(DataType = "base64Binary")]
|
||||
public byte[] Payload
|
||||
{
|
||||
get
|
||||
{
|
||||
return payloadField;
|
||||
}
|
||||
set
|
||||
{
|
||||
payloadField = value;
|
||||
}
|
||||
}
|
||||
|
||||
public void WriteToStream(BinaryWriter writer)
|
||||
{
|
||||
if (writer == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
writer.Write(countField);
|
||||
if (payloadField != null)
|
||||
{
|
||||
writer.Write((uint)payloadField.Length);
|
||||
writer.Write(payloadField);
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.Write(0u);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SvcTrace.DiagDiagnostics.TraceEvent(TraceEventType.Error, 0, $" ASBStatus: WriteTo. Exception raised {ex.Message} \n Stack Trace: {ex.StackTrace}");
|
||||
}
|
||||
}
|
||||
|
||||
public void InitializeFromStream(BinaryReader reader)
|
||||
{
|
||||
if (reader == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
countField = reader.ReadSByte();
|
||||
int num = reader.ReadInt32();
|
||||
if (num > 0)
|
||||
{
|
||||
payloadField = reader.ReadBytes(num);
|
||||
}
|
||||
else
|
||||
{
|
||||
payloadField = null;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SvcTrace.DiagDiagnostics.TraceEvent(TraceEventType.Error, 0, $" ASBStatus: InitializeFrom. Exception raised {ex.Message} \n Stack Trace: {ex.StackTrace}");
|
||||
}
|
||||
}
|
||||
|
||||
public object InitializeArrayFromStream(BinaryReader reader, int arrayCnt)
|
||||
{
|
||||
object result = null;
|
||||
if (MemoryStreamHelper.ValidateStream(reader, arrayCnt))
|
||||
{
|
||||
try
|
||||
{
|
||||
ASBStatus[] array = new ASBStatus[arrayCnt];
|
||||
for (int i = 0; i < arrayCnt; i++)
|
||||
{
|
||||
InitializeFrom(reader, ref array[i]);
|
||||
}
|
||||
result = array;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SvcTrace.DiagDiagnostics.TraceEvent(TraceEventType.Error, 0, $" ASBStatus: InitializeFromArray. Exception raised {ex.Message} \n Stack Trace: {ex.StackTrace}");
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public void WriteArrayToStream(object graph, ref BinaryWriter bw)
|
||||
{
|
||||
if (graph == null || bw == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
if (graph is ASBStatus[] array)
|
||||
{
|
||||
bw.Write(array.Length);
|
||||
ASBStatus[] array2 = array;
|
||||
foreach (ASBStatus aSBStatus in array2)
|
||||
{
|
||||
aSBStatus.WriteToStream(bw);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SvcTrace.DiagDiagnostics.TraceEvent(TraceEventType.Error, 0, $" ASBStatus: WriteArrayTo. Exception raised {ex.Message} \n Stack Trace: {ex.StackTrace}");
|
||||
}
|
||||
}
|
||||
|
||||
private static void InitializeFrom(BinaryReader reader, ref ASBStatus result)
|
||||
{
|
||||
if (MemoryStreamHelper.ValidateStream(reader))
|
||||
{
|
||||
result.countField = reader.ReadSByte();
|
||||
int num = reader.ReadInt32();
|
||||
if (num > 0)
|
||||
{
|
||||
result.payloadField = reader.ReadBytes(num);
|
||||
}
|
||||
else
|
||||
{
|
||||
result.payloadField = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ASBStatus(ArchestrAServices.Contract.ASBStatus oldStatus)
|
||||
{
|
||||
countField = (sbyte)oldStatus.Count;
|
||||
payloadField = oldStatus.Payload;
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
using ArchestrAServices.Contract;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
public static class ASBStatusConverter
|
||||
{
|
||||
public static ArchestrAServices.Contract.ASBStatus ASBStatusBacker(ASBStatus value)
|
||||
{
|
||||
return new ArchestrAServices.Contract.ASBStatus
|
||||
{
|
||||
Count = (byte)value.Count,
|
||||
Payload = value.Payload
|
||||
};
|
||||
}
|
||||
}
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
public struct ASBStatusElement
|
||||
{
|
||||
public ASBStatusType statusType;
|
||||
|
||||
public ushort statusValue;
|
||||
|
||||
public ASBStatus Status
|
||||
{
|
||||
get
|
||||
{
|
||||
byte b = 0;
|
||||
byte[] array = null;
|
||||
if (statusValue == 0)
|
||||
{
|
||||
b = 1;
|
||||
array = new byte[b];
|
||||
array[0] = (byte)(((byte)statusType & 0x7F) | 0x80);
|
||||
}
|
||||
else
|
||||
{
|
||||
b = 3;
|
||||
array = new byte[b];
|
||||
array[0] = (byte)((byte)statusType & 0x7F);
|
||||
byte[] array2 = new byte[2];
|
||||
array2 = BitConverter.GetBytes(statusValue);
|
||||
array[1] = array2[0];
|
||||
array[2] = array2[1];
|
||||
}
|
||||
return new ASBStatus
|
||||
{
|
||||
Count = (sbyte)b,
|
||||
Payload = array
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public ASBStatusElement(ASBStatus singleStatus)
|
||||
{
|
||||
if (singleStatus.Payload == null || singleStatus.Payload.Length < 1)
|
||||
{
|
||||
throw new IndexOutOfRangeException("ASBStatus payload contained no data in ASBStatusElement constructor");
|
||||
}
|
||||
if ((singleStatus.Payload[0] & 0x80) != 0)
|
||||
{
|
||||
statusType = (ASBStatusType)(singleStatus.Payload[0] & 0x7F);
|
||||
statusValue = 0;
|
||||
return;
|
||||
}
|
||||
if (singleStatus.Payload.Length < 3)
|
||||
{
|
||||
throw new IndexOutOfRangeException("ASBStatus payload contained insufficient data in ASBStatusElement constructor");
|
||||
}
|
||||
statusType = (ASBStatusType)singleStatus.Payload[0];
|
||||
statusValue = BitConverter.ToUInt16(singleStatus.Payload, 1);
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
public enum ASBStatusType : ushort
|
||||
{
|
||||
OPCDAStatus = 1,
|
||||
OPCUAStatus = 2,
|
||||
OPCUAVendorStatus = 3,
|
||||
SCADAStatus = 4,
|
||||
MXStatusCategory = 5,
|
||||
MxStatusDetail = 6,
|
||||
MxQuality = 7,
|
||||
Reserved1Status = 125,
|
||||
Reserved2Status = 126,
|
||||
Reserved3Status = 127
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.ServiceModel;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[DebuggerStepThrough]
|
||||
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[MessageContract(WrapperName = "AddMonitoredItemsRequest", WrapperNamespace = "http://asb.contracts.idata.messages/20111111", IsWrapped = true)]
|
||||
public class AddMonitoredItemsRequest : ConnectedRequest
|
||||
{
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 0)]
|
||||
public long SubscriptionId;
|
||||
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 1)]
|
||||
[XmlElement("Items")]
|
||||
public MonitoredItem[] Items;
|
||||
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 2)]
|
||||
public bool RequireId;
|
||||
|
||||
public AddMonitoredItemsRequest()
|
||||
{
|
||||
}
|
||||
|
||||
public AddMonitoredItemsRequest(long SubscriptionId, MonitoredItem[] Items, bool RequireId)
|
||||
{
|
||||
this.SubscriptionId = SubscriptionId;
|
||||
this.Items = Items;
|
||||
this.RequireId = RequireId;
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.ServiceModel;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[DebuggerStepThrough]
|
||||
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[MessageContract(WrapperName = "AddMonitoredItemsResponse", WrapperNamespace = "http://asb.contracts.idata.messages/20111111", IsWrapped = true)]
|
||||
public class AddMonitoredItemsResponse : ConnectedResponse
|
||||
{
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 0)]
|
||||
[XmlElement("Status")]
|
||||
public ItemStatus[] Status;
|
||||
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 1)]
|
||||
[XmlElement("ItemCapabilities")]
|
||||
public ItemRegistration[] ItemCapabilities;
|
||||
|
||||
public AddMonitoredItemsResponse()
|
||||
{
|
||||
}
|
||||
|
||||
public AddMonitoredItemsResponse(ItemStatus[] Status, ItemRegistration[] ItemCapabilities)
|
||||
{
|
||||
this.Status = Status;
|
||||
this.ItemCapabilities = ItemCapabilities;
|
||||
}
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.ServiceModel;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[DebuggerStepThrough]
|
||||
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[MessageContract(WrapperName = "ConfirmWriteRequest", WrapperNamespace = "http://asb.contracts.idata.messages/20111111", IsWrapped = true)]
|
||||
public class ConfirmWriteRequest : ConnectedRequest
|
||||
{
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 0)]
|
||||
public ItemIdentity Item;
|
||||
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 1)]
|
||||
public long WriteToken;
|
||||
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 2)]
|
||||
public WriteValue Value;
|
||||
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 3)]
|
||||
public UserToken User;
|
||||
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 4)]
|
||||
public UserToken Supervisor;
|
||||
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 5)]
|
||||
public uint WriteHandle;
|
||||
|
||||
public ConfirmWriteRequest()
|
||||
{
|
||||
}
|
||||
|
||||
public ConfirmWriteRequest(ItemIdentity Item, long WriteToken, WriteValue Value, UserToken User, UserToken Supervisor, uint WriteHandle)
|
||||
{
|
||||
this.Item = Item;
|
||||
this.WriteToken = WriteToken;
|
||||
this.Value = Value;
|
||||
this.User = User;
|
||||
this.Supervisor = Supervisor;
|
||||
this.WriteHandle = WriteHandle;
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.ServiceModel;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[DebuggerStepThrough]
|
||||
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[MessageContract(WrapperName = "ConfirmWriteResponse", WrapperNamespace = "http://asb.contracts.idata.messages/20111111", IsWrapped = true)]
|
||||
public class ConfirmWriteResponse : ConnectedResponse
|
||||
{
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.ServiceModel;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[DebuggerStepThrough]
|
||||
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[MessageContract(WrapperName = "CreateSubscriptionRequest", WrapperNamespace = "http://asb.contracts.idata.messages/20111111", IsWrapped = true)]
|
||||
public class CreateSubscriptionRequest : ConnectedRequest
|
||||
{
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 0)]
|
||||
public long MaxQueueSize;
|
||||
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 1)]
|
||||
public ulong SampleInterval;
|
||||
|
||||
public CreateSubscriptionRequest()
|
||||
{
|
||||
}
|
||||
|
||||
public CreateSubscriptionRequest(long MaxQueueSize, ulong SampleInterval)
|
||||
{
|
||||
this.MaxQueueSize = MaxQueueSize;
|
||||
this.SampleInterval = SampleInterval;
|
||||
}
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.ServiceModel;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[DebuggerStepThrough]
|
||||
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[MessageContract(WrapperName = "CreateSubscriptionResponse", WrapperNamespace = "http://asb.contracts.idata.messages/20111111", IsWrapped = true)]
|
||||
public class CreateSubscriptionResponse : ConnectedResponse
|
||||
{
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 0)]
|
||||
public long SubscriptionId;
|
||||
|
||||
public CreateSubscriptionResponse()
|
||||
{
|
||||
}
|
||||
|
||||
public CreateSubscriptionResponse(long SubscriptionId)
|
||||
{
|
||||
this.SubscriptionId = SubscriptionId;
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
public struct CustomEnum
|
||||
{
|
||||
public short ordinal;
|
||||
|
||||
public string OrdinalValue;
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
public enum DataQualityType : ushort
|
||||
{
|
||||
Good = 0,
|
||||
Uncertain = 16,
|
||||
Bad = 1,
|
||||
Other = ushort.MaxValue
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.ServiceModel;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[DebuggerStepThrough]
|
||||
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[MessageContract(WrapperName = "DeleteMonitoredItemsRequest", WrapperNamespace = "http://asb.contracts.idata.messages/20111111", IsWrapped = true)]
|
||||
public class DeleteMonitoredItemsRequest : ConnectedRequest
|
||||
{
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 0)]
|
||||
public long SubscriptionId;
|
||||
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 1)]
|
||||
[XmlElement("Items")]
|
||||
public MonitoredItem[] Items;
|
||||
|
||||
public DeleteMonitoredItemsRequest()
|
||||
{
|
||||
}
|
||||
|
||||
public DeleteMonitoredItemsRequest(long SubscriptionId, MonitoredItem[] Items)
|
||||
{
|
||||
this.SubscriptionId = SubscriptionId;
|
||||
this.Items = Items;
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.ServiceModel;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[DebuggerStepThrough]
|
||||
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[MessageContract(WrapperName = "DeleteMonitoredItemsResponse", WrapperNamespace = "http://asb.contracts.idata.messages/20111111", IsWrapped = true)]
|
||||
public class DeleteMonitoredItemsResponse : ConnectedResponse
|
||||
{
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 0)]
|
||||
[XmlElement("Status")]
|
||||
public ItemStatus[] Status;
|
||||
|
||||
public DeleteMonitoredItemsResponse()
|
||||
{
|
||||
}
|
||||
|
||||
public DeleteMonitoredItemsResponse(ItemStatus[] Status)
|
||||
{
|
||||
this.Status = Status;
|
||||
}
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.ServiceModel;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[DebuggerStepThrough]
|
||||
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[MessageContract(WrapperName = "DeleteSubscriptionRequest", WrapperNamespace = "http://asb.contracts.idata.messages/20111111", IsWrapped = true)]
|
||||
public class DeleteSubscriptionRequest : ConnectedRequest
|
||||
{
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 0)]
|
||||
public long SubscriptionId;
|
||||
|
||||
public DeleteSubscriptionRequest()
|
||||
{
|
||||
}
|
||||
|
||||
public DeleteSubscriptionRequest(long SubscriptionId)
|
||||
{
|
||||
this.SubscriptionId = SubscriptionId;
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.ServiceModel;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[DebuggerStepThrough]
|
||||
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[MessageContract(WrapperName = "DeleteSubscriptionResponse", WrapperNamespace = "http://asb.contracts.idata.messages/20111111", IsWrapped = true)]
|
||||
public class DeleteSubscriptionResponse : ConnectedResponse
|
||||
{
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.ServiceModel;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[DebuggerStepThrough]
|
||||
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[MessageContract(WrapperName = "GetMonitoredItemsRequest", WrapperNamespace = "http://asb.contracts.idata.messages/20111111", IsWrapped = true)]
|
||||
public class GetMonitoredItemsRequest : ConnectedRequest
|
||||
{
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 0)]
|
||||
public long SubscriptionId;
|
||||
|
||||
public GetMonitoredItemsRequest()
|
||||
{
|
||||
}
|
||||
|
||||
public GetMonitoredItemsRequest(long SubscriptionId)
|
||||
{
|
||||
this.SubscriptionId = SubscriptionId;
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.ServiceModel;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[DebuggerStepThrough]
|
||||
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[MessageContract(WrapperName = "GetMonitoredItemsResponse", WrapperNamespace = "http://asb.contracts.idata.messages/20111111", IsWrapped = true)]
|
||||
public class GetMonitoredItemsResponse : ConnectedResponse
|
||||
{
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 0)]
|
||||
[XmlElement("Items")]
|
||||
public MonitoredItem[] Items;
|
||||
|
||||
public GetMonitoredItemsResponse()
|
||||
{
|
||||
}
|
||||
|
||||
public GetMonitoredItemsResponse(MonitoredItem[] Items)
|
||||
{
|
||||
this.Items = Items;
|
||||
}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.ServiceModel;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[DebuggerStepThrough]
|
||||
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[MessageContract(WrapperName = "GetSubscriptionStateRequest", WrapperNamespace = "http://asb.contracts.idata.messages/20111111", IsWrapped = true)]
|
||||
public class GetSubscriptionStateRequest : ConnectedRequest
|
||||
{
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 0)]
|
||||
public long SubscriptionId;
|
||||
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 1)]
|
||||
public ushort StateToGet;
|
||||
|
||||
public GetSubscriptionStateRequest()
|
||||
{
|
||||
}
|
||||
|
||||
public GetSubscriptionStateRequest(long SubscriptionId, ushort StateToGet)
|
||||
{
|
||||
this.SubscriptionId = SubscriptionId;
|
||||
this.StateToGet = StateToGet;
|
||||
}
|
||||
}
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.ServiceModel;
|
||||
using ArchestrAServices.ASBIDataContract;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[DebuggerStepThrough]
|
||||
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[MessageContract(WrapperName = "GetSubscriptionStateResponse", WrapperNamespace = "http://asb.contracts.idata.messages/20111111", IsWrapped = true)]
|
||||
public class GetSubscriptionStateResponse : ConnectedResponse
|
||||
{
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 0)]
|
||||
private Variant State;
|
||||
|
||||
public ArchestrAServices.ASBIDataContract.Variant StateProperty
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ArchestrAServices.ASBIDataContract.Variant
|
||||
{
|
||||
Type = State.Type,
|
||||
Length = State.Length,
|
||||
Payload = State.Payload
|
||||
};
|
||||
}
|
||||
set
|
||||
{
|
||||
State.Type = value.Type;
|
||||
State.Length = value.Length;
|
||||
State.Payload = value.Payload;
|
||||
}
|
||||
}
|
||||
|
||||
public GetSubscriptionStateResponse()
|
||||
{
|
||||
}
|
||||
|
||||
public GetSubscriptionStateResponse(ArchestrAServices.ASBIDataContract.Variant State)
|
||||
{
|
||||
this.State.Type = State.Type;
|
||||
this.State.Length = State.Length;
|
||||
this.State.Payload = State.Payload;
|
||||
}
|
||||
}
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ServiceModel;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
|
||||
[ServiceContract(Namespace = "http://ArchestrAServices.Contract", ConfigurationName = "IASBIData")]
|
||||
public interface IASBIData : IAuthenticateASB
|
||||
{
|
||||
[OperationContract(Action = "http://asb.contracts.idata.messages/20111111:readIn", ReplyAction = "*")]
|
||||
ReadResponse Read(ReadRequest request);
|
||||
|
||||
[OperationContract(Action = "http://asb.contracts.idata.messages/20111111:WriteBasicRequest", ReplyAction = "*")]
|
||||
WriteResponse Write(WriteBasicRequest request);
|
||||
|
||||
[OperationContract(Action = "http://asb.contracts.idata.messages/20111111:writeUserIn", ReplyAction = "*")]
|
||||
WriteUserResponse WriteUser(WriteUserRequest request);
|
||||
|
||||
[OperationContract(Action = "http://asb.contracts.idata.messages/20111111:writeVerifiedIn", ReplyAction = "*")]
|
||||
WriteVerifiedResponse WriteVerified(WriteVerifiedRequest request);
|
||||
|
||||
[OperationContract(Action = "http://asb.contracts.idata.messages/20111111:writeSecuredIn", ReplyAction = "*")]
|
||||
WriteSecuredResponse WriteSecured(WriteSecuredRequest request);
|
||||
|
||||
[OperationContract(Action = "http://asb.contracts.idata.messages/20111111:writeConfirmedIn", ReplyAction = "*")]
|
||||
WriteConfirmedResponse WriteConfirmed(WriteConfirmedRequest request);
|
||||
|
||||
[OperationContract(Action = "http://asb.contracts.idata.messages/20111111:confirmWriteIn", ReplyAction = "*")]
|
||||
ConfirmWriteResponse ConfirmWrite(ConfirmWriteRequest request);
|
||||
|
||||
[OperationContract(Action = "http://asb.contracts.idata.messages/20111111:publishWriteCompleteIn", ReplyAction = "*")]
|
||||
PublishWriteCompleteResponse PublishWriteComplete(PublishWriteCompleteRequest request);
|
||||
|
||||
[OperationContract(Action = "http://asb.contracts.idata.messages/20111111:createSubscriptionIn", ReplyAction = "*")]
|
||||
CreateSubscriptionResponse CreateSubscription(CreateSubscriptionRequest request);
|
||||
|
||||
[OperationContract(Action = "http://asb.contracts.idata.messages/20111111:setSubscriptionStateIn", ReplyAction = "*")]
|
||||
SetSubscriptionStateResponse SetSubscriptionState(SetSubscriptionStateRequest request);
|
||||
|
||||
[OperationContract(Action = "http://asb.contracts.idata.messages/20111111:getSubscriptionStateIn", ReplyAction = "*")]
|
||||
GetSubscriptionStateResponse GetSubscriptionState(GetSubscriptionStateRequest request);
|
||||
|
||||
[OperationContract(Action = "http://asb.contracts.idata.messages/20111111:deleteSubscriptionIn", ReplyAction = "*")]
|
||||
DeleteSubscriptionResponse DeleteSubscription(DeleteSubscriptionRequest request);
|
||||
|
||||
[OperationContract(Action = "http://asb.contracts.idata.messages/20111111:addMonitoredItemsIn", ReplyAction = "*")]
|
||||
AddMonitoredItemsResponse AddMonitoredItems(AddMonitoredItemsRequest request);
|
||||
|
||||
[OperationContract(Action = "http://asb.contracts.idata.messages/20111111:deleteMonitoredItemsIn", ReplyAction = "*")]
|
||||
DeleteMonitoredItemsResponse DeleteMonitoredItems(DeleteMonitoredItemsRequest request);
|
||||
|
||||
[OperationContract(Action = "http://asb.contracts.idata.messages/20111111:getMonitoredItemsIn", ReplyAction = "*")]
|
||||
GetMonitoredItemsResponse GetMonitoredItems(GetMonitoredItemsRequest request);
|
||||
|
||||
[OperationContract(Action = "http://asb.contracts.idata.messages/20111111:publishIn", ReplyAction = "*")]
|
||||
PublishResponse Publish(PublishRequest request);
|
||||
|
||||
[OperationContract(Action = "http://asb.contracts.idata.messages/20111111:registerItemsIn", ReplyAction = "*")]
|
||||
RegisterItemsResponse RegisterItems(RegisterItemsRequest request);
|
||||
|
||||
[OperationContract(Action = "http://asb.contracts.idata.messages/20111111:unregisterItemsIn", ReplyAction = "*")]
|
||||
UnregisterItemsResponse UnregisterItems(UnregisterItemsRequest request);
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ServiceModel;
|
||||
using System.ServiceModel.Channels;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
|
||||
public interface IASBIDataChannel : IASBIData, IAuthenticateASB, IClientChannel, IContextChannel, IChannel, ICommunicationObject, IExtensibleObject<IContextChannel>, IDisposable
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
using ArchestrAServices.ASBIDataContract;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
public interface IData
|
||||
{
|
||||
ArchestrAResult KeepAlive(ConnectionId Id);
|
||||
|
||||
void OnConnect(ConnectionId ConnectionId, ulong Timeout);
|
||||
|
||||
ArchestrAResult Read(out ItemStatus[] Status, out RuntimeValue[] Values, ConnectionId Id, ItemIdentity[] Items);
|
||||
|
||||
ArchestrAResult Write(out ItemStatus[] Status, ConnectionId Id, ItemIdentity[] Items, WriteValue[] Values, uint WriteHandle);
|
||||
|
||||
ArchestrAResult WriteUser(out ItemStatus[] Status, ConnectionId Id, ItemIdentity[] Items, WriteValue[] Values, UserToken User, uint WriteHandle);
|
||||
|
||||
ArchestrAResult WriteVerified(out ItemStatus[] Status, ConnectionId Id, ItemIdentity[] Items, WriteValue[] Values, UserToken User, UserToken Supervisor, uint WriteHandle);
|
||||
|
||||
ArchestrAResult WriteSecured(out ItemStatus[] Status, ConnectionId Id, ItemIdentity[] Items, WriteValue[] Values, UserToken User, uint WriteHandle);
|
||||
|
||||
ArchestrAResult WriteConfirmed(out WriteValue ValueReceived, out long WriteToken, ConnectionId Id, ItemIdentity Item, WriteValue Value, UserToken User, UserToken Supervisor);
|
||||
|
||||
ArchestrAResult ConfirmWrite(ConnectionId Id, ItemIdentity Item, long WriteToken, WriteValue Value, UserToken User, UserToken Supervisor, uint WriteHandle);
|
||||
|
||||
ArchestrAResult PublishWriteComplete(out ItemWriteComplete[] CompleteWrites, ConnectionId Id);
|
||||
|
||||
ArchestrAResult CreateSubscription(out long SubscriptionId, ConnectionId Id, long MaxQueueSize, ulong SampleInterval);
|
||||
|
||||
ArchestrAResult SetSubscriptionState(ConnectionId Id, long SubscriptionId, ArchestrAServices.ASBIDataContract.Variant NewState, ushort StateToChange);
|
||||
|
||||
ArchestrAResult GetSubscriptionState(out ArchestrAServices.ASBIDataContract.Variant State, ConnectionId Id, long SubscriptionId, ushort StateToGet);
|
||||
|
||||
ArchestrAResult DeleteSubscription(ConnectionId Id, long SubscriptionId);
|
||||
|
||||
ArchestrAResult AddMonitoredItems(out ItemStatus[] Status, out ItemRegistration[] ItemCapabilities, ConnectionId Id, long SubscriptionId, MonitoredItem[] Items, byte RequireId);
|
||||
|
||||
ArchestrAResult DeleteMonitoredItems(out ItemStatus[] Status, ConnectionId Id, long SubscriptionId, MonitoredItem[] Items);
|
||||
|
||||
ArchestrAResult GetMonitoredItems(out MonitoredItem[] Items, ConnectionId Id, long SubscriptionId);
|
||||
|
||||
ArchestrAResult Publish(out ItemStatus[] Status, out MonitoredItemValue[] Values, ConnectionId Id, long SubscriptionId);
|
||||
|
||||
ArchestrAResult RegisterItems(out ItemStatus[] Status, out ItemRegistration[] ItemCapabilities, ConnectionId Id, ItemIdentity[] Items, byte RequireId, byte RegisterOnly);
|
||||
|
||||
ArchestrAResult UnregisterItems(out ItemStatus[] Status, ConnectionId Id, ItemIdentity[] Items);
|
||||
|
||||
void OnDisconnect(ConnectionId Id);
|
||||
}
|
||||
+142
@@ -0,0 +1,142 @@
|
||||
using System;
|
||||
using ArchestrAServices.ASBIDataContract;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
public static class IDataASBEnumFactory
|
||||
{
|
||||
public static DataType IntToDataType(ushort iValue)
|
||||
{
|
||||
return ASBEnumFactory.IntToDataType(iValue);
|
||||
}
|
||||
|
||||
public static ushort DataTypeToInt(DataType eValue)
|
||||
{
|
||||
return ASBEnumFactory.DataTypeToInt(eValue);
|
||||
}
|
||||
|
||||
public static DataQualityType IntToDataQualityType(ushort iValue)
|
||||
{
|
||||
try
|
||||
{
|
||||
return (DataQualityType)iValue;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return DataQualityType.Uncertain;
|
||||
}
|
||||
}
|
||||
|
||||
public static ushort DataQualityTypeToInt(DataQualityType eValue)
|
||||
{
|
||||
return (ushort)eValue;
|
||||
}
|
||||
|
||||
public static ItemIdentityType IntToItemIdentityType(ushort iValue)
|
||||
{
|
||||
try
|
||||
{
|
||||
return (ItemIdentityType)iValue;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return ItemIdentityType.Id;
|
||||
}
|
||||
}
|
||||
|
||||
public static ushort ItemIdentityTypeToInt(ItemIdentityType eValue)
|
||||
{
|
||||
return (ushort)eValue;
|
||||
}
|
||||
|
||||
public static ItemReferenceType IntToItemReferenceType(ushort iValue)
|
||||
{
|
||||
try
|
||||
{
|
||||
return (ItemReferenceType)iValue;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return ItemReferenceType.None;
|
||||
}
|
||||
}
|
||||
|
||||
public static ushort ItemReferenceTypeToInt(ItemReferenceType eValue)
|
||||
{
|
||||
return (ushort)eValue;
|
||||
}
|
||||
|
||||
public static SubscriptionStateType IntToSubscriptionStateType(ushort iValue)
|
||||
{
|
||||
try
|
||||
{
|
||||
return (SubscriptionStateType)iValue;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return SubscriptionStateType.SubsUnknown;
|
||||
}
|
||||
}
|
||||
|
||||
public static ushort SubscriptionStateTypeToInt(SubscriptionStateType eValue)
|
||||
{
|
||||
return (ushort)eValue;
|
||||
}
|
||||
|
||||
public static WriteCapabilityType IntToWriteCapabilityType(ushort iValue)
|
||||
{
|
||||
try
|
||||
{
|
||||
return (WriteCapabilityType)iValue;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return WriteCapabilityType.WriteUnknown;
|
||||
}
|
||||
}
|
||||
|
||||
public static ushort WriteCapabilityTypeToInt(WriteCapabilityType eValue)
|
||||
{
|
||||
return (ushort)eValue;
|
||||
}
|
||||
|
||||
public static OpcQualityMask IntToOpcQualityMask(ushort iValue)
|
||||
{
|
||||
try
|
||||
{
|
||||
return (OpcQualityMask)iValue;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return OpcQualityMask.MAGELLAN_QUALITY_INITIALIZING;
|
||||
}
|
||||
}
|
||||
|
||||
public static ushort OpcQualityMaskToInt(OpcQualityMask eValue)
|
||||
{
|
||||
return (ushort)eValue;
|
||||
}
|
||||
|
||||
public static MonitoredItem MakeDeleteMonitoredItem(ItemIdentity Item)
|
||||
{
|
||||
return new MonitoredItem
|
||||
{
|
||||
Item = Item,
|
||||
SampleInterval = 0uL,
|
||||
Active = false,
|
||||
TimeDeadband = 0uL,
|
||||
ValueDeadband = new ArchestrAServices.ASBIDataContract.Variant
|
||||
{
|
||||
Type = DataTypeToInt(DataType.TypeUnknown),
|
||||
Length = 0,
|
||||
Payload = null
|
||||
},
|
||||
UserData = new ArchestrAServices.ASBIDataContract.Variant
|
||||
{
|
||||
Type = DataTypeToInt(DataType.TypeUnknown),
|
||||
Length = 0,
|
||||
Payload = null
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
+261
@@ -0,0 +1,261 @@
|
||||
#define TRACE
|
||||
using System;
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Xml.Serialization;
|
||||
using ArchestrAServices.Common;
|
||||
using ArchestrAServices.Contract;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[Serializable]
|
||||
[GeneratedCode("System.Xml", "4.0.30319.18054")]
|
||||
[DebuggerStepThrough]
|
||||
[XmlType(Namespace = "http://asb.contracts.idata.data/20111111")]
|
||||
public struct ItemIdentity : IASBCustomSerializableType
|
||||
{
|
||||
private ushort typeField;
|
||||
|
||||
private ushort referenceTypeField;
|
||||
|
||||
private string nameField;
|
||||
|
||||
private string contextNameField;
|
||||
|
||||
private ulong idField;
|
||||
|
||||
private bool idFieldSpecified;
|
||||
|
||||
public ushort Type
|
||||
{
|
||||
get
|
||||
{
|
||||
return typeField;
|
||||
}
|
||||
set
|
||||
{
|
||||
typeField = value;
|
||||
}
|
||||
}
|
||||
|
||||
public ushort ReferenceType
|
||||
{
|
||||
get
|
||||
{
|
||||
return referenceTypeField;
|
||||
}
|
||||
set
|
||||
{
|
||||
referenceTypeField = value;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlElement(IsNullable = true)]
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return nameField;
|
||||
}
|
||||
set
|
||||
{
|
||||
nameField = value;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlElement(IsNullable = true)]
|
||||
public string ContextName
|
||||
{
|
||||
get
|
||||
{
|
||||
return contextNameField;
|
||||
}
|
||||
set
|
||||
{
|
||||
contextNameField = value;
|
||||
}
|
||||
}
|
||||
|
||||
public ulong Id
|
||||
{
|
||||
get
|
||||
{
|
||||
return idField;
|
||||
}
|
||||
set
|
||||
{
|
||||
idField = value;
|
||||
IdSpecified = true;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public bool IdSpecified
|
||||
{
|
||||
get
|
||||
{
|
||||
return idFieldSpecified;
|
||||
}
|
||||
set
|
||||
{
|
||||
idFieldSpecified = value;
|
||||
}
|
||||
}
|
||||
|
||||
public void WriteToStream(BinaryWriter writer)
|
||||
{
|
||||
if (writer == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
writer.Write(typeField);
|
||||
writer.Write(referenceTypeField);
|
||||
if (!string.IsNullOrEmpty(nameField))
|
||||
{
|
||||
byte[] bytes = Encoding.Unicode.GetBytes(nameField);
|
||||
writer.Write((uint)bytes.Length);
|
||||
writer.Write(bytes);
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.Write(0u);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(contextNameField))
|
||||
{
|
||||
byte[] bytes2 = Encoding.Unicode.GetBytes(contextNameField);
|
||||
writer.Write((uint)bytes2.Length);
|
||||
writer.Write(bytes2);
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.Write(0u);
|
||||
}
|
||||
writer.Write(Id);
|
||||
writer.Write(IdSpecified);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SvcTrace.DiagDiagnostics.TraceEvent(TraceEventType.Error, 0, $" ItemIdentity: WriteTo. Exception raised {ex.Message} \n Stack Trace: {ex.StackTrace}");
|
||||
}
|
||||
}
|
||||
|
||||
public void InitializeFromStream(BinaryReader reader)
|
||||
{
|
||||
if (!MemoryStreamHelper.ValidateStream(reader))
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
typeField = reader.ReadUInt16();
|
||||
referenceTypeField = reader.ReadUInt16();
|
||||
int num = reader.ReadInt32();
|
||||
if (num > 0)
|
||||
{
|
||||
byte[] bytes = reader.ReadBytes(num);
|
||||
nameField = Encoding.Unicode.GetString(bytes);
|
||||
}
|
||||
else
|
||||
{
|
||||
nameField = string.Empty;
|
||||
}
|
||||
num = reader.ReadInt32();
|
||||
if (num > 0)
|
||||
{
|
||||
byte[] bytes2 = reader.ReadBytes(num);
|
||||
contextNameField = Encoding.Unicode.GetString(bytes2);
|
||||
}
|
||||
else
|
||||
{
|
||||
contextNameField = string.Empty;
|
||||
}
|
||||
idField = reader.ReadUInt64();
|
||||
idFieldSpecified = reader.ReadBoolean();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SvcTrace.DiagDiagnostics.TraceEvent(TraceEventType.Error, 0, $" ItemIdentity: InitializeFrom. Exception raised {ex.Message} \n Stack Trace: {ex.StackTrace}");
|
||||
}
|
||||
}
|
||||
|
||||
public object InitializeArrayFromStream(BinaryReader reader, int arrayCnt)
|
||||
{
|
||||
object result = null;
|
||||
if (MemoryStreamHelper.ValidateStream(reader, arrayCnt))
|
||||
{
|
||||
try
|
||||
{
|
||||
ItemIdentity[] array = new ItemIdentity[arrayCnt];
|
||||
for (int i = 0; i < arrayCnt; i++)
|
||||
{
|
||||
InitializeFrom(reader, ref array[i]);
|
||||
}
|
||||
result = array;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SvcTrace.DiagDiagnostics.TraceEvent(TraceEventType.Error, 0, $" ItemIdentity: InitializeFromArray. Exception raised {ex.Message} \n Stack Trace: {ex.StackTrace}");
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public void WriteArrayToStream(object graph, ref BinaryWriter bw)
|
||||
{
|
||||
if (graph == null || bw == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
if (graph is ItemIdentity[] array)
|
||||
{
|
||||
bw.Write(array.Length);
|
||||
ItemIdentity[] array2 = array;
|
||||
foreach (ItemIdentity itemIdentity in array2)
|
||||
{
|
||||
itemIdentity.WriteToStream(bw);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SvcTrace.DiagDiagnostics.TraceEvent(TraceEventType.Error, 0, $" ItemIdentity: WriteArrayTo. Exception raised {ex.Message} \n Stack Trace: {ex.StackTrace}");
|
||||
}
|
||||
}
|
||||
|
||||
private static void InitializeFrom(BinaryReader reader, ref ItemIdentity result)
|
||||
{
|
||||
if (MemoryStreamHelper.ValidateStream(reader))
|
||||
{
|
||||
result.typeField = reader.ReadUInt16();
|
||||
result.referenceTypeField = reader.ReadUInt16();
|
||||
int num = reader.ReadInt32();
|
||||
if (num > 0)
|
||||
{
|
||||
byte[] bytes = reader.ReadBytes(num);
|
||||
result.nameField = Encoding.Unicode.GetString(bytes);
|
||||
}
|
||||
else
|
||||
{
|
||||
result.nameField = string.Empty;
|
||||
}
|
||||
num = reader.ReadInt32();
|
||||
if (num > 0)
|
||||
{
|
||||
byte[] bytes2 = reader.ReadBytes(num);
|
||||
result.contextNameField = Encoding.Unicode.GetString(bytes2);
|
||||
}
|
||||
else
|
||||
{
|
||||
result.contextNameField = string.Empty;
|
||||
}
|
||||
result.idField = reader.ReadUInt64();
|
||||
result.idFieldSpecified = reader.ReadBoolean();
|
||||
}
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[Serializable]
|
||||
[GeneratedCode("System.Xml", "4.0.30319.233")]
|
||||
[XmlType(Namespace = "http://asb.contracts.idata.data/20111111")]
|
||||
public enum ItemIdentityType
|
||||
{
|
||||
Name,
|
||||
Id,
|
||||
NameAndId
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[Serializable]
|
||||
[GeneratedCode("System.Xml", "4.0.30319.233")]
|
||||
[XmlType(Namespace = "http://asb.contracts.idata.data/20111111")]
|
||||
public enum ItemReferenceType
|
||||
{
|
||||
None,
|
||||
Absolute,
|
||||
Hierarchical,
|
||||
Relative
|
||||
}
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
using System;
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Diagnostics;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[Serializable]
|
||||
[GeneratedCode("System.Xml", "4.0.30319.18054")]
|
||||
[DebuggerStepThrough]
|
||||
[XmlType(Namespace = "http://asb.contracts.idata.data/20111111")]
|
||||
public struct ItemRegistration
|
||||
{
|
||||
private ulong idField;
|
||||
|
||||
private bool idFieldSpecified;
|
||||
|
||||
private ushort writeCapabilityField;
|
||||
|
||||
private bool writeCapabilityFieldSpecified;
|
||||
|
||||
public ulong Id
|
||||
{
|
||||
get
|
||||
{
|
||||
return idField;
|
||||
}
|
||||
set
|
||||
{
|
||||
idField = value;
|
||||
IdSpecified = true;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public bool IdSpecified
|
||||
{
|
||||
get
|
||||
{
|
||||
return idFieldSpecified;
|
||||
}
|
||||
set
|
||||
{
|
||||
idFieldSpecified = value;
|
||||
}
|
||||
}
|
||||
|
||||
public ushort WriteCapability
|
||||
{
|
||||
get
|
||||
{
|
||||
return writeCapabilityField;
|
||||
}
|
||||
set
|
||||
{
|
||||
writeCapabilityField = value;
|
||||
WriteCapabilitySpecified = true;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public bool WriteCapabilitySpecified
|
||||
{
|
||||
get
|
||||
{
|
||||
return writeCapabilityFieldSpecified;
|
||||
}
|
||||
set
|
||||
{
|
||||
writeCapabilityFieldSpecified = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
+151
@@ -0,0 +1,151 @@
|
||||
#define TRACE
|
||||
using System;
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Xml.Serialization;
|
||||
using ArchestrAServices.Common;
|
||||
using ArchestrAServices.Contract;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[Serializable]
|
||||
[GeneratedCode("System.Xml", "4.0.30319.18054")]
|
||||
[DebuggerStepThrough]
|
||||
[XmlType(Namespace = "http://asb.contracts.idata.data/20111111")]
|
||||
public struct ItemStatus : IASBCustomSerializableType
|
||||
{
|
||||
private ItemIdentity itemField;
|
||||
|
||||
private ushort errorCodeField;
|
||||
|
||||
private bool errorCodeFieldSpecified;
|
||||
|
||||
public ItemIdentity Item
|
||||
{
|
||||
get
|
||||
{
|
||||
return itemField;
|
||||
}
|
||||
set
|
||||
{
|
||||
itemField = value;
|
||||
}
|
||||
}
|
||||
|
||||
public ushort ErrorCode
|
||||
{
|
||||
get
|
||||
{
|
||||
return errorCodeField;
|
||||
}
|
||||
set
|
||||
{
|
||||
errorCodeField = value;
|
||||
ErrorCodeSpecified = true;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public bool ErrorCodeSpecified
|
||||
{
|
||||
get
|
||||
{
|
||||
return errorCodeFieldSpecified;
|
||||
}
|
||||
set
|
||||
{
|
||||
errorCodeFieldSpecified = value;
|
||||
}
|
||||
}
|
||||
|
||||
public void WriteToStream(BinaryWriter writer)
|
||||
{
|
||||
if (writer != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
itemField.WriteToStream(writer);
|
||||
writer.Write(errorCodeField);
|
||||
writer.Write(errorCodeFieldSpecified);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SvcTrace.DiagDiagnostics.TraceEvent(TraceEventType.Error, 0, $" ItemStatus: WriteTo. Exception raised {ex.Message} \n Stack Trace: {ex.StackTrace}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void InitializeFromStream(BinaryReader reader)
|
||||
{
|
||||
if (MemoryStreamHelper.ValidateStream(reader))
|
||||
{
|
||||
try
|
||||
{
|
||||
itemField.InitializeFromStream(reader);
|
||||
errorCodeField = reader.ReadUInt16();
|
||||
errorCodeFieldSpecified = reader.ReadBoolean();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SvcTrace.DiagDiagnostics.TraceEvent(TraceEventType.Error, 0, $" ItemStatus: InitializeFrom. Exception raised {ex.Message} \n Stack Trace: {ex.StackTrace}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public object InitializeArrayFromStream(BinaryReader reader, int arrayCnt)
|
||||
{
|
||||
object result = null;
|
||||
if (MemoryStreamHelper.ValidateStream(reader, arrayCnt))
|
||||
{
|
||||
try
|
||||
{
|
||||
ItemStatus[] array = new ItemStatus[arrayCnt];
|
||||
for (int i = 0; i < arrayCnt; i++)
|
||||
{
|
||||
InitializeFrom(reader, ref array[i]);
|
||||
}
|
||||
result = array;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SvcTrace.DiagDiagnostics.TraceEvent(TraceEventType.Error, 0, $" ItemStatus: InitializeFromArray. Exception raised {ex.Message} \n Stack Trace: {ex.StackTrace}");
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public void WriteArrayToStream(object graph, ref BinaryWriter bw)
|
||||
{
|
||||
if (graph == null || bw == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
if (graph is ItemStatus[] array)
|
||||
{
|
||||
bw.Write(array.Length);
|
||||
ItemStatus[] array2 = array;
|
||||
foreach (ItemStatus itemStatus in array2)
|
||||
{
|
||||
itemStatus.WriteToStream(bw);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SvcTrace.DiagDiagnostics.TraceEvent(TraceEventType.Error, 0, $" ItemStatus: WriteArrayTo. Exception raised {ex.Message} \n Stack Trace: {ex.StackTrace}");
|
||||
}
|
||||
}
|
||||
|
||||
private static void InitializeFrom(BinaryReader reader, ref ItemStatus result)
|
||||
{
|
||||
if (MemoryStreamHelper.ValidateStream(reader))
|
||||
{
|
||||
result.itemField.InitializeFromStream(reader);
|
||||
result.errorCodeField = reader.ReadUInt16();
|
||||
result.errorCodeFieldSpecified = reader.ReadBoolean();
|
||||
}
|
||||
}
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
using System;
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Diagnostics;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[Serializable]
|
||||
[GeneratedCode("System.Xml", "4.0.30319.18054")]
|
||||
[DebuggerStepThrough]
|
||||
[XmlType(Namespace = "http://asb.contracts.idata.data/20111111")]
|
||||
public struct ItemWriteComplete
|
||||
{
|
||||
private ItemStatus[] statusField;
|
||||
|
||||
private uint writeHandleField;
|
||||
|
||||
private bool writeHandleFieldSpecified;
|
||||
|
||||
[XmlElement("Status")]
|
||||
public ItemStatus[] Status
|
||||
{
|
||||
get
|
||||
{
|
||||
return statusField;
|
||||
}
|
||||
set
|
||||
{
|
||||
statusField = value;
|
||||
}
|
||||
}
|
||||
|
||||
public uint WriteHandle
|
||||
{
|
||||
get
|
||||
{
|
||||
return writeHandleField;
|
||||
}
|
||||
set
|
||||
{
|
||||
writeHandleField = value;
|
||||
WriteHandleSpecified = true;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public bool WriteHandleSpecified
|
||||
{
|
||||
get
|
||||
{
|
||||
return writeHandleFieldSpecified;
|
||||
}
|
||||
set
|
||||
{
|
||||
writeHandleFieldSpecified = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
#define TRACE
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using ArchestrAServices.Common;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
public class MemoryStreamHelper
|
||||
{
|
||||
public static bool ValidateStream(BinaryReader reader)
|
||||
{
|
||||
if (reader == null || reader.BaseStream == null || reader.BaseStream.Length <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool ValidateStream(BinaryReader reader, int arrayCnt)
|
||||
{
|
||||
bool result = false;
|
||||
if (ValidateStream(reader))
|
||||
{
|
||||
reader.BaseStream.Position = 0L;
|
||||
int num = reader.ReadInt32();
|
||||
if (num != arrayCnt)
|
||||
{
|
||||
SvcTrace.DiagDiagnostics.TraceEvent(TraceEventType.Warning, 0, $" MemoryStreamHelper: ValidateStream. Array count{arrayCnt}, doesn't match with the actual count {num}");
|
||||
}
|
||||
else
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
+144
@@ -0,0 +1,144 @@
|
||||
using System;
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Diagnostics;
|
||||
using System.Xml.Serialization;
|
||||
using ArchestrAServices.ASBIDataContract;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[Serializable]
|
||||
[GeneratedCode("System.Xml", "4.0.30319.18054")]
|
||||
[DebuggerStepThrough]
|
||||
[XmlType(Namespace = "http://asb.contracts.idata.data/20111111")]
|
||||
public struct MonitoredItem
|
||||
{
|
||||
private ItemIdentity itemField;
|
||||
|
||||
private ulong sampleIntervalField;
|
||||
|
||||
private bool activeField;
|
||||
|
||||
private bool activeFieldSpecified;
|
||||
|
||||
private ulong timeDeadbandField;
|
||||
|
||||
private bool timeDeadbandFieldSpecified;
|
||||
|
||||
private Variant valueDeadbandField;
|
||||
|
||||
private Variant userDataField;
|
||||
|
||||
public ItemIdentity Item
|
||||
{
|
||||
get
|
||||
{
|
||||
return itemField;
|
||||
}
|
||||
set
|
||||
{
|
||||
itemField = value;
|
||||
}
|
||||
}
|
||||
|
||||
public ulong SampleInterval
|
||||
{
|
||||
get
|
||||
{
|
||||
return sampleIntervalField;
|
||||
}
|
||||
set
|
||||
{
|
||||
sampleIntervalField = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool Active
|
||||
{
|
||||
get
|
||||
{
|
||||
return activeField;
|
||||
}
|
||||
set
|
||||
{
|
||||
activeField = value;
|
||||
ActiveSpecified = true;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public bool ActiveSpecified
|
||||
{
|
||||
get
|
||||
{
|
||||
return activeFieldSpecified;
|
||||
}
|
||||
set
|
||||
{
|
||||
activeFieldSpecified = value;
|
||||
}
|
||||
}
|
||||
|
||||
public ulong TimeDeadband
|
||||
{
|
||||
get
|
||||
{
|
||||
return timeDeadbandField;
|
||||
}
|
||||
set
|
||||
{
|
||||
timeDeadbandField = value;
|
||||
TimeDeadbandSpecified = true;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public bool TimeDeadbandSpecified
|
||||
{
|
||||
get
|
||||
{
|
||||
return timeDeadbandFieldSpecified;
|
||||
}
|
||||
set
|
||||
{
|
||||
timeDeadbandFieldSpecified = value;
|
||||
}
|
||||
}
|
||||
|
||||
public ArchestrAServices.ASBIDataContract.Variant ValueDeadband
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ArchestrAServices.ASBIDataContract.Variant
|
||||
{
|
||||
Type = valueDeadbandField.Type,
|
||||
Length = valueDeadbandField.Length,
|
||||
Payload = valueDeadbandField.Payload
|
||||
};
|
||||
}
|
||||
set
|
||||
{
|
||||
valueDeadbandField.Type = value.Type;
|
||||
valueDeadbandField.Length = value.Length;
|
||||
valueDeadbandField.Payload = value.Payload;
|
||||
}
|
||||
}
|
||||
|
||||
public ArchestrAServices.ASBIDataContract.Variant UserData
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ArchestrAServices.ASBIDataContract.Variant
|
||||
{
|
||||
Type = userDataField.Type,
|
||||
Length = userDataField.Length,
|
||||
Payload = userDataField.Payload
|
||||
};
|
||||
}
|
||||
set
|
||||
{
|
||||
userDataField.Type = value.Type;
|
||||
userDataField.Length = value.Length;
|
||||
userDataField.Payload = value.Payload;
|
||||
}
|
||||
}
|
||||
}
|
||||
+136
@@ -0,0 +1,136 @@
|
||||
#define TRACE
|
||||
using System;
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Xml.Serialization;
|
||||
using ArchestrAServices.ASBIDataContract;
|
||||
using ArchestrAServices.Common;
|
||||
using ArchestrAServices.Contract;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[Serializable]
|
||||
[GeneratedCode("System.Xml", "4.0.30319.18054")]
|
||||
[DebuggerStepThrough]
|
||||
[XmlType(Namespace = "http://asb.contracts.idata.data/20111111")]
|
||||
public struct MonitoredItemValue : IASBCustomSerializableType
|
||||
{
|
||||
private ItemIdentity itemField;
|
||||
|
||||
private RuntimeValue valueField;
|
||||
|
||||
private Variant userDataField;
|
||||
|
||||
public ItemIdentity Item
|
||||
{
|
||||
get
|
||||
{
|
||||
return itemField;
|
||||
}
|
||||
set
|
||||
{
|
||||
itemField = value;
|
||||
}
|
||||
}
|
||||
|
||||
public RuntimeValue Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return valueField;
|
||||
}
|
||||
set
|
||||
{
|
||||
valueField = value;
|
||||
}
|
||||
}
|
||||
|
||||
public ArchestrAServices.ASBIDataContract.Variant UserData
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ArchestrAServices.ASBIDataContract.Variant
|
||||
{
|
||||
Type = userDataField.Type,
|
||||
Length = userDataField.Length,
|
||||
Payload = userDataField.Payload
|
||||
};
|
||||
}
|
||||
set
|
||||
{
|
||||
userDataField.Type = value.Type;
|
||||
userDataField.Length = value.Length;
|
||||
userDataField.Payload = value.Payload;
|
||||
}
|
||||
}
|
||||
|
||||
public void WriteToStream(BinaryWriter writer)
|
||||
{
|
||||
if (writer != null)
|
||||
{
|
||||
itemField.WriteToStream(writer);
|
||||
valueField.WriteToStream(writer);
|
||||
userDataField.WriteToStream(writer);
|
||||
}
|
||||
}
|
||||
|
||||
public void InitializeFromStream(BinaryReader reader)
|
||||
{
|
||||
if (MemoryStreamHelper.ValidateStream(reader))
|
||||
{
|
||||
itemField.InitializeFromStream(reader);
|
||||
valueField.InitializeFromStream(reader);
|
||||
userDataField.InitializeFromStream(reader);
|
||||
}
|
||||
}
|
||||
|
||||
public object InitializeArrayFromStream(BinaryReader reader, int arrayCnt)
|
||||
{
|
||||
object result = null;
|
||||
if (MemoryStreamHelper.ValidateStream(reader, arrayCnt))
|
||||
{
|
||||
MonitoredItemValue[] array = new MonitoredItemValue[arrayCnt];
|
||||
for (int i = 0; i < arrayCnt; i++)
|
||||
{
|
||||
InitializeFrom(reader, ref array[i]);
|
||||
}
|
||||
result = array;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public void WriteArrayToStream(object graph, ref BinaryWriter bw)
|
||||
{
|
||||
if (graph == null || bw == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
if (graph is MonitoredItemValue[] array)
|
||||
{
|
||||
bw.Write(array.Length);
|
||||
MonitoredItemValue[] array2 = array;
|
||||
foreach (MonitoredItemValue monitoredItemValue in array2)
|
||||
{
|
||||
monitoredItemValue.WriteToStream(bw);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SvcTrace.DiagDiagnostics.TraceEvent(TraceEventType.Error, 0, $" MonitoredItemValue: WriteArrayTo. Exception raised {ex.Message} \n Stack Trace: {ex.StackTrace}");
|
||||
}
|
||||
}
|
||||
|
||||
private static void InitializeFrom(BinaryReader reader, ref MonitoredItemValue result)
|
||||
{
|
||||
if (MemoryStreamHelper.ValidateStream(reader))
|
||||
{
|
||||
result.itemField.InitializeFromStream(reader);
|
||||
result.valueField.InitializeFromStream(reader);
|
||||
result.userDataField.InitializeFromStream(reader);
|
||||
}
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
public enum OpcQualityMask : ushort
|
||||
{
|
||||
OPC_LIMIT_OK = 0,
|
||||
OPC_QUALITY_BAD = 0,
|
||||
OPC_LIMIT_LOW = 1,
|
||||
OPC_LIMIT_HIGH = 2,
|
||||
OPC_LIMIT_MASK = 3,
|
||||
OPC_LIMIT_CONST = 3,
|
||||
OPC_QUALITY_CONFIG_ERROR = 4,
|
||||
OPC_QUALITY_NOT_CONNECTED = 8,
|
||||
OPC_QUALITY_DEVICE_FAILURE = 12,
|
||||
OPC_QUALITY_SENSOR_FAILURE = 16,
|
||||
OPC_QUALITY_LAST_KNOWN = 20,
|
||||
OPC_QUALITY_COMM_FAILURE = 24,
|
||||
OPC_QUALITY_OUT_OF_SERVICE = 28,
|
||||
MAGELLAN_QUALITY_INITIALIZING = 32,
|
||||
OPC_QUALITY_UNCERTAIN = 64,
|
||||
OPC_QUALITY_LAST_USABLE = 68,
|
||||
OPC_QUALITY_SENSOR_CAL = 80,
|
||||
OPC_QUALITY_EGU_EXCEEDED = 84,
|
||||
OPC_QUALITY_SUB_NORMAL = 88,
|
||||
OPC_QUALITY_GOOD = 192,
|
||||
OPC_QUALITY_MASK = 192,
|
||||
OPC_QUALITY_LOCAL_OVERRIDE = 216,
|
||||
OPC_STATUS_MASK = 252
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.ServiceModel;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[DebuggerStepThrough]
|
||||
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[MessageContract(WrapperName = "PublishRequest", WrapperNamespace = "http://asb.contracts.idata.messages/20111111", IsWrapped = true)]
|
||||
public class PublishRequest : ConnectedRequest
|
||||
{
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 0)]
|
||||
public long SubscriptionId;
|
||||
|
||||
public PublishRequest()
|
||||
{
|
||||
}
|
||||
|
||||
public PublishRequest(long SubscriptionId)
|
||||
{
|
||||
this.SubscriptionId = SubscriptionId;
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.ServiceModel;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[DebuggerStepThrough]
|
||||
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[MessageContract(WrapperName = "PublishResponse", WrapperNamespace = "http://asb.contracts.idata.messages/20111111", IsWrapped = true)]
|
||||
public class PublishResponse : ConnectedResponse
|
||||
{
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 0)]
|
||||
[XmlElement("Status")]
|
||||
public ItemStatus[] Status;
|
||||
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 1)]
|
||||
[XmlElement("Values")]
|
||||
public MonitoredItemValue[] Values;
|
||||
|
||||
public PublishResponse()
|
||||
{
|
||||
}
|
||||
|
||||
public PublishResponse(ItemStatus[] Status, MonitoredItemValue[] Values)
|
||||
{
|
||||
this.Status = Status;
|
||||
this.Values = Values;
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.ServiceModel;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[DebuggerStepThrough]
|
||||
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[MessageContract(WrapperName = "PublishWriteCompleteRequest", WrapperNamespace = "http://asb.contracts.idata.messages/20111111", IsWrapped = true)]
|
||||
public class PublishWriteCompleteRequest : ConnectedRequest
|
||||
{
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.ServiceModel;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[DebuggerStepThrough]
|
||||
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[MessageContract(WrapperName = "PublishWriteCompleteResponse", WrapperNamespace = "http://asb.contracts.idata.messages/20111111", IsWrapped = true)]
|
||||
public class PublishWriteCompleteResponse : ConnectedResponse
|
||||
{
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 0)]
|
||||
[XmlElement("CompleteWrites")]
|
||||
public ItemWriteComplete[] CompleteWrites;
|
||||
|
||||
public PublishWriteCompleteResponse()
|
||||
{
|
||||
}
|
||||
|
||||
public PublishWriteCompleteResponse(ItemWriteComplete[] CompleteWrites)
|
||||
{
|
||||
this.CompleteWrites = CompleteWrites;
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.ServiceModel;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[DebuggerStepThrough]
|
||||
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[MessageContract(WrapperName = "ReadRequest", WrapperNamespace = "http://asb.contracts.idata.messages/20111111", IsWrapped = true)]
|
||||
public class ReadRequest : ConnectedRequest
|
||||
{
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 0)]
|
||||
[XmlElement("Items")]
|
||||
public ItemIdentity[] Items;
|
||||
|
||||
public ReadRequest()
|
||||
{
|
||||
}
|
||||
|
||||
public ReadRequest(ItemIdentity[] Items)
|
||||
{
|
||||
this.Items = Items;
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.ServiceModel;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[DebuggerStepThrough]
|
||||
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[MessageContract(WrapperName = "ReadResponse", WrapperNamespace = "http://asb.contracts.idata.messages/20111111", IsWrapped = true)]
|
||||
public class ReadResponse : ConnectedResponse
|
||||
{
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 0)]
|
||||
[XmlElement("Status")]
|
||||
public ItemStatus[] Status;
|
||||
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 1)]
|
||||
[XmlElement("Values")]
|
||||
public RuntimeValue[] Values;
|
||||
|
||||
public ReadResponse()
|
||||
{
|
||||
}
|
||||
|
||||
public ReadResponse(ItemStatus[] Status, RuntimeValue[] Values)
|
||||
{
|
||||
this.Status = Status;
|
||||
this.Values = Values;
|
||||
}
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.ServiceModel;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[DebuggerStepThrough]
|
||||
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[MessageContract(WrapperName = "RegisterItemsRequest", WrapperNamespace = "http://asb.contracts.idata.messages/20111111", IsWrapped = true)]
|
||||
public class RegisterItemsRequest : ConnectedRequest
|
||||
{
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 0)]
|
||||
[XmlElement("Items")]
|
||||
public ItemIdentity[] Items;
|
||||
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 1)]
|
||||
public bool RequireId;
|
||||
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 2)]
|
||||
public bool RegisterOnly;
|
||||
|
||||
public RegisterItemsRequest()
|
||||
{
|
||||
}
|
||||
|
||||
public RegisterItemsRequest(ItemIdentity[] Items, bool RequireId, bool RegisterOnly)
|
||||
{
|
||||
this.Items = Items;
|
||||
this.RequireId = RequireId;
|
||||
this.RegisterOnly = RegisterOnly;
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.ServiceModel;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[DebuggerStepThrough]
|
||||
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[MessageContract(WrapperName = "RegisterItemsResponse", WrapperNamespace = "http://asb.contracts.idata.messages/20111111", IsWrapped = true)]
|
||||
public class RegisterItemsResponse : ConnectedResponse
|
||||
{
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 0)]
|
||||
[XmlElement("Status")]
|
||||
public ItemStatus[] Status;
|
||||
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 1)]
|
||||
[XmlElement("ItemCapabilities")]
|
||||
public ItemRegistration[] ItemCapabilities;
|
||||
|
||||
public RegisterItemsResponse()
|
||||
{
|
||||
}
|
||||
|
||||
public RegisterItemsResponse(ItemStatus[] Status, ItemRegistration[] ItemCapabilities)
|
||||
{
|
||||
this.Status = Status;
|
||||
this.ItemCapabilities = ItemCapabilities;
|
||||
}
|
||||
}
|
||||
+176
@@ -0,0 +1,176 @@
|
||||
#define TRACE
|
||||
using System;
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Xml.Serialization;
|
||||
using ArchestrAServices.ASBIDataContract;
|
||||
using ArchestrAServices.Common;
|
||||
using ArchestrAServices.Contract;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[Serializable]
|
||||
[GeneratedCode("System.Xml", "4.0.30319.18054")]
|
||||
[DebuggerStepThrough]
|
||||
[XmlType(Namespace = "http://asb.contracts.idata.data/20111111")]
|
||||
public struct RuntimeValue : IASBCustomSerializableType
|
||||
{
|
||||
private DateTime timestampField;
|
||||
|
||||
private bool timestampFieldSpecified;
|
||||
|
||||
private Variant valueField;
|
||||
|
||||
private ASBStatus statusField;
|
||||
|
||||
public DateTime Timestamp
|
||||
{
|
||||
get
|
||||
{
|
||||
return timestampField;
|
||||
}
|
||||
set
|
||||
{
|
||||
timestampField = value;
|
||||
TimestampSpecified = true;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public bool TimestampSpecified
|
||||
{
|
||||
get
|
||||
{
|
||||
return timestampFieldSpecified;
|
||||
}
|
||||
set
|
||||
{
|
||||
timestampFieldSpecified = value;
|
||||
}
|
||||
}
|
||||
|
||||
public ArchestrAServices.ASBIDataContract.Variant Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ArchestrAServices.ASBIDataContract.Variant
|
||||
{
|
||||
Type = valueField.Type,
|
||||
Length = valueField.Length,
|
||||
Payload = valueField.Payload
|
||||
};
|
||||
}
|
||||
set
|
||||
{
|
||||
valueField.Type = value.Type;
|
||||
valueField.Length = value.Length;
|
||||
valueField.Payload = value.Payload;
|
||||
}
|
||||
}
|
||||
|
||||
public ASBStatus Status
|
||||
{
|
||||
get
|
||||
{
|
||||
return statusField;
|
||||
}
|
||||
set
|
||||
{
|
||||
statusField = value;
|
||||
}
|
||||
}
|
||||
|
||||
public void WriteToStream(BinaryWriter writer)
|
||||
{
|
||||
if (writer != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
writer.Write(timestampField.ToBinary());
|
||||
writer.Write(timestampFieldSpecified);
|
||||
valueField.WriteToStream(writer);
|
||||
statusField.WriteToStream(writer);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SvcTrace.DiagDiagnostics.TraceEvent(TraceEventType.Error, 0, $" RuntimeValue: WriteTo. Exception raised {ex.Message} \n Stack Trace: {ex.StackTrace}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void InitializeFromStream(BinaryReader reader)
|
||||
{
|
||||
if (MemoryStreamHelper.ValidateStream(reader))
|
||||
{
|
||||
try
|
||||
{
|
||||
timestampField = DateTime.FromBinary(reader.ReadInt64());
|
||||
timestampFieldSpecified = reader.ReadBoolean();
|
||||
valueField.InitializeFromStream(reader);
|
||||
statusField.InitializeFromStream(reader);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SvcTrace.DiagDiagnostics.TraceEvent(TraceEventType.Error, 0, $" RuntimeValue: InitializeFrom. Exception raised {ex.Message} \n Stack Trace: {ex.StackTrace}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public object InitializeArrayFromStream(BinaryReader reader, int arrayCnt)
|
||||
{
|
||||
object result = null;
|
||||
if (MemoryStreamHelper.ValidateStream(reader, arrayCnt))
|
||||
{
|
||||
try
|
||||
{
|
||||
RuntimeValue[] array = new RuntimeValue[arrayCnt];
|
||||
for (int i = 0; i < arrayCnt; i++)
|
||||
{
|
||||
InitializeFrom(reader, ref array[i]);
|
||||
}
|
||||
result = array;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SvcTrace.DiagDiagnostics.TraceEvent(TraceEventType.Error, 0, $" RuntimeValue: InitializeFromArray. Exception raised {ex.Message} \n Stack Trace: {ex.StackTrace}");
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public void WriteArrayToStream(object graph, ref BinaryWriter bw)
|
||||
{
|
||||
if (graph == null || bw == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
if (graph is RuntimeValue[] array)
|
||||
{
|
||||
bw.Write(array.Length);
|
||||
RuntimeValue[] array2 = array;
|
||||
foreach (RuntimeValue runtimeValue in array2)
|
||||
{
|
||||
runtimeValue.WriteToStream(bw);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SvcTrace.DiagDiagnostics.TraceEvent(TraceEventType.Error, 0, $" RuntimeValue: WriteArrayTo. Exception raised {ex.Message} \n Stack Trace: {ex.StackTrace}");
|
||||
}
|
||||
}
|
||||
|
||||
private static void InitializeFrom(BinaryReader reader, ref RuntimeValue result)
|
||||
{
|
||||
if (MemoryStreamHelper.ValidateStream(reader))
|
||||
{
|
||||
result.timestampField = DateTime.FromBinary(reader.ReadInt64());
|
||||
result.timestampFieldSpecified = reader.ReadBoolean();
|
||||
result.valueField.InitializeFromStream(reader);
|
||||
result.statusField.InitializeFromStream(reader);
|
||||
}
|
||||
}
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.ServiceModel;
|
||||
using ArchestrAServices.ASBIDataContract;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[DebuggerStepThrough]
|
||||
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[MessageContract(WrapperName = "SetSubscriptionStateRequest", WrapperNamespace = "http://asb.contracts.idata.messages/20111111", IsWrapped = true)]
|
||||
public class SetSubscriptionStateRequest : ConnectedRequest
|
||||
{
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 0)]
|
||||
public long SubscriptionId;
|
||||
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 1)]
|
||||
private Variant NewState;
|
||||
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 2)]
|
||||
public ushort StateToChange;
|
||||
|
||||
public ArchestrAServices.ASBIDataContract.Variant NewStateProperty
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ArchestrAServices.ASBIDataContract.Variant
|
||||
{
|
||||
Type = NewState.Type,
|
||||
Length = NewState.Length,
|
||||
Payload = NewState.Payload
|
||||
};
|
||||
}
|
||||
set
|
||||
{
|
||||
NewState.Type = value.Type;
|
||||
NewState.Length = value.Length;
|
||||
NewState.Payload = value.Payload;
|
||||
}
|
||||
}
|
||||
|
||||
public SetSubscriptionStateRequest()
|
||||
{
|
||||
}
|
||||
|
||||
public SetSubscriptionStateRequest(long SubscriptionId, ArchestrAServices.ASBIDataContract.Variant NewState, ushort StateToChange)
|
||||
{
|
||||
this.SubscriptionId = SubscriptionId;
|
||||
this.NewState.Type = NewState.Type;
|
||||
this.NewState.Length = NewState.Length;
|
||||
this.NewState.Payload = NewState.Payload;
|
||||
this.StateToChange = StateToChange;
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.ServiceModel;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[DebuggerStepThrough]
|
||||
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[MessageContract(WrapperName = "SetSubscriptionStateResponse", WrapperNamespace = "http://asb.contracts.idata.messages/20111111", IsWrapped = true)]
|
||||
public class SetSubscriptionStateResponse : ConnectedResponse
|
||||
{
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
public enum SubscriptionStateType : ushort
|
||||
{
|
||||
SubsEnableState = 1,
|
||||
SubsSampleInterval = 2,
|
||||
SubsMaxQueueSize = 3,
|
||||
SubsUnknown = ushort.MaxValue
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.ServiceModel;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[DebuggerStepThrough]
|
||||
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[MessageContract(WrapperName = "UnregisterItemsRequest", WrapperNamespace = "http://asb.contracts.idata.messages/20111111", IsWrapped = true)]
|
||||
public class UnregisterItemsRequest : ConnectedRequest
|
||||
{
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 0)]
|
||||
[XmlElement("Items")]
|
||||
public ItemIdentity[] Items;
|
||||
|
||||
public UnregisterItemsRequest()
|
||||
{
|
||||
}
|
||||
|
||||
public UnregisterItemsRequest(ItemIdentity[] Items)
|
||||
{
|
||||
this.Items = Items;
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.ServiceModel;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[DebuggerStepThrough]
|
||||
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[MessageContract(WrapperName = "UnregisterItemsResponse", WrapperNamespace = "http://asb.contracts.idata.messages/20111111", IsWrapped = true)]
|
||||
public class UnregisterItemsResponse : ConnectedResponse
|
||||
{
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 0)]
|
||||
[XmlElement("Status")]
|
||||
public ItemStatus[] Status;
|
||||
|
||||
public UnregisterItemsResponse()
|
||||
{
|
||||
}
|
||||
|
||||
public UnregisterItemsResponse(ItemStatus[] Status)
|
||||
{
|
||||
this.Status = Status;
|
||||
}
|
||||
}
|
||||
+193
@@ -0,0 +1,193 @@
|
||||
using System;
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Diagnostics;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[Serializable]
|
||||
[GeneratedCode("System.Xml", "4.0.30319.18054")]
|
||||
[DebuggerStepThrough]
|
||||
[XmlType(Namespace = "http://asb.contracts.idata.data/20111111")]
|
||||
public struct UserToken
|
||||
{
|
||||
private ushort encryptionField;
|
||||
|
||||
private bool encryptionFieldSpecified;
|
||||
|
||||
private string hostNameField;
|
||||
|
||||
private ushort idTypeField;
|
||||
|
||||
private bool idTypeFieldSpecified;
|
||||
|
||||
private string locationIDField;
|
||||
|
||||
private string passwordField;
|
||||
|
||||
private byte[] samlTokenField;
|
||||
|
||||
private string userNameField;
|
||||
|
||||
private ushort validityField;
|
||||
|
||||
private bool validityFieldSpecified;
|
||||
|
||||
private byte[] x509CertificateField;
|
||||
|
||||
public ushort Encryption
|
||||
{
|
||||
get
|
||||
{
|
||||
return encryptionField;
|
||||
}
|
||||
set
|
||||
{
|
||||
encryptionField = value;
|
||||
EncryptionSpecified = true;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public bool EncryptionSpecified
|
||||
{
|
||||
get
|
||||
{
|
||||
return encryptionFieldSpecified;
|
||||
}
|
||||
set
|
||||
{
|
||||
encryptionFieldSpecified = value;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlElement(IsNullable = true)]
|
||||
public string HostName
|
||||
{
|
||||
get
|
||||
{
|
||||
return hostNameField;
|
||||
}
|
||||
set
|
||||
{
|
||||
hostNameField = value;
|
||||
}
|
||||
}
|
||||
|
||||
public ushort IdType
|
||||
{
|
||||
get
|
||||
{
|
||||
return idTypeField;
|
||||
}
|
||||
set
|
||||
{
|
||||
idTypeField = value;
|
||||
IdTypeSpecified = true;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public bool IdTypeSpecified
|
||||
{
|
||||
get
|
||||
{
|
||||
return idTypeFieldSpecified;
|
||||
}
|
||||
set
|
||||
{
|
||||
idTypeFieldSpecified = value;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlElement(IsNullable = true)]
|
||||
public string LocationID
|
||||
{
|
||||
get
|
||||
{
|
||||
return locationIDField;
|
||||
}
|
||||
set
|
||||
{
|
||||
locationIDField = value;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlElement(IsNullable = true)]
|
||||
public string Password
|
||||
{
|
||||
get
|
||||
{
|
||||
return passwordField;
|
||||
}
|
||||
set
|
||||
{
|
||||
passwordField = value;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlElement(DataType = "base64Binary", IsNullable = true)]
|
||||
public byte[] SamlToken
|
||||
{
|
||||
get
|
||||
{
|
||||
return samlTokenField;
|
||||
}
|
||||
set
|
||||
{
|
||||
samlTokenField = value;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlElement(IsNullable = true)]
|
||||
public string UserName
|
||||
{
|
||||
get
|
||||
{
|
||||
return userNameField;
|
||||
}
|
||||
set
|
||||
{
|
||||
userNameField = value;
|
||||
}
|
||||
}
|
||||
|
||||
public ushort Validity
|
||||
{
|
||||
get
|
||||
{
|
||||
return validityField;
|
||||
}
|
||||
set
|
||||
{
|
||||
validityField = value;
|
||||
ValiditySpecified = true;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public bool ValiditySpecified
|
||||
{
|
||||
get
|
||||
{
|
||||
return validityFieldSpecified;
|
||||
}
|
||||
set
|
||||
{
|
||||
validityFieldSpecified = value;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlElement(DataType = "base64Binary", IsNullable = true)]
|
||||
public byte[] X509Certificate
|
||||
{
|
||||
get
|
||||
{
|
||||
return x509CertificateField;
|
||||
}
|
||||
set
|
||||
{
|
||||
x509CertificateField = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,176 @@
|
||||
#define TRACE
|
||||
using System;
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Xml.Serialization;
|
||||
using ArchestrAServices.Common;
|
||||
using ArchestrAServices.Contract;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[Serializable]
|
||||
[GeneratedCode("System.Xml", "4.0.30319.18054")]
|
||||
[DebuggerStepThrough]
|
||||
[XmlType(Namespace = "http://asb.contracts.idata.data/20111111")]
|
||||
internal struct Variant : IASBCustomSerializableType
|
||||
{
|
||||
private ushort typeField;
|
||||
|
||||
private int lengthField;
|
||||
|
||||
private byte[] payloadField;
|
||||
|
||||
public ushort Type
|
||||
{
|
||||
get
|
||||
{
|
||||
return typeField;
|
||||
}
|
||||
set
|
||||
{
|
||||
typeField = value;
|
||||
}
|
||||
}
|
||||
|
||||
public int Length
|
||||
{
|
||||
get
|
||||
{
|
||||
return lengthField;
|
||||
}
|
||||
set
|
||||
{
|
||||
lengthField = value;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlElement(DataType = "base64Binary", IsNullable = true)]
|
||||
public byte[] Payload
|
||||
{
|
||||
get
|
||||
{
|
||||
return payloadField;
|
||||
}
|
||||
set
|
||||
{
|
||||
payloadField = value;
|
||||
}
|
||||
}
|
||||
|
||||
public void WriteToStream(BinaryWriter writer)
|
||||
{
|
||||
if (writer == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
writer.Write(typeField);
|
||||
writer.Write(lengthField);
|
||||
if (payloadField != null)
|
||||
{
|
||||
writer.Write((uint)payloadField.Length);
|
||||
writer.Write(payloadField);
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.Write(0u);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SvcTrace.DiagDiagnostics.TraceEvent(TraceEventType.Error, 0, $" Variant: WriteTo. Exception raised {ex.Message} \n Stack Trace: {ex.StackTrace}");
|
||||
}
|
||||
}
|
||||
|
||||
public void InitializeFromStream(BinaryReader reader)
|
||||
{
|
||||
if (!MemoryStreamHelper.ValidateStream(reader))
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
typeField = reader.ReadUInt16();
|
||||
lengthField = reader.ReadInt32();
|
||||
int num = reader.ReadInt32();
|
||||
if (num > 0)
|
||||
{
|
||||
payloadField = reader.ReadBytes(num);
|
||||
}
|
||||
else
|
||||
{
|
||||
payloadField = null;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SvcTrace.DiagDiagnostics.TraceEvent(TraceEventType.Error, 0, $" Variant: InitializeFrom. Exception raised {ex.Message} \n Stack Trace: {ex.StackTrace}");
|
||||
}
|
||||
}
|
||||
|
||||
public object InitializeArrayFromStream(BinaryReader reader, int arrayCnt)
|
||||
{
|
||||
object result = null;
|
||||
if (MemoryStreamHelper.ValidateStream(reader, arrayCnt))
|
||||
{
|
||||
try
|
||||
{
|
||||
Variant[] array = new Variant[arrayCnt];
|
||||
for (int i = 0; i < arrayCnt; i++)
|
||||
{
|
||||
InitializeFrom(reader, ref array[i]);
|
||||
}
|
||||
result = array;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SvcTrace.DiagDiagnostics.TraceEvent(TraceEventType.Error, 0, $" InitializeFromArray: InitializeFromArray. Exception raised {ex.Message} \n Stack Trace: {ex.StackTrace}");
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public void WriteArrayToStream(object graph, ref BinaryWriter bw)
|
||||
{
|
||||
if (graph == null || bw == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
if (graph is Variant[] array)
|
||||
{
|
||||
bw.Write(array.Length);
|
||||
Variant[] array2 = array;
|
||||
foreach (Variant variant in array2)
|
||||
{
|
||||
variant.WriteToStream(bw);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SvcTrace.DiagDiagnostics.TraceEvent(TraceEventType.Error, 0, $" Variant: WriteArrayTo. Exception raised {ex.Message} \n Stack Trace: {ex.StackTrace}");
|
||||
}
|
||||
}
|
||||
|
||||
private static void InitializeFrom(BinaryReader reader, ref Variant result)
|
||||
{
|
||||
if (MemoryStreamHelper.ValidateStream(reader))
|
||||
{
|
||||
result.typeField = reader.ReadUInt16();
|
||||
result.lengthField = reader.ReadInt32();
|
||||
int num = reader.ReadInt32();
|
||||
if (num > 0)
|
||||
{
|
||||
result.payloadField = reader.ReadBytes(num);
|
||||
}
|
||||
else
|
||||
{
|
||||
result.payloadField = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
using ArchestrAServices.ASBIDataContract;
|
||||
using ArchestrAServices.Contract;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
public static class VariantConverter
|
||||
{
|
||||
public static ArchestrAServices.Contract.Variant VariantBacker(ArchestrAServices.ASBIDataContract.Variant value)
|
||||
{
|
||||
return new ArchestrAServices.Contract.Variant
|
||||
{
|
||||
Type = value.Type,
|
||||
Length = value.Length,
|
||||
Payload = value.Payload
|
||||
};
|
||||
}
|
||||
}
|
||||
+111
@@ -0,0 +1,111 @@
|
||||
using System.IO;
|
||||
using ArchestrAServices.ASBIDataContract;
|
||||
using ArchestrAServices.Contract;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
public struct VariantTester : IASBCustomSerializableType
|
||||
{
|
||||
private Variant _testVariant = default(Variant);
|
||||
|
||||
public ushort Type
|
||||
{
|
||||
get
|
||||
{
|
||||
return _testVariant.Type;
|
||||
}
|
||||
set
|
||||
{
|
||||
_testVariant.Type = value;
|
||||
}
|
||||
}
|
||||
|
||||
public int Length
|
||||
{
|
||||
get
|
||||
{
|
||||
return _testVariant.Length;
|
||||
}
|
||||
set
|
||||
{
|
||||
_testVariant.Length = value;
|
||||
}
|
||||
}
|
||||
|
||||
public byte[] Payload
|
||||
{
|
||||
get
|
||||
{
|
||||
return _testVariant.Payload;
|
||||
}
|
||||
set
|
||||
{
|
||||
_testVariant.Payload = value;
|
||||
}
|
||||
}
|
||||
|
||||
public VariantTester(ArchestrAServices.ASBIDataContract.Variant Value)
|
||||
{
|
||||
_testVariant.Type = Value.Type;
|
||||
_testVariant.Length = Value.Length;
|
||||
_testVariant.Payload = Value.Payload;
|
||||
}
|
||||
|
||||
public ArchestrAServices.ASBIDataContract.Variant GetAsVariant()
|
||||
{
|
||||
return new ArchestrAServices.ASBIDataContract.Variant
|
||||
{
|
||||
Type = _testVariant.Type,
|
||||
Length = _testVariant.Length,
|
||||
Payload = _testVariant.Payload
|
||||
};
|
||||
}
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
_testVariant = default(Variant);
|
||||
}
|
||||
|
||||
public void WriteToStream(BinaryWriter writer)
|
||||
{
|
||||
_testVariant.WriteToStream(writer);
|
||||
}
|
||||
|
||||
public void InitializeFromStream(BinaryReader reader)
|
||||
{
|
||||
_testVariant.InitializeFromStream(reader);
|
||||
}
|
||||
|
||||
public object InitializeArrayFromStream(BinaryReader reader, int arrayCnt)
|
||||
{
|
||||
if (_testVariant.InitializeArrayFromStream(reader, arrayCnt) is Variant[] array)
|
||||
{
|
||||
ArchestrAServices.ASBIDataContract.Variant[] array2 = new ArchestrAServices.ASBIDataContract.Variant[array.Length];
|
||||
for (int i = 0; i < array.Length; i++)
|
||||
{
|
||||
array2[i] = default(ArchestrAServices.ASBIDataContract.Variant);
|
||||
array2[i].Type = array[i].Type;
|
||||
array2[i].Length = array[i].Length;
|
||||
array2[i].Payload = array[i].Payload;
|
||||
}
|
||||
return array2;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void WriteArrayToStream(object graph, ref BinaryWriter bw)
|
||||
{
|
||||
if (graph is ArchestrAServices.ASBIDataContract.Variant[] array)
|
||||
{
|
||||
Variant[] array2 = new Variant[array.Length];
|
||||
for (int i = 0; i < array.Length; i++)
|
||||
{
|
||||
array2[i] = default(Variant);
|
||||
array2[i].Type = array[i].Type;
|
||||
array2[i].Length = array[i].Length;
|
||||
array2[i].Payload = array[i].Payload;
|
||||
}
|
||||
_testVariant.WriteArrayToStream(array2, ref bw);
|
||||
}
|
||||
}
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.ServiceModel;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[DebuggerStepThrough]
|
||||
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[MessageContract(WrapperName = "WriteBasicRequest", WrapperNamespace = "http://asb.contracts.idata.messages/20111111", IsWrapped = true)]
|
||||
public class WriteBasicRequest : ConnectedRequest
|
||||
{
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 0)]
|
||||
[XmlElement("Items", IsNullable = false)]
|
||||
public ItemIdentity[] Items;
|
||||
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 1)]
|
||||
[XmlElement("Values", IsNullable = false)]
|
||||
public WriteValue[] Values;
|
||||
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 2)]
|
||||
public uint WriteHandle;
|
||||
|
||||
public WriteBasicRequest()
|
||||
{
|
||||
}
|
||||
|
||||
public WriteBasicRequest(ItemIdentity[] Items, WriteValue[] Values, uint WriteHandle)
|
||||
{
|
||||
this.Items = Items;
|
||||
this.Values = Values;
|
||||
this.WriteHandle = WriteHandle;
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
public enum WriteCapabilityType : ushort
|
||||
{
|
||||
WriteUnknown = 0,
|
||||
WriteNonsecure = 1,
|
||||
WriteUser = 2,
|
||||
WriteConfirm = 4,
|
||||
WriteVerify = 8
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.ServiceModel;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[DebuggerStepThrough]
|
||||
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[MessageContract(WrapperName = "WriteConfirmedRequest", WrapperNamespace = "http://asb.contracts.idata.messages/20111111", IsWrapped = true)]
|
||||
public class WriteConfirmedRequest : ConnectedRequest
|
||||
{
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 0)]
|
||||
public ItemIdentity Item;
|
||||
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 1)]
|
||||
public WriteValue Value;
|
||||
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 2)]
|
||||
public UserToken User;
|
||||
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 3)]
|
||||
public UserToken Supervisor;
|
||||
|
||||
public WriteConfirmedRequest()
|
||||
{
|
||||
}
|
||||
|
||||
public WriteConfirmedRequest(ItemIdentity Item, WriteValue Value, UserToken User, UserToken Supervisor)
|
||||
{
|
||||
this.Item = Item;
|
||||
this.Value = Value;
|
||||
this.User = User;
|
||||
this.Supervisor = Supervisor;
|
||||
}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.ServiceModel;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[DebuggerStepThrough]
|
||||
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[MessageContract(WrapperName = "WriteConfirmedResponse", WrapperNamespace = "http://asb.contracts.idata.messages/20111111", IsWrapped = true)]
|
||||
public class WriteConfirmedResponse : ConnectedResponse
|
||||
{
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 0)]
|
||||
public WriteValue ValueReceived;
|
||||
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 1)]
|
||||
public long WriteToken;
|
||||
|
||||
public WriteConfirmedResponse()
|
||||
{
|
||||
}
|
||||
|
||||
public WriteConfirmedResponse(WriteValue ValueReceived, long WriteToken)
|
||||
{
|
||||
this.ValueReceived = ValueReceived;
|
||||
this.WriteToken = WriteToken;
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.ServiceModel;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[DebuggerStepThrough]
|
||||
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[MessageContract(WrapperName = "WriteBasicResponse", WrapperNamespace = "http://asb.contracts.idata.messages/20111111", IsWrapped = true)]
|
||||
public class WriteResponse : ConnectedResponse
|
||||
{
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 0)]
|
||||
[XmlElement("Status", IsNullable = false)]
|
||||
public ItemStatus[] Status;
|
||||
|
||||
public WriteResponse()
|
||||
{
|
||||
}
|
||||
|
||||
public WriteResponse(ItemStatus[] Status)
|
||||
{
|
||||
this.Status = Status;
|
||||
}
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.ServiceModel;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[DebuggerStepThrough]
|
||||
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[MessageContract(WrapperName = "WriteSecuredRequest", WrapperNamespace = "http://asb.contracts.idata.messages/20111111", IsWrapped = true)]
|
||||
public class WriteSecuredRequest : ConnectedRequest
|
||||
{
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 0)]
|
||||
[XmlElement("Items")]
|
||||
public ItemIdentity[] Items;
|
||||
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 1)]
|
||||
[XmlElement("Values")]
|
||||
public WriteValue[] Values;
|
||||
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 2)]
|
||||
public UserToken User;
|
||||
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 3)]
|
||||
public uint WriteHandle;
|
||||
|
||||
public WriteSecuredRequest()
|
||||
{
|
||||
}
|
||||
|
||||
public WriteSecuredRequest(ItemIdentity[] Items, WriteValue[] Values, UserToken User, uint WriteHandle)
|
||||
{
|
||||
this.Items = Items;
|
||||
this.Values = Values;
|
||||
this.User = User;
|
||||
this.WriteHandle = WriteHandle;
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.ServiceModel;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[DebuggerStepThrough]
|
||||
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[MessageContract(WrapperName = "WriteSecuredResponse", WrapperNamespace = "http://asb.contracts.idata.messages/20111111", IsWrapped = true)]
|
||||
public class WriteSecuredResponse : ConnectedResponse
|
||||
{
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 0)]
|
||||
[XmlElement("Status")]
|
||||
public ItemStatus[] Status;
|
||||
|
||||
public WriteSecuredResponse()
|
||||
{
|
||||
}
|
||||
|
||||
public WriteSecuredResponse(ItemStatus[] Status)
|
||||
{
|
||||
this.Status = Status;
|
||||
}
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.ServiceModel;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[DebuggerStepThrough]
|
||||
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[MessageContract(WrapperName = "WriteUserRequest", WrapperNamespace = "http://asb.contracts.idata.messages/20111111", IsWrapped = true)]
|
||||
public class WriteUserRequest : ConnectedRequest
|
||||
{
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 0)]
|
||||
[XmlElement("Items")]
|
||||
public ItemIdentity[] Items;
|
||||
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 1)]
|
||||
[XmlElement("Values")]
|
||||
public WriteValue[] Values;
|
||||
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 2)]
|
||||
public UserToken User;
|
||||
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 3)]
|
||||
public uint WriteHandle;
|
||||
|
||||
public WriteUserRequest()
|
||||
{
|
||||
}
|
||||
|
||||
public WriteUserRequest(ItemIdentity[] Items, WriteValue[] Values, UserToken User, uint WriteHandle)
|
||||
{
|
||||
this.Items = Items;
|
||||
this.Values = Values;
|
||||
this.User = User;
|
||||
this.WriteHandle = WriteHandle;
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.ServiceModel;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[DebuggerStepThrough]
|
||||
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[MessageContract(WrapperName = "WriteUserResponse", WrapperNamespace = "http://asb.contracts.idata.messages/20111111", IsWrapped = true)]
|
||||
public class WriteUserResponse : ConnectedResponse
|
||||
{
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 0)]
|
||||
[XmlElement("Status")]
|
||||
public ItemStatus[] Status;
|
||||
|
||||
public WriteUserResponse()
|
||||
{
|
||||
}
|
||||
|
||||
public WriteUserResponse(ItemStatus[] Status)
|
||||
{
|
||||
this.Status = Status;
|
||||
}
|
||||
}
|
||||
+124
@@ -0,0 +1,124 @@
|
||||
using System;
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Diagnostics;
|
||||
using System.Xml.Serialization;
|
||||
using ArchestrAServices.ASBIDataContract;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[Serializable]
|
||||
[GeneratedCode("System.Xml", "4.0.30319.18054")]
|
||||
[DebuggerStepThrough]
|
||||
[XmlType(Namespace = "http://asb.contracts.idata.data/20111111")]
|
||||
public struct WriteValue
|
||||
{
|
||||
private bool hasQTField;
|
||||
|
||||
private bool hasQTFieldSpecified;
|
||||
|
||||
private Variant valueField;
|
||||
|
||||
private ASBStatus statusField;
|
||||
|
||||
private DateTime timestampField;
|
||||
|
||||
private bool timestampFieldSpecified;
|
||||
|
||||
private string commentField;
|
||||
|
||||
public bool HasQT
|
||||
{
|
||||
get
|
||||
{
|
||||
return hasQTField;
|
||||
}
|
||||
set
|
||||
{
|
||||
hasQTField = value;
|
||||
HasQTSpecified = true;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public bool HasQTSpecified
|
||||
{
|
||||
get
|
||||
{
|
||||
return hasQTFieldSpecified;
|
||||
}
|
||||
set
|
||||
{
|
||||
hasQTFieldSpecified = value;
|
||||
}
|
||||
}
|
||||
|
||||
public ArchestrAServices.ASBIDataContract.Variant Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ArchestrAServices.ASBIDataContract.Variant
|
||||
{
|
||||
Type = valueField.Type,
|
||||
Length = valueField.Length,
|
||||
Payload = valueField.Payload
|
||||
};
|
||||
}
|
||||
set
|
||||
{
|
||||
valueField.Type = value.Type;
|
||||
valueField.Length = value.Length;
|
||||
valueField.Payload = value.Payload;
|
||||
}
|
||||
}
|
||||
|
||||
public ASBStatus Status
|
||||
{
|
||||
get
|
||||
{
|
||||
return statusField;
|
||||
}
|
||||
set
|
||||
{
|
||||
statusField = value;
|
||||
}
|
||||
}
|
||||
|
||||
public DateTime Timestamp
|
||||
{
|
||||
get
|
||||
{
|
||||
return timestampField;
|
||||
}
|
||||
set
|
||||
{
|
||||
timestampField = value;
|
||||
TimestampSpecified = true;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public bool TimestampSpecified
|
||||
{
|
||||
get
|
||||
{
|
||||
return timestampFieldSpecified;
|
||||
}
|
||||
set
|
||||
{
|
||||
timestampFieldSpecified = value;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlElement(IsNullable = true)]
|
||||
public string Comment
|
||||
{
|
||||
get
|
||||
{
|
||||
return commentField;
|
||||
}
|
||||
set
|
||||
{
|
||||
commentField = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.ServiceModel;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[DebuggerStepThrough]
|
||||
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[MessageContract(WrapperName = "WriteVerifiedRequest", WrapperNamespace = "http://asb.contracts.idata.messages/20111111", IsWrapped = true)]
|
||||
public class WriteVerifiedRequest : ConnectedRequest
|
||||
{
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 0)]
|
||||
[XmlElement("Items")]
|
||||
public ItemIdentity[] Items;
|
||||
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 1)]
|
||||
[XmlElement("Values")]
|
||||
public WriteValue[] Values;
|
||||
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 2)]
|
||||
public UserToken User;
|
||||
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 3)]
|
||||
public UserToken Supervisor;
|
||||
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 4)]
|
||||
public uint WriteHandle;
|
||||
|
||||
public WriteVerifiedRequest()
|
||||
{
|
||||
}
|
||||
|
||||
public WriteVerifiedRequest(ItemIdentity[] Items, WriteValue[] Values, UserToken User, UserToken Supervisor, uint WriteHandle)
|
||||
{
|
||||
this.Items = Items;
|
||||
this.Values = Values;
|
||||
this.User = User;
|
||||
this.Supervisor = Supervisor;
|
||||
this.WriteHandle = WriteHandle;
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.ServiceModel;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace ArchestrAServices.ASBContract;
|
||||
|
||||
[DebuggerStepThrough]
|
||||
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[MessageContract(WrapperName = "WriteVerifiedResponse", WrapperNamespace = "http://asb.contracts.idata.messages/20111111", IsWrapped = true)]
|
||||
public class WriteVerifiedResponse : ConnectedResponse
|
||||
{
|
||||
[MessageBodyMember(Namespace = "http://asb.contracts.idata.messages/20111111", Order = 0)]
|
||||
[XmlElement("Status")]
|
||||
public ItemStatus[] Status;
|
||||
|
||||
public WriteVerifiedResponse()
|
||||
{
|
||||
}
|
||||
|
||||
public WriteVerifiedResponse(ItemStatus[] Status)
|
||||
{
|
||||
this.Status = Status;
|
||||
}
|
||||
}
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
using System;
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Diagnostics;
|
||||
using System.Xml.Serialization;
|
||||
using ArchestrAServices.Contract;
|
||||
|
||||
namespace ArchestrAServices.ASBIDataContract;
|
||||
|
||||
[Serializable]
|
||||
[GeneratedCode("System.Xml", "4.0.30319.233")]
|
||||
[DebuggerStepThrough]
|
||||
[XmlType(Namespace = "http://asb.contracts.idata.data/20111111")]
|
||||
public struct Variant
|
||||
{
|
||||
private ushort typeField;
|
||||
|
||||
private int lengthField;
|
||||
|
||||
private byte[] payloadField;
|
||||
|
||||
public ushort Type
|
||||
{
|
||||
get
|
||||
{
|
||||
return typeField;
|
||||
}
|
||||
set
|
||||
{
|
||||
typeField = value;
|
||||
}
|
||||
}
|
||||
|
||||
public int Length
|
||||
{
|
||||
get
|
||||
{
|
||||
return lengthField;
|
||||
}
|
||||
set
|
||||
{
|
||||
lengthField = value;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlElement(DataType = "base64Binary", IsNullable = true)]
|
||||
public byte[] Payload
|
||||
{
|
||||
get
|
||||
{
|
||||
return payloadField;
|
||||
}
|
||||
set
|
||||
{
|
||||
payloadField = value;
|
||||
}
|
||||
}
|
||||
|
||||
public Variant(ref ArchestrAServices.Contract.Variant oldVariant)
|
||||
{
|
||||
lengthField = oldVariant.Length;
|
||||
typeField = oldVariant.Type;
|
||||
payloadField = oldVariant.Payload;
|
||||
}
|
||||
|
||||
public Variant(ArchestrAServices.Contract.Variant oldVariant)
|
||||
{
|
||||
lengthField = oldVariant.Length;
|
||||
typeField = oldVariant.Type;
|
||||
payloadField = oldVariant.Payload;
|
||||
}
|
||||
|
||||
public Variant(int Length, ushort Type, byte[] Payload)
|
||||
{
|
||||
lengthField = Length;
|
||||
typeField = Type;
|
||||
payloadField = Payload;
|
||||
}
|
||||
}
|
||||
+749
@@ -0,0 +1,749 @@
|
||||
using System;
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using ArchestrAServices.ASBContract;
|
||||
|
||||
namespace ArchestrAServices.ASBIDataContract;
|
||||
|
||||
public static class VariantFactory
|
||||
{
|
||||
public static Variant MakeVariantValue(bool value)
|
||||
{
|
||||
return new Variant
|
||||
{
|
||||
Type = ASBEnumFactory.DataTypeToInt(DataType.TypeBool),
|
||||
Length = 1,
|
||||
Payload = BitConverter.GetBytes(value)
|
||||
};
|
||||
}
|
||||
|
||||
public static Variant MakeVariantValue(sbyte value)
|
||||
{
|
||||
Variant result = new Variant
|
||||
{
|
||||
Type = ASBEnumFactory.DataTypeToInt(DataType.TypeSByte),
|
||||
Length = 1,
|
||||
Payload = new byte[1]
|
||||
};
|
||||
result.Payload[0] = (byte)value;
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Variant MakeVariantValue(byte value)
|
||||
{
|
||||
Variant result = new Variant
|
||||
{
|
||||
Type = ASBEnumFactory.DataTypeToInt(DataType.TypeByte),
|
||||
Length = 1,
|
||||
Payload = new byte[1]
|
||||
};
|
||||
result.Payload[0] = value;
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Variant MakeVariantValue(ushort value)
|
||||
{
|
||||
return new Variant
|
||||
{
|
||||
Type = ASBEnumFactory.DataTypeToInt(DataType.TypeUInt16),
|
||||
Length = 2,
|
||||
Payload = BitConverter.GetBytes(value)
|
||||
};
|
||||
}
|
||||
|
||||
public static Variant MakeVariantValue(uint value)
|
||||
{
|
||||
return new Variant
|
||||
{
|
||||
Type = ASBEnumFactory.DataTypeToInt(DataType.TypeUInt32),
|
||||
Length = 4,
|
||||
Payload = BitConverter.GetBytes(value)
|
||||
};
|
||||
}
|
||||
|
||||
public static Variant MakeVariantValue(ulong value)
|
||||
{
|
||||
return new Variant
|
||||
{
|
||||
Type = ASBEnumFactory.DataTypeToInt(DataType.TypeUInt64),
|
||||
Length = 8,
|
||||
Payload = BitConverter.GetBytes(value)
|
||||
};
|
||||
}
|
||||
|
||||
public static Variant MakeVariantValue(short value)
|
||||
{
|
||||
return new Variant
|
||||
{
|
||||
Type = ASBEnumFactory.DataTypeToInt(DataType.TypeInt16),
|
||||
Length = 2,
|
||||
Payload = BitConverter.GetBytes(value)
|
||||
};
|
||||
}
|
||||
|
||||
public static Variant MakeVariantValue(int value)
|
||||
{
|
||||
return new Variant
|
||||
{
|
||||
Type = ASBEnumFactory.DataTypeToInt(DataType.TypeInt32),
|
||||
Length = 4,
|
||||
Payload = BitConverter.GetBytes(value)
|
||||
};
|
||||
}
|
||||
|
||||
public static Variant MakeVariantValue(long value)
|
||||
{
|
||||
return new Variant
|
||||
{
|
||||
Type = ASBEnumFactory.DataTypeToInt(DataType.TypeInt64),
|
||||
Length = 8,
|
||||
Payload = BitConverter.GetBytes(value)
|
||||
};
|
||||
}
|
||||
|
||||
public static Variant MakeVariantValueAsDuration(long value)
|
||||
{
|
||||
return new Variant
|
||||
{
|
||||
Type = ASBEnumFactory.DataTypeToInt(DataType.TypeDuration),
|
||||
Length = 8,
|
||||
Payload = BitConverter.GetBytes(value)
|
||||
};
|
||||
}
|
||||
|
||||
public static Variant MakeVariantValueAsDurationArray(long[] value)
|
||||
{
|
||||
Variant result = default(Variant);
|
||||
if (value != null && value.Length != 0)
|
||||
{
|
||||
result = MakeVariantValue(value);
|
||||
result.Type = ASBEnumFactory.DataTypeToInt(DataType.TypeDurationArray);
|
||||
return result;
|
||||
}
|
||||
result.Length = 0;
|
||||
result.Payload = new byte[0];
|
||||
result.Type = ASBEnumFactory.DataTypeToInt(DataType.TypeDurationArray);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Variant MakeVariantValue(float value)
|
||||
{
|
||||
return new Variant
|
||||
{
|
||||
Type = ASBEnumFactory.DataTypeToInt(DataType.TypeFloat),
|
||||
Length = 4,
|
||||
Payload = BitConverter.GetBytes(value)
|
||||
};
|
||||
}
|
||||
|
||||
public static Variant MakeVariantValue(double value)
|
||||
{
|
||||
return new Variant
|
||||
{
|
||||
Type = ASBEnumFactory.DataTypeToInt(DataType.TypeDouble),
|
||||
Length = 8,
|
||||
Payload = BitConverter.GetBytes(value)
|
||||
};
|
||||
}
|
||||
|
||||
public static Variant MakeVariantValue(string value)
|
||||
{
|
||||
Variant result = default(Variant);
|
||||
result.Type = ASBEnumFactory.DataTypeToInt(DataType.TypeString);
|
||||
result.Payload = Encoding.Unicode.GetBytes(value);
|
||||
result.Length = result.Payload.Count();
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Variant MakeVariantValue(DateTime value)
|
||||
{
|
||||
return new Variant
|
||||
{
|
||||
Type = ASBEnumFactory.DataTypeToInt(DataType.TypeDateTime),
|
||||
Length = 8,
|
||||
Payload = BitConverter.GetBytes(value.ToFileTimeUtc())
|
||||
};
|
||||
}
|
||||
|
||||
public static Variant MakeVariantValue(Guid value)
|
||||
{
|
||||
Variant result = MakeVariantValue(value.ToString());
|
||||
result.Type = ASBEnumFactory.DataTypeToInt(DataType.TypeGuid);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Variant MakeVariantValue(long value, bool bStatus)
|
||||
{
|
||||
Variant result = new Variant
|
||||
{
|
||||
Type = ASBEnumFactory.DataTypeToInt(DataType.TypeLocalizedText)
|
||||
};
|
||||
MemoryStream memoryStream = null;
|
||||
try
|
||||
{
|
||||
memoryStream = new MemoryStream();
|
||||
using (StreamWriter streamWriter = new StreamWriter(memoryStream))
|
||||
{
|
||||
memoryStream = null;
|
||||
streamWriter.Write(value);
|
||||
streamWriter.Flush();
|
||||
}
|
||||
result.Payload = memoryStream.ToArray();
|
||||
result.Length = result.Payload.Count();
|
||||
return result;
|
||||
}
|
||||
finally
|
||||
{
|
||||
memoryStream?.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public static Variant MakeVariantValue(CustomEnum customEnum)
|
||||
{
|
||||
Variant result = default(Variant);
|
||||
short ordinal = customEnum.ordinal;
|
||||
string ordinalValue = customEnum.OrdinalValue;
|
||||
result.Type = ASBEnumFactory.DataTypeToInt(DataType.TypeEnum);
|
||||
List<byte> list = new List<byte>();
|
||||
list.AddRange(BitConverter.GetBytes(Convert.ToInt16(ordinal)));
|
||||
list.AddRange(BitConverter.GetBytes(Convert.ToUInt32(ordinalValue.Length)));
|
||||
list.AddRange(Encoding.Unicode.GetBytes(ordinalValue));
|
||||
result.Length = 6 + ordinalValue.Length;
|
||||
result.Payload = list.ToArray();
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Variant MakeVariantValue(int[] value)
|
||||
{
|
||||
Variant result = default(Variant);
|
||||
if (value != null && value.Length != 0)
|
||||
{
|
||||
byte[] array = new byte[value.Length * 4];
|
||||
Buffer.BlockCopy(value, 0, array, 0, array.Length);
|
||||
result.Length = array.Length;
|
||||
result.Payload = array;
|
||||
result.Type = ASBEnumFactory.DataTypeToInt(DataType.TypeInt32Array);
|
||||
return result;
|
||||
}
|
||||
result.Length = 0;
|
||||
result.Payload = new byte[0];
|
||||
result.Type = ASBEnumFactory.DataTypeToInt(DataType.TypeInt32Array);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Variant MakeVariantValue(uint[] value)
|
||||
{
|
||||
Variant result = default(Variant);
|
||||
if (value != null && value.Length != 0)
|
||||
{
|
||||
byte[] array = new byte[value.Length * 4];
|
||||
Buffer.BlockCopy(value, 0, array, 0, array.Length);
|
||||
result.Length = array.Length;
|
||||
result.Payload = array;
|
||||
result.Type = ASBEnumFactory.DataTypeToInt(DataType.TypeUInt32Array);
|
||||
return result;
|
||||
}
|
||||
result.Length = 0;
|
||||
result.Payload = new byte[0];
|
||||
result.Type = ASBEnumFactory.DataTypeToInt(DataType.TypeUInt32Array);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Variant MakeVariantValue(long[] value)
|
||||
{
|
||||
Variant result = default(Variant);
|
||||
if (value != null && value.Length != 0)
|
||||
{
|
||||
byte[] array = new byte[value.Length * 8];
|
||||
Buffer.BlockCopy(value, 0, array, 0, array.Length);
|
||||
result.Length = array.Length;
|
||||
result.Payload = array;
|
||||
result.Type = ASBEnumFactory.DataTypeToInt(DataType.TypeInt64Array);
|
||||
return result;
|
||||
}
|
||||
result.Length = 0;
|
||||
result.Payload = new byte[0];
|
||||
result.Type = ASBEnumFactory.DataTypeToInt(DataType.TypeInt64Array);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Variant MakeVariantValue(ulong[] value)
|
||||
{
|
||||
Variant result = default(Variant);
|
||||
if (value != null && value.Length != 0)
|
||||
{
|
||||
byte[] array = new byte[value.Length * 8];
|
||||
Buffer.BlockCopy(value, 0, array, 0, array.Length);
|
||||
result.Length = array.Length;
|
||||
result.Payload = array;
|
||||
result.Type = ASBEnumFactory.DataTypeToInt(DataType.TypeUInt64Array);
|
||||
return result;
|
||||
}
|
||||
result.Length = 0;
|
||||
result.Payload = new byte[0];
|
||||
result.Type = ASBEnumFactory.DataTypeToInt(DataType.TypeUInt64Array);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Variant MakeVariantValue(float[] value)
|
||||
{
|
||||
Variant result = default(Variant);
|
||||
if (value != null && value.Length != 0)
|
||||
{
|
||||
byte[] array = new byte[value.Length * 4];
|
||||
Buffer.BlockCopy(value, 0, array, 0, array.Length);
|
||||
result.Length = array.Length;
|
||||
result.Payload = array;
|
||||
result.Type = ASBEnumFactory.DataTypeToInt(DataType.TypeFloatArray);
|
||||
return result;
|
||||
}
|
||||
result.Length = 0;
|
||||
result.Payload = new byte[0];
|
||||
result.Type = ASBEnumFactory.DataTypeToInt(DataType.TypeFloatArray);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Variant MakeVariantValue(double[] value)
|
||||
{
|
||||
Variant result = default(Variant);
|
||||
if (value != null && value.Length != 0)
|
||||
{
|
||||
byte[] array = new byte[value.Length * 8];
|
||||
Buffer.BlockCopy(value, 0, array, 0, array.Length);
|
||||
result.Length = array.Length;
|
||||
result.Payload = array;
|
||||
result.Type = ASBEnumFactory.DataTypeToInt(DataType.TypeDoubleArray);
|
||||
return result;
|
||||
}
|
||||
result.Length = 0;
|
||||
result.Payload = new byte[0];
|
||||
result.Type = ASBEnumFactory.DataTypeToInt(DataType.TypeDoubleArray);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Variant MakeVariantValue(short[] value)
|
||||
{
|
||||
Variant result = default(Variant);
|
||||
if (value != null && value.Length != 0)
|
||||
{
|
||||
byte[] array = new byte[value.Length * 2];
|
||||
Buffer.BlockCopy(value, 0, array, 0, array.Length);
|
||||
result.Length = array.Length;
|
||||
result.Payload = array;
|
||||
result.Type = ASBEnumFactory.DataTypeToInt(DataType.TypeInt16Array);
|
||||
return result;
|
||||
}
|
||||
result.Length = 0;
|
||||
result.Payload = new byte[0];
|
||||
result.Type = ASBEnumFactory.DataTypeToInt(DataType.TypeInt16Array);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Variant MakeVariantValue(ushort[] value)
|
||||
{
|
||||
Variant result = default(Variant);
|
||||
if (value != null && value.Length != 0)
|
||||
{
|
||||
byte[] array = new byte[value.Length * 2];
|
||||
Buffer.BlockCopy(value, 0, array, 0, array.Length);
|
||||
result.Length = array.Length;
|
||||
result.Payload = array;
|
||||
result.Type = ASBEnumFactory.DataTypeToInt(DataType.TypeUInt16Array);
|
||||
return result;
|
||||
}
|
||||
result.Length = 0;
|
||||
result.Payload = new byte[0];
|
||||
result.Type = ASBEnumFactory.DataTypeToInt(DataType.TypeUInt16Array);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Variant MakeVariantValue(byte[] value)
|
||||
{
|
||||
Variant result = default(Variant);
|
||||
if (value != null && value.Length != 0)
|
||||
{
|
||||
result.Length = value.Length;
|
||||
result.Payload = value;
|
||||
result.Type = ASBEnumFactory.DataTypeToInt(DataType.TypeByteArray);
|
||||
return result;
|
||||
}
|
||||
result.Length = 0;
|
||||
result.Payload = new byte[0];
|
||||
result.Type = ASBEnumFactory.DataTypeToInt(DataType.TypeByteArray);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Variant MakeVariantValue(sbyte[] value)
|
||||
{
|
||||
Variant result = default(Variant);
|
||||
if (value != null && value.Length != 0)
|
||||
{
|
||||
byte[] array = new byte[value.Length];
|
||||
Buffer.BlockCopy(value, 0, array, 0, array.Length);
|
||||
result.Length = array.Length;
|
||||
result.Payload = array;
|
||||
result.Type = ASBEnumFactory.DataTypeToInt(DataType.TypeSByteArray);
|
||||
return result;
|
||||
}
|
||||
result.Length = 0;
|
||||
result.Payload = new byte[0];
|
||||
result.Type = ASBEnumFactory.DataTypeToInt(DataType.TypeSByteArray);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Variant MakeVariantValue(bool[] value)
|
||||
{
|
||||
Variant result = default(Variant);
|
||||
if (value != null && value.Length != 0)
|
||||
{
|
||||
byte[] array = new byte[value.Length];
|
||||
Buffer.BlockCopy(value, 0, array, 0, array.Length);
|
||||
result.Length = array.Length;
|
||||
result.Payload = array;
|
||||
result.Type = ASBEnumFactory.DataTypeToInt(DataType.TypeBoolArray);
|
||||
return result;
|
||||
}
|
||||
result.Length = 0;
|
||||
result.Payload = new byte[0];
|
||||
result.Type = ASBEnumFactory.DataTypeToInt(DataType.TypeBoolArray);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Variant MakeVariantValue(DateTime[] value)
|
||||
{
|
||||
Variant result = default(Variant);
|
||||
if (value != null && value.Length != 0)
|
||||
{
|
||||
long[] array = new long[value.Length];
|
||||
for (int i = 0; i < value.Length; i++)
|
||||
{
|
||||
array[i] = value[i].ToFileTimeUtc();
|
||||
}
|
||||
result = MakeVariantValue(array);
|
||||
result.Type = ASBEnumFactory.DataTypeToInt(DataType.TypeDateTimeArray);
|
||||
return result;
|
||||
}
|
||||
result.Length = 0;
|
||||
result.Payload = new byte[0];
|
||||
result.Type = ASBEnumFactory.DataTypeToInt(DataType.TypeDateTimeArray);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Variant MakeVariantValue(char[] value)
|
||||
{
|
||||
Variant result = default(Variant);
|
||||
if (value != null && value.Length != 0)
|
||||
{
|
||||
byte[] array = new byte[value.Length * 2];
|
||||
Buffer.BlockCopy(value, 0, array, 0, array.Length);
|
||||
result.Length = array.Length;
|
||||
result.Payload = array;
|
||||
result.Type = ASBEnumFactory.DataTypeToInt(DataType.TypeCharArray);
|
||||
return result;
|
||||
}
|
||||
result.Length = 0;
|
||||
result.Payload = new byte[0];
|
||||
result.Type = ASBEnumFactory.DataTypeToInt(DataType.TypeCharArray);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Variant MakeVariantValue(string[] value)
|
||||
{
|
||||
if (value == null || value.Length == 0)
|
||||
{
|
||||
return new Variant
|
||||
{
|
||||
Length = 0,
|
||||
Payload = new byte[0],
|
||||
Type = ASBEnumFactory.DataTypeToInt(DataType.TypeStringArray)
|
||||
};
|
||||
}
|
||||
byte[][] array = new byte[value.Length][];
|
||||
int num = 0;
|
||||
for (int i = 0; i < value.Length; i++)
|
||||
{
|
||||
if (value[i] == null)
|
||||
{
|
||||
array[i] = new byte[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
array[i] = Encoding.Unicode.GetBytes(value[i]);
|
||||
num += array[i].Length;
|
||||
}
|
||||
num += 4;
|
||||
}
|
||||
byte[] array2 = new byte[num];
|
||||
int j = 0;
|
||||
int num2 = 0;
|
||||
for (; j < value.Length; j++)
|
||||
{
|
||||
byte[] bytes = BitConverter.GetBytes(array[j].Length);
|
||||
Buffer.BlockCopy(bytes, 0, array2, num2, bytes.Length);
|
||||
num2 += bytes.Length;
|
||||
Buffer.BlockCopy(array[j], 0, array2, num2, array[j].Length);
|
||||
num2 += array[j].Length;
|
||||
}
|
||||
return new Variant
|
||||
{
|
||||
Length = array2.Length,
|
||||
Payload = array2,
|
||||
Type = ASBEnumFactory.DataTypeToInt(DataType.TypeStringArray)
|
||||
};
|
||||
}
|
||||
|
||||
public static Variant MakeVariantValue(Guid[] value)
|
||||
{
|
||||
Variant result = default(Variant);
|
||||
if (value != null && value.Length != 0)
|
||||
{
|
||||
string[] array = new string[value.Length];
|
||||
for (int i = 0; i < value.Length; i++)
|
||||
{
|
||||
array[i] = value[i].ToString();
|
||||
}
|
||||
result = MakeVariantValue(array);
|
||||
result.Type = ASBEnumFactory.DataTypeToInt(DataType.TypeGuidArray);
|
||||
return result;
|
||||
}
|
||||
result.Length = 0;
|
||||
result.Payload = new byte[0];
|
||||
result.Type = ASBEnumFactory.DataTypeToInt(DataType.TypeGuidArray);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Variant MakeVariantValue(CustomEnum[] customEnum)
|
||||
{
|
||||
Variant result = default(Variant);
|
||||
int num = 0;
|
||||
List<byte> list = new List<byte>();
|
||||
if (customEnum != null && customEnum.Length != 0)
|
||||
{
|
||||
for (int i = 0; i < customEnum.Length; i++)
|
||||
{
|
||||
short ordinal = customEnum[i].ordinal;
|
||||
string ordinalValue = customEnum[i].OrdinalValue;
|
||||
num += 6 + ordinalValue.Length;
|
||||
list.AddRange(BitConverter.GetBytes(Convert.ToInt16(ordinal)));
|
||||
list.AddRange(BitConverter.GetBytes(Convert.ToUInt32(ordinalValue.Length)));
|
||||
list.AddRange(Encoding.Unicode.GetBytes(ordinalValue));
|
||||
}
|
||||
result.Length = num;
|
||||
result.Payload = list.ToArray();
|
||||
result.Type = ASBEnumFactory.DataTypeToInt(DataType.TypeEnumArray);
|
||||
return result;
|
||||
}
|
||||
result.Length = 0;
|
||||
result.Payload = new byte[0];
|
||||
result.Type = ASBEnumFactory.DataTypeToInt(DataType.TypeEnum);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Variant MakeVariantArray(Array valueArray)
|
||||
{
|
||||
Variant result = default(Variant);
|
||||
Type type = valueArray.GetType();
|
||||
type.GetArrayRank();
|
||||
int VariantElementSize = 0;
|
||||
if (type.HasElementType)
|
||||
{
|
||||
Type elementType = type.GetElementType();
|
||||
ushort VariantElementType = 0;
|
||||
CalculateTypeAndSize(elementType, ref VariantElementType, ref VariantElementSize);
|
||||
result.Type = VariantElementType;
|
||||
}
|
||||
uint arrayRank = (uint)type.GetArrayRank();
|
||||
byte[] array = new byte[4 + arrayRank * 4 + valueArray.Length * VariantElementSize];
|
||||
int num = 0;
|
||||
byte[] bytes = BitConverter.GetBytes(arrayRank);
|
||||
bytes.CopyTo(array, num);
|
||||
num += bytes.Count();
|
||||
int[] array2 = new int[arrayRank];
|
||||
for (int i = 0; i < array2.Count(); i++)
|
||||
{
|
||||
byte[] bytes2 = BitConverter.GetBytes((uint)valueArray.GetLength(i));
|
||||
bytes2.CopyTo(array, num);
|
||||
num += bytes2.Count();
|
||||
array2[i] = 0;
|
||||
}
|
||||
PackArray(array, ref num, valueArray, array2, 0);
|
||||
result.Payload = array;
|
||||
result.Length = result.Payload.Count();
|
||||
return result;
|
||||
}
|
||||
|
||||
[GeneratedCode("Manually Avoid Code Metrics", "0.0.0.0")]
|
||||
private static void CalculateTypeAndSize(Type valueArrayElementType, ref ushort VariantElementType, ref int VariantElementSize)
|
||||
{
|
||||
if (valueArrayElementType == typeof(bool))
|
||||
{
|
||||
VariantElementType = ASBEnumFactory.DataTypeToInt(DataType.TypeBoolArray);
|
||||
VariantElementSize = 1;
|
||||
}
|
||||
else if (valueArrayElementType == typeof(sbyte))
|
||||
{
|
||||
VariantElementType = ASBEnumFactory.DataTypeToInt(DataType.TypeSByteArray);
|
||||
VariantElementSize = 1;
|
||||
}
|
||||
else if (valueArrayElementType == typeof(byte))
|
||||
{
|
||||
VariantElementType = ASBEnumFactory.DataTypeToInt(DataType.TypeByteArray);
|
||||
VariantElementSize = 1;
|
||||
}
|
||||
else if (valueArrayElementType == typeof(ushort))
|
||||
{
|
||||
VariantElementType = ASBEnumFactory.DataTypeToInt(DataType.TypeUInt16Array);
|
||||
VariantElementSize = 2;
|
||||
}
|
||||
else if (valueArrayElementType == typeof(uint))
|
||||
{
|
||||
VariantElementType = ASBEnumFactory.DataTypeToInt(DataType.TypeUInt32Array);
|
||||
VariantElementSize = 4;
|
||||
}
|
||||
else if (valueArrayElementType == typeof(ulong))
|
||||
{
|
||||
VariantElementType = ASBEnumFactory.DataTypeToInt(DataType.TypeUInt64Array);
|
||||
VariantElementSize = 8;
|
||||
}
|
||||
else if (valueArrayElementType == typeof(short))
|
||||
{
|
||||
VariantElementType = ASBEnumFactory.DataTypeToInt(DataType.TypeInt16Array);
|
||||
VariantElementSize = 2;
|
||||
}
|
||||
else if (valueArrayElementType == typeof(int))
|
||||
{
|
||||
VariantElementType = ASBEnumFactory.DataTypeToInt(DataType.TypeInt32Array);
|
||||
VariantElementSize = 4;
|
||||
}
|
||||
else if (valueArrayElementType == typeof(long))
|
||||
{
|
||||
VariantElementType = ASBEnumFactory.DataTypeToInt(DataType.TypeInt64Array);
|
||||
VariantElementSize = 8;
|
||||
}
|
||||
else if (valueArrayElementType == typeof(float))
|
||||
{
|
||||
VariantElementType = ASBEnumFactory.DataTypeToInt(DataType.TypeFloatArray);
|
||||
VariantElementSize = 4;
|
||||
}
|
||||
else if (valueArrayElementType == typeof(double))
|
||||
{
|
||||
VariantElementType = ASBEnumFactory.DataTypeToInt(DataType.TypeDoubleArray);
|
||||
VariantElementSize = 8;
|
||||
}
|
||||
else if (valueArrayElementType == typeof(string))
|
||||
{
|
||||
VariantElementType = ASBEnumFactory.DataTypeToInt(DataType.TypeStringArray);
|
||||
VariantElementSize = 0;
|
||||
}
|
||||
else if (valueArrayElementType == typeof(DateTime))
|
||||
{
|
||||
VariantElementType = ASBEnumFactory.DataTypeToInt(DataType.TypeDateTimeArray);
|
||||
VariantElementSize = 8;
|
||||
}
|
||||
else if (valueArrayElementType == typeof(Guid))
|
||||
{
|
||||
VariantElementType = ASBEnumFactory.DataTypeToInt(DataType.TypeGuidArray);
|
||||
VariantElementSize = Guid.Empty.ToByteArray().Count();
|
||||
}
|
||||
else if (valueArrayElementType == typeof(byte[]))
|
||||
{
|
||||
VariantElementType = ASBEnumFactory.DataTypeToInt(DataType.TypeByteStringArray);
|
||||
VariantElementSize = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private static void PackArray(byte[] Payload, ref int PayloadIndex, Array valueArray, int[] DimensionIndices, int Dimension)
|
||||
{
|
||||
if (Dimension == DimensionIndices.Count() - 1)
|
||||
{
|
||||
for (int i = 0; i < valueArray.GetLength(Dimension); i++)
|
||||
{
|
||||
DimensionIndices[Dimension] = i;
|
||||
byte[] array = PackArrayElement(valueArray.GetValue(DimensionIndices));
|
||||
array.CopyTo(Payload, PayloadIndex);
|
||||
PayloadIndex += array.Count();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int j = 0; j < valueArray.GetLength(Dimension); j++)
|
||||
{
|
||||
DimensionIndices[Dimension] = j;
|
||||
PackArray(Payload, ref PayloadIndex, valueArray, DimensionIndices, Dimension + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[GeneratedCode("Manually Avoid Code Metrics", "0.0.0.0")]
|
||||
private static byte[] PackArrayElement(object element)
|
||||
{
|
||||
if (element == null)
|
||||
{
|
||||
return new byte[0];
|
||||
}
|
||||
if (element.GetType() == typeof(bool))
|
||||
{
|
||||
return BitConverter.GetBytes((bool)element);
|
||||
}
|
||||
if (element.GetType() == typeof(sbyte))
|
||||
{
|
||||
return BitConverter.GetBytes((sbyte)element);
|
||||
}
|
||||
if (element.GetType() == typeof(byte))
|
||||
{
|
||||
return BitConverter.GetBytes((byte)element);
|
||||
}
|
||||
if (element.GetType() == typeof(ushort))
|
||||
{
|
||||
return BitConverter.GetBytes((ushort)element);
|
||||
}
|
||||
if (element.GetType() == typeof(uint))
|
||||
{
|
||||
return BitConverter.GetBytes((uint)element);
|
||||
}
|
||||
if (element.GetType() == typeof(ulong))
|
||||
{
|
||||
return BitConverter.GetBytes((ulong)element);
|
||||
}
|
||||
if (element.GetType() == typeof(short))
|
||||
{
|
||||
return BitConverter.GetBytes((int)element);
|
||||
}
|
||||
if (element.GetType() == typeof(int))
|
||||
{
|
||||
return BitConverter.GetBytes((int)element);
|
||||
}
|
||||
if (element.GetType() == typeof(long))
|
||||
{
|
||||
return BitConverter.GetBytes((int)element);
|
||||
}
|
||||
if (element.GetType() == typeof(float))
|
||||
{
|
||||
return BitConverter.GetBytes((float)element);
|
||||
}
|
||||
if (element.GetType() == typeof(double))
|
||||
{
|
||||
return BitConverter.GetBytes((double)element);
|
||||
}
|
||||
if (element.GetType() == typeof(string))
|
||||
{
|
||||
return Encoding.Unicode.GetBytes((string)element);
|
||||
}
|
||||
if (element.GetType() == typeof(DateTime))
|
||||
{
|
||||
return BitConverter.GetBytes(((DateTime)element).ToBinary());
|
||||
}
|
||||
if (element.GetType() == typeof(Guid))
|
||||
{
|
||||
return ((Guid)element).ToByteArray();
|
||||
}
|
||||
if (element.GetType() == typeof(byte[]))
|
||||
{
|
||||
return (byte[])element;
|
||||
}
|
||||
return new byte[0];
|
||||
}
|
||||
}
|
||||
+4269
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,14 @@
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.Versioning;
|
||||
|
||||
[assembly: AssemblyTrademark("Refer to: https://sw.aveva.com/legal/trademarks")]
|
||||
[assembly: AssemblyCompany("AVEVA Software, LLC")]
|
||||
[assembly: AssemblyConfiguration("Release")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2020 AVEVA Group plc and its subsidiaries. All rights reserved.")]
|
||||
[assembly: AssemblyFileVersion("2018.4.20078.1")]
|
||||
[assembly: AssemblyInformationalVersion("4.4.6")]
|
||||
[assembly: AssemblyProduct("PCS WCF Services")]
|
||||
[assembly: AssemblyTitle("aaServicesContractIData")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,23 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<AssemblyName>aaServicesContractIData</AssemblyName>
|
||||
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
|
||||
<TargetFramework>net40</TargetFramework>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<LangVersion>14.0</LangVersion>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup />
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="aaServicesCommonDataContracts" />
|
||||
<Reference Include="System.ServiceModel" />
|
||||
<Reference Include="aaServicesContractIAuthenticateASB" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="aaServicesCommon" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user