Gets a value indicating whether the corresponding SpecialName attribute is set in the FieldAttributes enumerator.

Namespace:  System.Reflection
Assembly:  mscorlib (in mscorlib.dll)

public bool IsSpecialName { get; }

Property Value

Type: System.Boolean
true if the SpecialName attribute is set in FieldAttributes; otherwise, false.

Implements

_FieldInfo.IsSpecialName

Names that begin with or contain an underscore character (_), property accessors, and operator overloading methods are examples of names that might require special treatment by some compilers.

The following example returns a value indicating whether or not the fields in the class contain a SpecialName attribute.

using System;
using System.Reflection;
using System.ComponentModel.Design; class FieldInfo_IsSpecialName
{
public static void Main()
{
try
{
// Get the type handle of a specified class.
Type myType = typeof(ViewTechnology); // Get the fields of the specified class.
FieldInfo[] myField = myType.GetFields(); Console.WriteLine("\nDisplaying fields that have SpecialName attributes:\n");
for(int i = 0; i < myField.Length; i++)
{
// Determine whether or not each field is a special name. 
if(myField[i].IsSpecialName)
{
Console.WriteLine("The field {0} has a SpecialName attribute.",
myField[i].Name);
}
}
}
catch(Exception e)
{
Console.WriteLine("Exception : {0} " , e.Message);
}
}
}

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

.NET for Windows Store apps

Supported in: Windows 8

Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

FieldInfo.IsSpecialName Property【转】的更多相关文章

  1. 获取枚举Name,Value,Description两种方法

    using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI ...

  2. 探究@property申明对象属性时copy与strong的区别

    一.问题来源 一直没有搞清楚NSString.NSArray.NSDictionary--属性描述关键字copy和strong的区别,看别人的项目中属性定义有的用copy,有的用strong.自己在开 ...

  3. JavaScript特性(attribute)、属性(property)和样式(style)

    最近在研读一本巨著<JavaScript忍者秘籍>,里面有一篇文章提到了这3个概念. 书中的源码可以在此下载.我将源码放到了线上,如果不想下载,可以直接访问在线网址,修改页面名就能访问到相 ...

  4. -Dmaven.multiModuleProjectDirectory system property is not set. Check $M2_HO 解决办法

    最近在使用maven,项目测试的时候出现了这么一个错.-Dmaven.multiModuleProjectDirectory system property is not set. Check $M2 ...

  5. python property理解

    一般情况下我这样使用property: @property def foo(self): return self._foo # 下面的两个decrator由@property创建 @foo.sette ...

  6. Android动画效果之Property Animation进阶(属性动画)

    前言: 前面初步认识了Android的Property Animation(属性动画)Android动画效果之初识Property Animation(属性动画)(三),并且利用属性动画简单了补间动画 ...

  7. Android动画效果之初识Property Animation(属性动画)

    前言: 前面两篇介绍了Android的Tween Animation(补间动画) Android动画效果之Tween Animation(补间动画).Frame Animation(逐帧动画)Andr ...

  8. # ios开发 @property 和 Ivar 的区别

    ios开发 @property 和 Ivar 的区别 @property 属性其实是对成员变量的一种封装.我们先大概这样理解: @property = Ivar + setter + getter I ...

  9. Cesium原理篇:Property

    之前主要是Entity的一个大概流程,本文主要介绍Cesium的属性,比如defineProperties,Property(ConstantProperty,CallbackProperty,Con ...

随机推荐

  1. linux之SQL语句简明教程---DROP TRUNCATE

    有时候我们会决定我们需要从数据库中清除一个表格.事实上,如果我们不能这样做的话,那将会是一个很大的问题,因为数据库管理师 (Database Administrator -- DBA) 势必无法对数据 ...

  2. 高龄“潮男”优衣库老板柳井正_榜样_奢华主义_YOKA时尚网

    高龄"潮男"优衣库老板柳井正_榜样_奢华主义_YOKA时尚网 高龄"潮男"优衣库老板柳井正

  3. flex-linkbutton

    LinkButton 控件是没有边框的 Button 控件,当用户将鼠标移动到该控件位置时,其内容将加亮显示.这些特征通常借助包含在浏览器页面中的 HTML 链接进行展示.为使 LinkButton ...

  4. 关于” fatal error C1010: unexpected end of file while looking forprecompiled header directive”问题

    其中文意思是:致命错误C1010:意想不到的文件结束而寻找预编译头文件的指令错误执行cl exe. 经过多次的查找,终于解决这问题 方法一: 在头文件中加“#include "stdafx. ...

  5. exit()与_exit()的区别

    从图中可以看出,_exit 函数的作用是:直接使进程停止运行,清除其使用的内存空间,并清除其在内核的各种数据结构:exit 函数则在这些基础上做了一些小动作,在执行退出之前还加了若干道工序.exit( ...

  6. POJ 1734 求最小环路径 拓展Floyd

    九野的博客,转载请注明出处:http://blog.csdn.net/acmmmm/article/details/11888019 题意: n个点 m条无向边 下面m条有权无向边 问图中最小环的路径 ...

  7. POJ 3678 Katu Puzzle(2 - SAT) - from lanshui_Yang

    Description Katu Puzzle is presented as a directed graph G(V, E) with each edge e(a, b) labeled by a ...

  8. 【MFC学习笔记-作业7-小型画图软件】【】

    作业要求: 按下鼠标右键画圆. 按下鼠标左键移动曲线. 丝毫没有思路..网上教程又比这个程序复杂100倍... 好吧 总算找到一个合适的了... 转载至:http://blog.chinaunix.n ...

  9. radio与checkbox

    最近一直在学习Javascript与asp.net MVC4,每天都在跟着书学习.这样总感觉自己看的很抽象,没有点实际的意义.而且,每次看的东西很容易忘记,所以打算在这里记录自己的学习笔记. Java ...

  10. ios百度地图不能定位问题

    在IOS8中定位功能新增了两个方法: - (void)requestWhenInUseAuthorization __OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE ...