Exemple #1
0
        void gridView_CustomSuperTip(object sender, CustomToolTipEventArgs e)
        {
            if (e.HitInfo.InRowCell && IsPledgeColumn(e.HitInfo.Column))
            {
                var auctionPledge = GetPledge(e.HitInfo.Column, e.HitInfo.RowHandle);
                if (auctionPledge == null)
                {
                    return;
                }
                var otherPledges = thirdPartyPledges[new PledgeKey(auctionPledge)];

                if (otherPledges.Count == 0)
                {
                    e.SuperTip = Utilities.CreateSuperTip(
                        title: auctionPledge.PledgeType + " for " + auctionPledge.Item.ItemName + " on " + auctionPledge.Item.AuctionName,
                        body: "No other pledges"
                        );
                }
                else
                {
                    e.SuperTip = Utilities.CreateSuperTip(
                        title: "Other " + auctionPledge.PledgeType.ToLowerInvariant() + " pledges for " + auctionPledge.Item.ItemName + " on " + auctionPledge.Item.AuctionName + ":",
                        body: otherPledges.Join(Environment.NewLine,
                                                p => String.Format(CultureInfo.CurrentCulture,
                                                                   " • {0}:  {1:c}  {2}",
                                                                   p.Person.FullName, p.Amount, p.Note
                                                                   ).Replace("&", "&&").TrimEnd(' ')
                                                )
                        );
                }
            }
        }
Exemple #2
0
 private void pledgesView_CustomSuperTip(object sender, CustomToolTipEventArgs e)
 {
     if (e.HitInfo.Column == colAmount && e.HitInfo.InRowCell)
     {
         var row = (Pledge)pledgesView.GetRow(e.HitInfo.RowHandle);
         if (row != null)
         {
             e.SuperTip = Utilities.CreateSuperTip("Unpaid Amount", controller.GetUnlinkedAmountDescription(row));
         }
     }
     else if (e.HitInfo.Column == colLinkAmount)
     {
         e.SuperTip = Utilities.CreateSuperTip("Amount to Link", "Enter the portion of this pledge that this payment is intended to pay.");
     }
 }