首页 > 其他分享 >必须为接口 System.Collections.IComparer 实现

必须为接口 System.Collections.IComparer 实现

时间:2023-11-16 14:02:34浏览次数:31  
标签:IComparer Web TryCast System Telerik Collections Date RadDate

C# codes:

public class DateComparer : IComparer    
{     
    public int Compare(object x, object y)     
    {     
        if ((x as RadDate).Date < (y as RadDate).Date)     
        {     
            return -1;     
        }     
        else if ((x as RadDate).Date > (y as RadDate).Date)     
        {     
            return 1;     
        }     
        else     
        {     
            return 0;     
        }     
    }     
}

 

Converted to VB codes:

Public Class DateComparer    
       Implements IComparer     
       Public Function Compare(ByVal x As Object, ByVal y As Object) As Integer Implements System.Collections.IComparer.Compare                 If (TryCast(x, Telerik.Web.UI.RadDate)).Date < (TryCast(y, Telerik.Web.UI.RadDate)).Date Then     
               Return -1     
           ElseIf (TryCast(x, Telerik.Web.UI.RadDate)).Date > (TryCast(y, Telerik.Web.UI.RadDate)).Date Then     
               Return 1     
           Else     
               Return 0     
           End If     
       End Function     
   End Class



标签:IComparer,Web,TryCast,System,Telerik,Collections,Date,RadDate
From: https://blog.51cto.com/emanlee/8419001

相关文章

  • systemctl mask firewalld
    systemctlmaskfirewalldsystemctl--helpmaskNAME...MaskoneormoreunitsunmaskNAME...Unmaskoneormoreunits[root@hecs-98663~]#systemctlstatusfirewalld●firewalld.service-firewalld-dynamicfirewall......
  • subject organization is not system:nodes 问题解决
    在下面的issues找到了答案:https://github.com/kubernetes/kubernetes/issues/99504┌──[[email protected]]-[~]└─$kubectlgetcsrNAMEAGESIGNERNAMEREQUESTORREQU......
  • mkfs.xfs报错 mkfs.xfs: /dev/new/new_box appears to contain an existing fil
    在设置逻辑卷文件类型时候报错mkfs.xfs:/dev/new/new_boxappearstocontainanexistingfilesystem(ext4).mkfs.xfs:Usethe-foptiontoforceoverwrite.上面是说目标分区,已经存在一个文件系统但是我们有很需要他更改文件系统的话就加一个-f选项[root@server~]......
  • Collections工具类、(Arrasy.asList(xxx)的结果List是一个受限集合,不能添加和删除元素
     Arrasy.asList(arr)的结果List是一个受限集合,不能添加和删除元素  ......
  • docker system prune -a
    dockersystemprune-a  docker system prune -a 是一个Docker命令,用于清理Docker系统中未使用的镜像、容器、网络和数据卷等资源。这个命令会删除所有未被使用的资源,包括未被使用的...TRANSLATEwithxEnglishArabicHebrewPolishBulgarianHindi......
  • 随笔-Centos7 install systemtap
    SystemTapBeginnersGuideChapter2.UsingSystemTapThischapterinstructsusershowtoinstallSystemTap,andprovidesanintroductiononhowtorunSystemTapscripts.2.1.InstallationandSetupTodeploySystemTap,SystemTappackagesalongwiththeco......
  • oracle aud$造成system爆满问题
    我的数据库并没有开启对象审计,只有一些语句和权限的审计selectcount(*),usernamefromdba_audit_trailgroupbyusername;388"LIONIRPT"101062"YGLCUSR"57"APP_USR"2612712"PROM_MONITOR"1010"WALLET"4078"......
  • A Protection Measure-the river chief system
    Theriverandlakechiefsystem,namelytheriverchiefsystem,isanecologicalcivilizationconstructionsysteminnovationinwhichthepartyandgovernmentleadersatalllevelsserveasriverandlakechiefsandareresponsiblefororganizingandlead......
  • 关于 deamon 与 systemctl ,systemd , ubuntu20 自启动脚本
    deamon是指的守护进程,但是什么是守护进程呢,从网上查了一下,就是在后台运行的程序就叫做守护进程。     接下来看一下关于systemd的自启动的配置文件。       疑问:1 unit与target到底又什么关系呢?2到底有多少个unit......
  • System类
     System.arraycopy() ......