TypedMapperExtensionTMapperCommand Method |
Namespace: NetQuarry.Data
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); } } }