当前位置: 首页>>代码示例>>C#>>正文


C# DetailsListView.ChangeItemForeColor方法代码示例

本文整理汇总了C#中OpenTween.OpenTweenCustomControl.DetailsListView.ChangeItemForeColor方法的典型用法代码示例。如果您正苦于以下问题:C# DetailsListView.ChangeItemForeColor方法的具体用法?C# DetailsListView.ChangeItemForeColor怎么用?C# DetailsListView.ChangeItemForeColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OpenTween.OpenTweenCustomControl.DetailsListView的用法示例。


在下文中一共展示了DetailsListView.ChangeItemForeColor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ChangeItemStyleRead

        private void ChangeItemStyleRead(bool Read, ListViewItem Item, PostClass Post, DetailsListView DList)
        {
            Font fnt;
            //フォント
            if (Read)
            {
                fnt = _fntReaded;
                Item.SubItems[5].Text = "";
            }
            else
            {
                fnt = _fntUnread;
                Item.SubItems[5].Text = "★";
            }
            //文字色
            Color cl;
            if (Post.IsFav)
                cl = _clFav;
            else if (Post.RetweetedId > 0)
                cl = _clRetweet;
            else if (Post.IsOwl && (Post.IsDm || SettingDialog.OneWayLove))
                cl = _clOWL;
            else if (Read || !SettingDialog.UseUnreadStyle)
                cl = _clReaded;
            else
                cl = _clUnread;

            if (DList == null || Item.Index == -1)
            {
                Item.ForeColor = cl;
                if (SettingDialog.UseUnreadStyle)
                    Item.Font = fnt;
            }
            else
            {
                DList.Update();
                if (SettingDialog.UseUnreadStyle)
                    DList.ChangeItemFontAndColor(Item.Index, cl, fnt);
                else
                    DList.ChangeItemForeColor(Item.Index, cl);
                //if (_itemCache != null) DList.RedrawItems(_itemCacheIndex, _itemCacheIndex + _itemCache.Length - 1, false);
            }
        }
开发者ID:lupeeloveee,项目名称:OpenTween,代码行数:43,代码来源:Tween.cs

示例2: ChangeItemStyleRead

        private void ChangeItemStyleRead(bool Read, ListViewItem Item, PostClass Post, DetailsListView DList)
        {
            Font fnt;
            //フォント
            if (Read)
            {
                fnt = _fntReaded;
                Item.SubItems[5].Text = "";
            }
            else
            {
                fnt = _fntUnread;
                Item.SubItems[5].Text = "★";
            }
            //文字色
            Color cl;
            if (Post.IsFav)
                cl = _clFav;
            else if (Post.RetweetedId > 0)
                cl = _clRetweet;
            else if (Post.IsOwl && (Post.IsDm || SettingDialog.OneWayLove))
                cl = _clOWL;
            else if (Read || !SettingDialog.UseUnreadStyle)
                cl = _clReaded;
            else
                cl = _clUnread;

            var conv = new Func<string, string>(str => Regex.Replace(str, @"[  \r\n\t]", ""));
            var newp = conv(Post.TextFromApi);

            if (_cfgCommon.ShowStolenTweetWithColor && !(Post.RetweetedId > 0) && _statuses._statuses.Any(_ => conv(_.Value.TextFromApi) == newp && _.Value.CreatedAt.CompareTo(Post.CreatedAt) < 0))
            {
                cl = _clStolen;
            }

            if (DList == null || Item.Index == -1)
            {
                Item.ForeColor = cl;
                if (SettingDialog.UseUnreadStyle)
                    Item.Font = fnt;
            }
            else
            {
                DList.Update();
                if (SettingDialog.UseUnreadStyle)
                    DList.ChangeItemFontAndColor(Item.Index, cl, fnt);
                else
                    DList.ChangeItemForeColor(Item.Index, cl);
                //if (_itemCache != null) DList.RedrawItems(_itemCacheIndex, _itemCacheIndex + _itemCache.Length - 1, false);
            }
        }
开发者ID:alicesanten,项目名称:OpenTween,代码行数:51,代码来源:Tween.cs


注:本文中的OpenTween.OpenTweenCustomControl.DetailsListView.ChangeItemForeColor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。