C# - is
Checks if an object is compatible with a given type.
An is expression evaluates to
true if the provided expression is non-null, and the provided object can be cast to the provided type without causing an exception to be thrown.
The is keyword causes a compile-time warning if the expression is known to always be
true or to always be false, but typically evaluates type compatibility at run time.
The is operator cannot be overloaded.
Note that the
is operator only considers reference conversions, boxing conversions, and unboxing conversions. Other conversions, such as user-defined conversions, are not considered.
Anonymous methods are not allowed on the left side of the
is operator. This exception includes lambda expressions.
随机推荐
- 你不知道的JavaScript上卷笔记
你不知道的JavaScript上卷笔记 前言 You don't know JavaScript是github上一个系列文章 初看到这一标题的时候,感觉怎么老外也搞标题党,用这种冲突性比较强的题目 ...
- 【从翻译mos文章】正在实施的获取job的 session id
正在实施的获取job的 session id 参考原始: How to get the session Id of the Running Job (Doc ID 1604966.1) 申请: Ora ...
- hdu 折线切割平面 (java)
问题: 仅仅要找到规律问题就攻克了,在做题时应该细致去发现数与数之间的联系. 折线切割平面 Time Limit: 2000/1000 MS (Java/Others) Memory Limit ...
- PV FV PMT
- UVA 12263 Rankings(拓扑排序)
给出一个n个数的序列1,然后有m个改动(a, b),在序列2中a跟b在序列中的相对顺序改变.求符合题意的序列2. 题中说道如果一个数的位置不确定,则输出‘?' ,仔细想想,这种情况是不会存在的,因为在 ...
- 提高SQL执行效率
原文地址:http://www.cnblogs.com/hlxs/archive/2012/05/07/2487082.html 1.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 ...
- ClientID 获取服务端控件,客户端id的方法
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx. ...
- Codeforces Round#308
A题,看样例就知道要求什么, 水过去 #include <stdio.h> #include <string.h> #include <stdlib.h> #i ...
- 小米2S Mk6.0.1 [只能做测试体验,不能使用]
上几张高清图片.. 说明: 此版本只能做测试体验,不能做实际使用. 开发者: laser杨万荣 感谢: 秋叶随风ivan, m1cha 及 MoKee Open Source的各位开发者 下载地址:链 ...
- 原创游戏,金庸群侠传X 0.5公布
首先说一下背景,我个人从小特别爱玩游戏,对小时候一款游戏<金庸群侠传>DOS版更是情有独钟,自己工作以后,利用业余时间自己整了一个原创的改编版丢网上(找图片.音乐.写剧情更是虐心之极,耗时 ...