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.
随机推荐
- UVA 11100 The Trip, 2007 贪心(输出比较奇葩)
题意:给出n个包的大小,规定一个大包能装一个小包,问最少能装成几个包. 只要排序,然后取连续出现次数最多的数的那个次数.输出注意需要等距输出. 代码: /* * Author: illuz <i ...
- SQLServer 复制中移除和加入公布而不初始化全部项目
-- 若提前"禁止架构更改".新增的列不会自己主动加入大公布.此时应使用 sp_articlecolumn 加入列 EXEC sp_changepublication @publi ...
- H3C TE老版本OSPF正确配置
R1配置: ---------------------------------------------------- # sysname RT1# super password level 3 cip ...
- HttpAsyncClient 做并发长连接的一个实例
HttpAsyncClient 做并发长连接的一个实例 import java.util.concurrent.CountDownLatch; import org.apache.http.HttpR ...
- android插件技术-apkplug于OSGI服务基础-08
我们提供 apkplug 下OSGI使用demo 源代码托管地址为 http://git.oschina.net/plug/OSGIService 一 OSGI与android Service 异同点 ...
- FusionCharts參数中文说明
FushionCharts是把抽象数据图示化的套件,使用方便,配置简单.其相关參数中文说明例如以下. 功能特性 animation 是否动画显示数据,默觉得 1( ...
- python版本wifi共享工具
原先不知道win7系统也可以当作无线路由器,既然知道了这个东西那么就搞搞了 使用python写的一个wifi共享工具,还不够完善,有些功能还没做(说明:internet共享连接需要手动设置)..... ...
- 无法解析该名称 outlook必须处于联机,控制面板删除账户
无法解析该名称 outlook必须处于联机,控制面板删除账户
- Redis安装及简单測试
摘要: Redis是眼下业界很受到欢迎的一个内存数据库,一般用作系统的中间缓存系统,用以提升总体商业系统的吞吐量和响应速度.本文将简要介绍安装的主要过程以及给出一个简要的測试代码. 1. 系统环境和 ...
- 13-7-5 android Tabhost功能实现
开始使用了一个Activity做界面切换,采用visible.gone写法,感觉太麻烦了. layoutHousehold.setVisibility(View.GONE); layoutCamera ...