zoukankan      html  css  js  c++  java
  • Reflector反编译结果的T?相对应的为Nullable(Of T)

        1、用Reflector反编译时,有时候会产生T?,这时候可用Nullable(Of T)代替,通过HasValue来判断是否有值,而Value能获取T的值。

        2、用Reflector反编译时,有时候会产生

        Try
            ...
        Catch X As Object
            ...
        End Try

        这时候应该用Exception代替Object,表示异常。

        3、用Reflector反编译时,有时候会产生

        Public Custom Event X As EventHandler
            AddHandler(ByVal value As EventHandler)
                Dim handler2 As EventHandler
                Dim x As EventHandler = Me.X
                Do
                    handler2 = x
                    Dim handler3 As EventHandler = DirectCast(Delegate.Combine(handler2, value), EventHandler)
                    x = Interlocked.CompareExchange(Of EventHandler)((Me.X), handler3, handler2)
                Loop While (Not x Is handler2)
            End AddHandler
            RemoveHandler(ByVal value As EventHandler)
                Dim handler2 As EventHandler
                Dim x As EventHandler = Me.X
                Do
                    handler2 = x
                    Dim handler3 As EventHandler = DirectCast(Delegate.Remove(handler2, value), EventHandler)
                    x = Interlocked.CompareExchange(Of EventHandler)((Me.X), handler3, handler2)
                Loop While (Not x Is handler2)
            End RemoveHandler
        End Event

         Private X As EventHandler

        这时候应该用去掉Custom,并删除AddHandler和RemoveHandler两个过程,以及声明。

        4、用Reflector反编译时,有时候会产生

        Public Property X As Integer
            Get
            Set (ByVal value As Integer)
        End Property

        <CompilerGenerated> _
        Private <X>k__BackingField As Integer

        这时候应该删除Get和Set语句,并删除编译产出的变量声明,或者补足Get和Set语句。

  • 相关阅读:
    SpringBoot-web场景-静态资源访问 & 欢迎页支持 & 自定义Favicon & 静态资源配置原理
    SpringBoot配置文件yaml文件的用法 & 自定义类绑定的配置提示
    设置 TabBarItem 选中时的图片及文字颜色
    iOS 9 使用HTTP的方法
    php单双引号嵌套解决方案
    github desktop项目版本控制
    数据库-内 | 左| 右| 全连接
    05_总结一下,以软件开发周期说明不同的测试使用
    04_用户需求 自己产品 竞争对手产品关系
    03_P52 课后作业
  • 原文地址:https://www.cnblogs.com/tulife/p/2217693.html
Copyright © 2011-2022 走看看