public PropertyRowSet_r? GetRecipientInfo(string server, string userName, string domain, string password, PropertyTagArray_r? columns)
{
#region Call NspiBind method to initiate a session between the client and the server.
uint flags = 0;
STAT stat = new STAT();
stat.CodePage = 0x4e4; // Set a valid code page.
stat.TemplateLocale = 0x409; // Set a valid LCID.
stat.SortLocale = 0x409; // Set a valid LCID.
// Set value for serverGuid
FlatUID_r guid = new FlatUID_r
{
Ab = new byte[16]
};
FlatUID_r? serverGuid = guid;
ErrorCodeValue result = this.nspiAdapter.NspiBind(flags, stat, ref serverGuid);
Site.Assert.AreEqual<ErrorCodeValue>(ErrorCodeValue.Success, result, "NspiBind should return Success!");
#endregion
#region Call NspiQueryRows method to get the recipient information.
stat.ContainerID = 0; // Set the container id to the id of default global address book container
uint tableCount = 0;
uint[] table = null;
uint requestCount = 5000;
PropertyRowSet_r? propertyRowSet = null;
result = this.nspiAdapter.NspiQueryRows(flags, ref stat, tableCount, table, requestCount, columns, out propertyRowSet);
Site.Assert.AreEqual<ErrorCodeValue>(ErrorCodeValue.Success, result, "NspiQueryRows should return Success!");
#endregion
uint returnValue = this.nspiAdapter.NspiUnbind(0);
Site.Assert.AreEqual<uint>(1, returnValue, "NspiUnbind method should return 1 (Success).");
return propertyRowSet;
}