• 大小: 0.44M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2024-05-02
  • 语言: C#
  • 标签: 提醒  定时  

资源简介

定时提醒器,支持定时提醒。


资源截图

代码片段和文件信息

using System;
using System.Collections;
using System.Windows.Forms;

namespace Common
{
    /// 
    /// 对ListView点击列标题自动排序功能
    /// 

    /// 
    public class ListViewHelper
    {
        /// 
        /// 构造函数
        /// 

        /// 
        public static SortOrder[] sortOders = new SortOrder[5] { SortOrder.None SortOrder.None SortOrder.None SortOrder.None SortOrder.None };
        public ListViewHelper()
        {
            //
            // TODO: 在此处添加构造函数逻辑
            //
        }
        
        public static void ListView_ColumnClick(object sender ColumnClickEventArgs e)
        {
            ListView lv = sender as ListView;
            // 检查点击的列是不是现在的排序列.
            /*if (e.Column == (lv.ListViewItemSorter as ListViewColumnSorter).SortColumn)
            {
                // 重新设置此列的排序方法.
                if ((lv.ListViewItemSorter as ListViewColumnSorter).Order == SortOrder.Ascending)
                {
                    (lv.ListViewItemSorter as ListViewColumnSorter).Order = SortOrder.Descending;
                }
                else
                {
                    (lv.ListViewItemSorter as ListViewColumnSorter).Order = SortOrder.Ascending;
                }
            }
            else
            {
                // 设置排序列,默认为正向排序
                (lv.ListViewItemSorter as ListViewColumnSorter).SortColumn = e.Column;
                (lv.ListViewItemSorter as ListViewColumnSorter).Order = SortOrder.Ascending;
            }*/
            if(sortOders[e.Column]==SortOrder.None)
            {
                (lv.ListViewItemSorter as ListViewColumnSorter).Order=SortOrder.Ascending;
                sortOders[e.Column] = SortOrder.Ascending;
            }
            else if (sortOders[e.Column] == SortOrder.Ascending)
            {
                (lv.ListViewItemSorter as ListViewColumnSorter).Order = SortOrder.Descending;
                sortOders[e.Column] = SortOrder.Descending;
            }
            else
            {
                (lv.ListViewItemSorter as ListViewColumnSorter).Order = SortOrder.None;
                sortOders[e.Column] = SortOrder.None;
            }
            // 用新的排序方法对ListView排序
            ((ListView)sender).Sort();
        }
    }

    /// 
    /// 继承自IComparer
    /// 

    public class ListViewColumnSorter : IComparer
    {
        /// 
        /// 指定按照哪个列排序
        /// 

        private int ColumnToSort;
        /// 
        /// 指定排序的方式
        /// 

        private SortOrder OrderOfSort;
        /// 
        /// 声明CaseInsensitiveComparer类对象
        /// 

        private CaseInsensitiveComparer objectCompare;

        /// 
        /// 构造函数
        /// 

        public ListViewColumnSorter()
        {
            // 默认按第一列排序
            ColumnToSort = 0;

          

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2020-09-03 14:09  Remind\
     目录           0  2020-09-03 11:42  Remind\.vs\
     目录           0  2020-09-03 11:42  Remind\.vs\Remind\
     目录           0  2020-09-03 11:42  Remind\.vs\Remind\v16\
     文件       53760  2020-09-03 14:12  Remind\.vs\Remind\v16\.suo
     目录           0  2020-09-03 11:43  Remind\Backup\
     文件        3843  2010-09-02 23:19  Remind\Backup\ListViewNF.cs
     文件       39568  2010-09-03 00:33  Remind\Backup\MainForm.Designer.cs
     文件       23710  2010-09-03 00:33  Remind\Backup\MainForm.cs
     文件       29566  2010-09-03 00:33  Remind\Backup\MainForm.resx
     文件        2079  2010-08-31 14:57  Remind\Backup\NewTime.cs
     文件         490  2010-08-26 11:47  Remind\Backup\Program.cs
     目录           0  2020-09-03 11:43  Remind\Backup\Properties\
     文件        1368  2010-08-26 11:46  Remind\Backup\Properties\AssemblyInfo.cs
     文件        3363  2010-09-02 12:49  Remind\Backup\Properties\Resources.Designer.cs
     文件        6465  2010-09-02 12:49  Remind\Backup\Properties\Resources.resx
     文件        1091  2010-08-26 11:46  Remind\Backup\Properties\Settings.Designer.cs
     文件         249  2010-08-26 11:46  Remind\Backup\Properties\Settings.settings
     文件        4476  2010-09-03 00:12  Remind\Backup\Remind.csproj
     文件         901  2010-09-02 22:53  Remind\Backup\Remind.sln
     文件        6548  2010-09-03 00:32  Remind\Backup\RemindNote.Designer.cs
     文件         570  2010-09-03 00:32  Remind\Backup\RemindNote.cs
     文件       17152  2010-09-03 00:32  Remind\Backup\RemindNote.resx
     目录           0  2020-09-03 11:43  Remind\Backup\Resources\
     文件       14516  2010-09-02 12:49  Remind\Backup\Resources\my128128.jpg
     文件        2583  2010-09-02 21:15  Remind\Backup\StartByWindows.cs
     文件        7358  2010-09-02 19:23  Remind\Backup\myicon.ico
     文件        5176  2010-09-02 00:08  Remind\Common.cs
     文件        3843  2010-09-02 23:19  Remind\ListViewNF.cs
     文件       39540  2020-09-03 13:59  Remind\MainForm.Designer.cs
     文件       23280  2020-09-03 14:09  Remind\MainForm.cs
............此处省略57个文件信息

评论

共有 条评论