示例#1
0
    void OnDoubleClick()
    {
        NOrder order = GameBaseInfo.Instance.othOrders.Find(x => x.id == Data.orderid);

        if (order != null)
        {
            string str  = "";
            int[]  cnts = order.GetCnts();
            int[]  ids  = order.GetItems();
            for (int i = 0; i < ids.Length; i++)
            {
                TItem item = Tables.Instance.GetTable <List <TItem> >(TableID.ITEMS).Find(x => x.id == ids[i]);
                str += item.name + "   X" + cnts[i] + "\n";
            }
            if (!string.IsNullOrEmpty(str))
            {
                StrText txt = new StrText(10074, str);
                UIHandler.Instance.Push(PageID.TEXT, txt);
            }
        }
        else
        {
            Debug.Log("order is null!");
        }
    }
示例#2
0
    public override void Refresh(object data)
    {
        base.Refresh(data);
        StrText Data = data as StrText;

        Refresh(Data.title, Data.content);
    }
示例#3
0
文件: MsgKF.cs 项目: dcrnyy/Aiyy
 public MsgKF(string openId, string msg)
 {
     touser       = openId;
     msgtype      = "text";
     text         = new StrText();
     text.content = msg;
 }
示例#4
0
        protected override void OnMouseDown(MouseEventArgs e)
        {
            if (StrText.Length == 0)
            {
                return;
            }
            Graphics grfx  = CreateGraphics();
            float    xPrev = 0;
            int      i;

            for (i = 0; i < StrText.Length; i++)
            {
                SizeF sizef = grfx.MeasureString(StrText.Substring(0, i + 1),
                                                 Font, PointF.Empty, StringFormat.GenericTypographic);
                if (Math.Abs(e.X - xPrev) < Math.Abs(e.X - sizef.Width))
                {
                    break;
                }
            }
            Insert = i;
            grfx.Dispose();
            PositionCaret();
        }