Exemplo n.º 1
0
        //protected override PCellStyle OnGetCellStyle(object listItem, object value, IPCell col)
        //{
        //    if (StyleOut == null)
        //    {
        //        StyleOut = new PCellStyle();
        //        StyleOut.Alternate = false;
        //        StyleOut.BorderBrush.Color = Color.FromArgb(200, Color.Green);
        //        StyleOut.BorderBrush.SColor = Color.FromArgb(255, Color.Green);
        //        StyleOut.BackBrush.Color = Color.FromArgb(40, Color.Green);
        //        StyleOut.BackBrush.SColor = Color.FromArgb(120, Color.Green);

        //        StyleIn = new PCellStyle();
        //        StyleIn.Alternate = false;
        //        StyleIn.BorderBrush.Color = Color.FromArgb(200, Color.Orange);
        //        StyleIn.BorderBrush.SColor = Color.FromArgb(255, Color.Orange);
        //        StyleIn.BackBrush.Color = Color.FromArgb(40, Color.Orange);
        //        StyleIn.BackBrush.SColor = Color.FromArgb(120, Color.Orange);
        //    }
        //    PCellStyle pcs = base.OnGetCellStyle(listItem, value, col);
        //    if (col == null && listItem is Message)
        //    {
        //        if (((Message)listItem).User == FlowEnvir.Personal.User)
        //            pcs = StyleOut;
        //        else
        //            pcs = StyleIn;
        //    }
        //    return pcs;
        //}

        protected override void OnDrawHeader(LayoutListDrawArgs e)
        {
            var chatItem = e.Item as Message;
            var style    = OnGetCellStyle(chatItem, null, null);

            e.Context.DrawGlyph(chatItem.User == GuiEnvironment.User ? GlyphType.SignOut : GlyphType.SignIn, e.Bound, style);
            //base.OnPaintHeader(context, index, dataSource, bound, state);
        }
Exemplo n.º 2
0
        protected override void OnDrawHeader(LayoutListDrawArgs e)
        {
            var node = e.Item as BindableNode <T>;

            if (node != null)
            {
                var row = node.Data;
                if (row is IStatusable statused)
                {
                    var glyph = statused.Status == DBStatus.Archive ? GlyphType.FlagCheckered : GlyphType.Flag;
                    var color = Colors.Black;
                    switch (statused.Status)
                    {
                    case DBStatus.Actual:
                        color = Colors.DarkGreen;
                        break;

                    case DBStatus.New:
                        color = Colors.DarkBlue;
                        break;

                    case DBStatus.Edit:
                        color = Colors.DarkOrange;
                        break;

                    case DBStatus.Error:
                        color = Colors.DarkRed;
                        break;

                    case DBStatus.Delete:
                        color = Colors.Purple;
                        break;
                    }


                    var imgRect  = new Rectangle(e.Bound.X + 1, e.Bound.Y + 1, 15 * listInfo.Scale, 15 * listInfo.Scale);
                    var textRect = new Rectangle(imgRect.Right, imgRect.Top, e.Bound.Width - imgRect.Width, e.Bound.Height);
                    //string val = (index + 1).ToString() + (row.DBState != DBUpdateState.Default ? (" " + row.DBState.ToString()[0]) : "");
                    e.Context.DrawCell(listInfo.StyleHeader, null, e.Bound, textRect, e.State);
                    e.Context.DrawGlyph(glyph, imgRect, color);
                }
                if (node is BindableNode listNode)
                {
                    string val = string.Format("({0})", ((IList)listNode).Count);
                    e.Context.DrawCell(listInfo.StyleHeader, val, e.Bound, e.Bound, e.State);
                }
            }
            else
            {
                base.OnDrawHeader(e);
            }
        }
Exemplo n.º 3
0
        protected override void OnDrawHeader(LayoutListDrawArgs e)
        {
            if (e.Item is TableItemNode node)
            {
                if (node.Item is DBItem row)
                {
                    var glyph = row.Status == DBStatus.Archive ? GlyphType.FlagCheckered : GlyphType.Flag;
                    var color = Colors.Black;
                    if (row.Status == DBStatus.Actual)
                    {
                        color = Colors.DarkGreen;
                    }
                    else if (row.Status == DBStatus.New)
                    {
                        color = Colors.DarkBlue;
                    }
                    else if (row.Status == DBStatus.Edit)
                    {
                        color = Colors.DarkOrange;
                    }
                    else if (row.Status == DBStatus.Error)
                    {
                        color = Colors.DarkRed;
                    }
                    else if (row.Status == DBStatus.Delete)
                    {
                        color = Colors.Purple;
                    }


                    imgRect  = new Rectangle(e.Bound.X + 1, e.Bound.Y + 1, 15 * listInfo.Scale, 15 * listInfo.Scale);
                    textRect = new Rectangle(imgRect.Right, imgRect.Top, e.Bound.Width - imgRect.Width, e.Bound.Height);
                    //string val = (index + 1).ToString() + (row.DBState != DBUpdateState.Default ? (" " + row.DBState.ToString()[0]) : "");
                    e.Context.DrawCell(listInfo.StyleHeader, null, e.Bound, textRect, e.State);
                    e.Context.DrawGlyph(glyph, imgRect, color);
                }
                if (node.Item is IDBTableView)
                {
                    string val = string.Format("({0})", ((IList)node.Item).Count);
                    e.Context.DrawCell(listInfo.StyleHeader, val, e.Bound, e.Bound, e.State);
                }
            }
            else
            {
                base.OnDrawHeader(e);
            }
        }