Click or drag to resize

TypedMapperExtensionTMapperCommand Method

Fired when a mapper command has been invoked.

Namespace:  NetQuarry.Data
Assembly:  EAP.Mapper (in EAP.Mapper.dll) Version: 2.0.0.0 (4.6.8.0)
Syntax
public virtual void MapperCommand(
	T sender,
	EAPCommandEventArgs e
)

Parameters

sender
Type: T
The event's sender.
e
Type: NetQuarryEAPCommandEventArgs
Event arguments.
Examples
The following MapperCommand handler demonstrates how to position the mapper to the record(s) on which to execute the command.
public override void MapperCommand(IMapper sender, EAPCommandEventArgs e)
{
    if (e.CommandName == "myCommand")
    {
           using (IMapper clone = new Mapper())
           {
               ArrayList    lstKeys = null;

               //--- If RowKey explicitly provided use that, else use 

               if (!e.RowKey.IsNullOrEmpty())
               {
                   lstKeys = new ArrayList(1);
                   lstKeys.Add(e.RowKey);
               }
               else
               {
                   lstKeys = sender.Exec(MapperExecCmds.SelectedKeys, 0) as ArrayList;
               }

               //--- Clone without adding flavors so far.
               //--- In fact, don't use existing flavor.  From list view some things we want might be unavailable. [7/2/09 CW]

               sender.Clone(clone, MapperCloneFlags.NoFlavorCopy | MapperCloneFlags.NoRequery);

               string sFilename = "vcard.vcf";

               if (lstKeys.Count == 1)
               {
                   clone.Filters.Add("pk", clone.RowKeyFilter(EAPUtil.ToString(lstKeys[0])));
               }

               clone.Requery(0);
           }
    }
}
See Also

Reference

TypedMapperExtensionTMapperCommand(T, EAPCommandEventArgs)