using System;
using NexusDB.InterOp.Interfaces;
using NexusDB.InterOp.Extenders;
namespace NexusDB.Test
{
public class nxTestExtender: nxBaseExtender, InxBaseExtender
{
protected override bool InternalInterestedIn(InxExtendedObject anObject)
{
if ((anObject.Type() == nxObjectType.otCursor) &&
((anObject.Object() as InxCursor).TableName().ToUpper() == "ATEST"))
return true;
else
return false;
}
public override int RecordModify(InxEventRecordModify aData)
{
try
{
bool aBefore = aData.Before();
AddDebug("RecordModify: (Before = "+aBefore+")");
AddDebug(" Table Name: "+aData.Cursor().TableName());
AddDebug(" Field Count: "+aData.Cursor().FieldCount().ToString());
AddDebug(" New Data: "+nxExtenderHelpers.PrintFieldData(aData.Cursor(), aData.NewData()));
AddDebug(" Old Data: "+nxExtenderHelpers.PrintFieldData(aData.Cursor(), aData.OldData()));
}
finally
{
}
return 0;
}
public override int RecordGet(InxEventRecordGet aData)
{
try
{
bool aBefore = aData.Before();
AddDebug("RecordGet: (Before = "+aBefore+")");
AddDebug(" Table Name: "+aData.Cursor().TableName());
AddDebug(" Field Count: "+aData.Cursor().FieldCount().ToString());
AddDebug(" New Data: "+nxExtenderHelpers.PrintFieldData(aData.Cursor(), aData.NewData()));
}
finally
{
}
return 0;
}
public override int RecordDelete(InxEventRecordDelete aData)
{
try
{
bool aBefore = aData.Before();
AddDebug("RecordDelete: (Before = "+aBefore+")");
AddDebug(" Table Name: "+aData.Cursor().TableName());
AddDebug(" Field Count: "+aData.Cursor().FieldCount().ToString());
AddDebug(" New Data: "+nxExtenderHelpers.PrintFieldData(aData.Cursor(), aData.NewData()));
}
finally
{
}
return 0;
}
public override int RecordInsert(InxEventRecordInsert aData)
{
try
{
bool aBefore = aData.Before();
AddDebug("RecordInsert: (Before = "+aBefore+")");
AddDebug(" Table Name: "+aData.Cursor().TableName());
AddDebug(" Field Count: "+aData.Cursor().FieldCount().ToString());
AddDebug(" New Data: "+nxExtenderHelpers.PrintFieldData(aData.Cursor(), aData.NewData()));
}
finally
{
}
return 0;
}
}
}