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.
随机推荐
- git配置流程
写的比较简略,主要是记录一下,以后配置别的机器的时候看一下,仅供参考. 1 安装 命令依赖包 sudo apt-get install git-core git-gui git-doc 2 设置SSH ...
- ActiveMQ源码架构解析第一节(转)
工作四年已久,也快到了而立之年,本人也酷爱技术,总是想找一些途径来提升自己,想着温故而知新所以就写起了博客,然而写博客这个想法也是酝酿了很久,近期也看到了有很多人在问关于ActiveMQ的相关问题,有 ...
- 2)JS动态生成HTML元素的爬取
2)JS动态生成HTML元素的爬取 import java.util.List; import org.openqa.selenium.By; import org.openqa.selenium.W ...
- android_重写button样式
这样的button样式应该源自IOS.假设安卓上实现,则须要使用android上面的layer-list来实现. 事实上layer-list有点像framlayout,作用就是覆盖. 先说一下实现原理 ...
- Android编程 获取网络连接状态 及调用网络配置界面
获取网络连接状态 随着3G和Wifi的推广,越来越多的Android应用程序需要调用网络资源,检测网络连接状态也就成为网络应用程序所必备的功能. Android平台提供了ConnectivityMan ...
- Redis 的性能幻想与残酷现实(转)
2011 年,当初选择 Redis 作为主要的内存数据存储,主要吸引我的是它提供多样的基础数据结构可以很方便的实现业务需求.另一方面又比较担心它的性能是否足以支撑,毕竟当时 Redis 还属于比较新的 ...
- python学习笔记之五:抽象
本文会介绍如何将语句组织成函数,还会详细介绍参数和作用域的概念,以及递归的概念及其在程序中的用途. 一. 创建函数 函数是可以调用,它执行某种行为并且返回一个值.用def语句即可定义一个函数:(并非所 ...
- 上传App时遇IDFA错误问题
今天上传App时遇到下图1的情况,很纳闷,又是苹果新规. 通常是第三方的库引起啦,马上想到百度统计了,打开SDK下载页面看看简单介绍,里面有讲到这个问题了. 图2就是这次改动的原因. 更新SDK,之前 ...
- crm工作机会实体
using System; using Microsoft.Xrm.Sdk; using Microsoft.Crm.Sdk.Messages; public class Opport ...
- C++ Primer 学习笔记_57_类和数据抽象 --管理指针成员
复印控制 --管理指针成员 引言: 包括指针的类须要特别注意复制控制.原因是复制指针时.一个带指针成员的指针类 class HasPtr { public: HasPtr(int *p,int i): ...