port from perforce
This commit is contained in:
59
meshToolsV5/src/Editor.Operators/Test.cs
Normal file
59
meshToolsV5/src/Editor.Operators/Test.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using Editor.Attributes;
|
||||
|
||||
namespace Editor.Operators
|
||||
{
|
||||
public class Test : OperatorBase
|
||||
{
|
||||
public override ushort OpId { get { return 7; } }
|
||||
|
||||
[IndexedType("int")]
|
||||
public ushort OutputIndex
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_OutputIndex;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_OutputIndex = value;
|
||||
RaisePropertyChanged();
|
||||
}
|
||||
}
|
||||
private ushort m_OutputIndex;
|
||||
|
||||
[IndexedType("int")]
|
||||
public ushort ValueIndex
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_ValueIndex;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_ValueIndex = value;
|
||||
RaisePropertyChanged();
|
||||
}
|
||||
}
|
||||
private ushort m_ValueIndex;
|
||||
|
||||
public Test()
|
||||
{
|
||||
}
|
||||
|
||||
public override byte[] Serialize()
|
||||
{
|
||||
using (var stream = new MemoryStream())
|
||||
{
|
||||
using (var writer = new BinaryWriter(stream))
|
||||
{
|
||||
writer.Write(OpId);
|
||||
writer.Write(m_OutputIndex);
|
||||
writer.Write(m_ValueIndex);
|
||||
return stream.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user