惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

GbyAI
GbyAI
J
Java Code Geeks
雷峰网
雷峰网
WordPress大学
WordPress大学
宝玉的分享
宝玉的分享
云风的 BLOG
云风的 BLOG
V
Visual Studio Blog
V
Vulnerabilities – Threatpost
S
Securelist
The Hacker News
The Hacker News
The Register - Security
The Register - Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Help Net Security
Help Net Security
G
Google Developers Blog
Hugging Face - Blog
Hugging Face - Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
M
MIT News - Artificial intelligence
AI
AI
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
The GitHub Blog
The GitHub Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Schneier on Security
Schneier on Security
N
Netflix TechBlog - Medium
T
The Blog of Author Tim Ferriss
Google DeepMind News
Google DeepMind News
Hacker News - Newest:
Hacker News - Newest: "LLM"
H
Hacker News: Front Page
博客园 - 司徒正美
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
B
Blog
Microsoft Azure Blog
Microsoft Azure Blog
大猫的无限游戏
大猫的无限游戏
Security Latest
Security Latest
Engineering at Meta
Engineering at Meta
N
News and Events Feed by Topic
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
酷 壳 – CoolShell
酷 壳 – CoolShell
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Threat Research - Cisco Blogs
U
Unit 42
V
V2EX
V2EX - 技术
V2EX - 技术
L
LINUX DO - 最新话题
aimingoo的专栏
aimingoo的专栏
Microsoft Security Blog
Microsoft Security Blog
Recorded Future
Recorded Future
P
Privacy & Cybersecurity Law Blog
美团技术团队
小众软件
小众软件
F
Fortinet All Blogs

博客园 - 瓶子

泛型抽象厂。模式练习1 范型与反射乱画。 小技巧:用javascript实现asp.net中ispostback功能! - 瓶子 - 博客园 给定一个集合,求出其所有子集合 把以"文本文件(制表符分割)"保存的EXCEL文件导进SQLSERVER2000的DEMO! ObjectARX 2007已经发布一个多月了.贴下载地址! sql server 2005 排序规则与大小写敏感   (sql server2005学习笔记1) HELLO MONO! 德里达逝世了! - 瓶子 - 博客园 Is there any way to get detailed error information for Win32 errors when using Platform Invoke? CBI——宇宙新的婴儿照片 Longhorn的糟糕体验! en! ~c#真的好简洁。贴段C#到VB的小典型。 与音乐,,纪念Arthur Rimbaud诞辰150周年 SharpDevelop 并不RUN OUTSIDE IIS 的RUN OUTSIDE IIS 有关SQL排序规则---------即"无法解决 equal to 操作的排序规则冲突"等等的菜问题. 兰波生平 今天,终于注册了BLOG了.是菜鸟.请大家关照! 还有我的小简介
为什么ICON类型没有EQUALS方法呢?
瓶子 · 2004-06-08 · via 博客园 - 瓶子

以下声明一个属性,当属性改变前后时候,触发事件,如果ICON为当前的ICON则不改变属性,也不触发事件。

 Public Property [Icon]() As Icon
            Get
                Return _icon
            End Get
            Set(ByVal Value As Icon)
                If Not (_icon Is Value) Then
                    OnPropertyChanging([Property].Icon)
                    _icon = Value
                    OnPropertyChanged([Property].Icon)
                End If
            End Set

以上用IS来判断可以
如果用EQUALS来判断呢?可没有

奇怪的是ICON本身没有EQUALS方法,当是它的CLONE却有EQUALS方法,查MSDN没有找到。.

Public Property Icon() As Icon
Get
Return _icon
End Get
Set(ByVal Value As Icon)
 If _icon Is Nothing Then 
                OnPropertyChanging([Property].Icon)
                _icon = Value
                OnPropertyChanged([Property].Icon)
                Return
            End If
If Not (_icon.Equals(Value)) Then
OnPropertyChanging([Property].Icon)
_icon = Value
OnPropertyChanged([Property].Icon)
End If
End Set
End Property
-----------------------------------------------------------------

Ninputer(装配脑袋) 的提醒:

Icon是有Equals方法的,但VB默认将它隐藏,除非他由你自己编写并显式继承自Object。这完全是IDE的问题,你可以写Icon.Equals,虽然不自动弹出,但绝对没有任何问题,放心写吧。