mirror of
https://github.com/S7NetPlus/s7netplus.git
synced 2026-02-17 22:38:27 +08:00
Removed the Controls project and existing Test projects. Added new Test project and references to NUnit and Should projects for testing. Extracted IPlc interface to help test projects that reference this library. Also implemented the IDisposable interface on the Plc object so that references to mSocket would be cleaned up appropriately when the object is blown away.
43 lines
776 B
C#
43 lines
776 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace S7.Types
|
|
{
|
|
class ByteArray
|
|
{
|
|
List<byte> list = new List<byte>();
|
|
|
|
public byte[] array
|
|
{
|
|
get { return list.ToArray(); }
|
|
}
|
|
|
|
public ByteArray()
|
|
{
|
|
list = new List<byte>();
|
|
}
|
|
|
|
public ByteArray(int size)
|
|
{
|
|
list = new List<byte>(size);
|
|
}
|
|
|
|
public void Clear()
|
|
{
|
|
list = new List<byte>();
|
|
}
|
|
|
|
public void Add(byte item)
|
|
{
|
|
list.Add(item);
|
|
}
|
|
|
|
public void Add(byte[] items)
|
|
{
|
|
list.AddRange(items);
|
|
}
|
|
}
|
|
}
|