/// <summary> /// Handles the corresponding event. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs{ShopItemIndex}"/> instance containing the event data.</param> void ShopForm_RequestPurchase(ShopForm sender, EventArgs <ShopItemIndex> e) { using (var pw = ClientPacket.BuyFromShop(e.Item1, 1)) { Socket.Send(pw, ClientMessageType.GUI); } }
/// <summary> /// Adds support for dragging a /// <see cref="ShopForm.ShopItemPB"/> onto an <see cref="InventoryForm"/>. /// </summary> /// <param name="srcDDP">The <see cref="IDragDropProvider"/> that was dragged.</param> /// <param name="destDDP">The <see cref="IDragDropProvider"/> that that <paramref name="srcDDP"/> /// was dropped onto.</param> /// <returns>True if the drag-and-drop can be or was successful; otherwise false.</returns> bool Drop_ShopItemToInventory(IDragDropProvider srcDDP, IDragDropProvider destDDP) { if (!CanDrop_ShopItemToInventory(srcDDP, destDDP)) { return(false); } var src = (ShopForm.ShopItemPB)srcDDP; using (var pw = ClientPacket.BuyFromShop(src.Slot, 1)) { _gps.Socket.Send(pw, ClientMessageType.GUIItems); } return(true); }