diff --git a/CSharp/Libraries/UniversalEditor.Essential/ObjectModels/Binary/BinaryObjectModel.cs b/CSharp/Libraries/UniversalEditor.Essential/ObjectModels/Binary/BinaryObjectModel.cs new file mode 100644 index 00000000..7a042de7 --- /dev/null +++ b/CSharp/Libraries/UniversalEditor.Essential/ObjectModels/Binary/BinaryObjectModel.cs @@ -0,0 +1,41 @@ +// +// BinaryObjectModel.cs +// +// Author: +// Mike Becker +// +// Copyright (c) 2019 Mike Becker +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +using System; +namespace UniversalEditor.ObjectModels.Binary +{ + public class BinaryObjectModel : ObjectModel + { + public byte[] Data { get; set; } = new byte[0]; + + public override void Clear() + { + Data = new byte[0]; + } + + public override void CopyTo(ObjectModel where) + { + BinaryObjectModel clone = (where as BinaryObjectModel); + if (clone == null) throw new ObjectModelNotSupportedException(); + + clone.Data = (Data.Clone() as byte[]); + } + } +} diff --git a/CSharp/Libraries/UniversalEditor.Essential/UniversalEditor.Essential.csproj b/CSharp/Libraries/UniversalEditor.Essential/UniversalEditor.Essential.csproj index 1bcba80d..d81f95e5 100644 --- a/CSharp/Libraries/UniversalEditor.Essential/UniversalEditor.Essential.csproj +++ b/CSharp/Libraries/UniversalEditor.Essential/UniversalEditor.Essential.csproj @@ -165,6 +165,7 @@ + @@ -179,6 +180,7 @@ +