本文整理汇总了C#中Mono.CSharp.Modifiers类的典型用法代码示例。如果您正苦于以下问题:C# Modifiers类的具体用法?C# Modifiers怎么用?C# Modifiers使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Modifiers类属于Mono.CSharp命名空间,在下文中一共展示了Modifiers类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Class
public Class(TypeContainer parent, MemberName name, Modifiers mod, Attributes attrs)
: base(parent, name, attrs, MemberKind.Class)
{
var accmods = IsTopLevel ? Modifiers.INTERNAL : Modifiers.PRIVATE;
this.ModFlags = ModifiersExtensions.Check (AllowedModifiers, mod, accmods, Location, Report);
spec = new TypeSpec (Kind, null, this, null, ModFlags);
}
开发者ID:JoeSGeorge,项目名称:NRefactory,代码行数:7,代码来源:class.cs
示例2: HoistedStoreyClass
public HoistedStoreyClass (TypeContainer parent, MemberName name, TypeParameter[] tparams, Modifiers mod)
: base (parent, name, mod | Modifiers.PRIVATE)
{
if (tparams != null) {
type_params = new TypeParameter[tparams.Length];
var src = new TypeParameterSpec[tparams.Length];
var dst = new TypeParameterSpec[tparams.Length];
for (int i = 0; i < type_params.Length; ++i) {
type_params[i] = tparams[i].CreateHoistedCopy (this, spec);
src[i] = tparams[i].Type;
dst[i] = type_params[i].Type;
}
// A copy is not enough, inflate any type parameter constraints
// using a new type parameters
var inflator = new TypeParameterInflator (this, null, src, dst);
for (int i = 0; i < type_params.Length; ++i) {
src[i].InflateConstraints (inflator, dst[i]);
}
mutator = new TypeParameterMutator (tparams, type_params);
}
}
开发者ID:nzaugg,项目名称:mono,代码行数:25,代码来源:anonymous.cs
示例3: MethodCore
public MethodCore (DeclSpace parent, GenericMethod generic,
FullNamedExpression type, Modifiers mod, Modifiers allowed_mod,
MemberName name, Attributes attrs, ParametersCompiled parameters)
: base (parent, generic, type, mod, allowed_mod, name, attrs)
{
this.parameters = parameters;
}
开发者ID:spencerhakim,项目名称:mono,代码行数:7,代码来源:method.cs
示例4: Accessor
public Accessor(ToplevelBlock b, Modifiers mod, Attributes attrs, ParametersCompiled p, Location loc)
{
Block = b;
Attributes = attrs;
Location = loc;
Parameters = p;
ModFlags = ModifiersExtensions.Check (AllowedModifiers, mod, 0, loc, RootContext.ToplevelTypes.Compiler.Report);
}
开发者ID:speier,项目名称:shake,代码行数:8,代码来源:property.cs
示例5: CompilerGeneratedContainer
protected CompilerGeneratedContainer (TypeContainer parent, MemberName name, Modifiers mod, MemberKind kind)
: base (parent, name, null, kind)
{
Debug.Assert ((mod & Modifiers.AccessibilityMask) != 0);
ModFlags = mod | Modifiers.COMPILER_GENERATED | Modifiers.SEALED;
spec = new TypeSpec (Kind, null, this, null, ModFlags);
}
开发者ID:rabink,项目名称:mono,代码行数:8,代码来源:anonymous.cs
示例6: FieldBase
protected FieldBase (DeclSpace parent, FullNamedExpression type, Modifiers mod,
Modifiers allowed_mod, MemberName name, Attributes attrs)
: base (parent, null, type, mod, allowed_mod | Modifiers.ABSTRACT, Modifiers.PRIVATE,
name, attrs)
{
if ((mod & Modifiers.ABSTRACT) != 0)
Report.Error (681, Location, "The modifier 'abstract' is not valid on fields. Try using a property instead");
}
开发者ID:stabbylambda,项目名称:mono,代码行数:8,代码来源:field.cs
示例7: Enum
public Enum(TypeContainer parent, FullNamedExpression type, Modifiers mod_flags, MemberName name, Attributes attrs)
: base(parent, name, attrs, MemberKind.Enum)
{
underlying_type_expr = type;
var accmods = IsTopLevel ? Modifiers.INTERNAL : Modifiers.PRIVATE;
ModFlags = ModifiersExtensions.Check (AllowedModifiers, mod_flags, accmods, Location, Report);
spec = new EnumSpec (null, this, null, null, ModFlags);
}
开发者ID:segaman,项目名称:NRefactory,代码行数:8,代码来源:enum.cs
示例8: Event
protected Event(DeclSpace parent, FullNamedExpression type, Modifiers mod_flags, MemberName name, Attributes attrs)
: base(parent, null, type, mod_flags,
parent.PartialContainer.Kind == MemberKind.Interface ? AllowedModifiersInterface :
parent.PartialContainer.Kind == MemberKind.Struct ? AllowedModifiersStruct :
AllowedModifiersClass,
name, attrs)
{
}
开发者ID:RainsSoft,项目名称:MonoCompilerAsAService,代码行数:8,代码来源:property.cs
示例9: Class
public Class(NamespaceEntry ns, DeclSpace parent, MemberName name, Modifiers mod,
Attributes attrs)
: base(ns, parent, name, attrs, MemberKind.Class)
{
var accmods = (Parent == null || Parent.Parent == null) ? Modifiers.INTERNAL : Modifiers.PRIVATE;
this.ModFlags = ModifiersExtensions.Check (AllowedModifiers, mod, accmods, Location, Report);
spec = new TypeSpec (Kind, null, this, null, ModFlags);
}
开发者ID:RainsSoft,项目名称:MonoCompilerAsAService,代码行数:8,代码来源:class.cs
示例10: Enum
public Enum(NamespaceEntry ns, DeclSpace parent, TypeExpr type,
Modifiers mod_flags, MemberName name, Attributes attrs)
: base(ns, parent, name, attrs, MemberKind.Enum)
{
this.base_type = type;
var accmods = IsTopLevel ? Modifiers.INTERNAL : Modifiers.PRIVATE;
ModFlags = ModifiersExtensions.Check (AllowedModifiers, mod_flags, accmods, Location, Report);
spec = new EnumSpec (null, this, null, null, ModFlags);
}
开发者ID:speier,项目名称:shake,代码行数:9,代码来源:enum.cs
示例11: HoistedStoreyClass
public HoistedStoreyClass (DeclSpace parent, MemberName name, TypeParameter[] tparams, Modifiers mod)
: base (parent, name, mod | Modifiers.PRIVATE)
{
if (tparams != null) {
type_params = new TypeParameter[tparams.Length];
for (int i = 0; i < type_params.Length; ++i) {
type_params[i] = tparams[i].CreateHoistedCopy (this, spec);
}
}
}
开发者ID:pgoron,项目名称:monodevelop,代码行数:10,代码来源:anonymous.cs
示例12: Const
public Const(DeclSpace parent, FullNamedExpression type, string name,
Expression expr, Modifiers mod_flags, Attributes attrs, Location loc)
: base(parent, type, mod_flags, AllowedModifiers,
new MemberName (name, loc), attrs)
{
if (expr != null)
initializer = new ConstInitializer (this, expr);
ModFlags |= Modifiers.STATIC;
}
开发者ID:speier,项目名称:shake,代码行数:10,代码来源:const.cs
示例13: Delegate
public Delegate(TypeContainer parent, FullNamedExpression type, Modifiers mod_flags, MemberName name, ParametersCompiled param_list,
Attributes attrs)
: base(parent, name, attrs, MemberKind.Delegate)
{
this.ReturnType = type;
ModFlags = ModifiersExtensions.Check (AllowedModifiers, mod_flags,
IsTopLevel ? Modifiers.INTERNAL :
Modifiers.PRIVATE, name.Location, Report);
parameters = param_list;
spec = new TypeSpec (Kind, null, this, null, ModFlags | Modifiers.SEALED);
}
开发者ID:svermeulen,项目名称:NRefactory,代码行数:11,代码来源:delegate.cs
示例14: Class
public Class(NamespaceEntry ns, DeclSpace parent, MemberName name, Modifiers mod,
Attributes attrs)
: base(ns, parent, name, attrs, MemberKind.Class)
{
var accmods = (Parent == null || Parent.Parent == null) ? Modifiers.INTERNAL : Modifiers.PRIVATE;
this.ModFlags = ModifiersExtensions.Check (AllowedModifiers, mod, accmods, Location, Report);
spec = new TypeSpec (Kind, null, this, null, ModFlags);
if (IsStatic && RootContext.Version == LanguageVersion.ISO_1) {
Report.FeatureIsNotAvailable (Location, "static classes");
}
}
开发者ID:speier,项目名称:shake,代码行数:12,代码来源:class.cs
示例15: Check
// <summary>
// Checks the object @mod modifiers to be in @allowed.
// Returns the new mask. Side effect: reports any
// incorrect attributes.
// </summary>
public static Modifiers Check(Modifiers allowed, Modifiers mod, Modifiers def_access, Location l, Report Report)
{
int invalid_flags = (~(int) allowed) & ((int) mod & ((int) Modifiers.TOP - 1));
int i;
if (invalid_flags == 0){
if ((mod & Modifiers.UNSAFE) != 0){
RootContext.CheckUnsafeOption (l, Report);
}
//
// If no accessibility bits provided
// then provide the defaults.
//
if ((mod & Modifiers.AccessibilityMask) == 0) {
mod |= def_access;
if (def_access != 0)
mod |= Modifiers.DEFAULT_ACCESS_MODIFER;
return mod;
}
//
// Make sure that no conflicting accessibility
// bits have been set. Protected+Internal is
// allowed, that is why they are placed on bits
// 1 and 4 (so the shift 3 basically merges them)
//
int a = (int) mod;
a &= 15;
a |= (a >> 3);
a = ((a & 2) >> 1) + (a & 5);
a = ((a & 4) >> 2) + (a & 3);
if (a > 1)
Report.Error (107, l, "More than one protection modifier specified");
return mod;
}
for (i = 1; i <= (int) Modifiers.TOP; i <<= 1) {
if ((i & invalid_flags) == 0)
continue;
Error_InvalidModifier (l, Name ((Modifiers) i), Report);
}
return allowed & mod;
}
开发者ID:speier,项目名称:shake,代码行数:53,代码来源:modifiers.cs
示例16: AccessibilityName
public static string AccessibilityName (Modifiers mod)
{
switch (mod & Modifiers.AccessibilityMask) {
case Modifiers.PUBLIC:
return "public";
case Modifiers.PROTECTED:
return "protected";
case Modifiers.PROTECTED | Modifiers.INTERNAL:
return "protected internal";
case Modifiers.INTERNAL:
return "internal";
case Modifiers.PRIVATE:
return "private";
default:
throw new NotImplementedException (mod.ToString ());
}
}
开发者ID:runefs,项目名称:Marvin,代码行数:17,代码来源:modifiers.cs
示例17: Name
static public string Name (Modifiers i)
{
string s = "";
switch (i) {
case Modifiers.NEW:
s = "new"; break;
case Modifiers.PUBLIC:
s = "public"; break;
case Modifiers.PROTECTED:
s = "protected"; break;
case Modifiers.INTERNAL:
s = "internal"; break;
case Modifiers.PRIVATE:
s = "private"; break;
case Modifiers.ABSTRACT:
s = "abstract"; break;
case Modifiers.SEALED:
s = "sealed"; break;
case Modifiers.STATIC:
s = "static"; break;
case Modifiers.READONLY:
s = "readonly"; break;
case Modifiers.VIRTUAL:
s = "virtual"; break;
case Modifiers.OVERRIDE:
s = "override"; break;
case Modifiers.EXTERN:
s = "extern"; break;
case Modifiers.VOLATILE:
s = "volatile"; break;
case Modifiers.UNSAFE:
s = "unsafe"; break;
case Modifiers.ASYNC:
s = "async"; break;
case Modifiers.AS_DYNAMIC:
s = "dynamic"; break;
}
return s;
}
开发者ID:bbqchickenrobot,项目名称:playscript-mono,代码行数:41,代码来源:modifiers.cs
示例18: HoistedStoreyClass
public HoistedStoreyClass (TypeDefinition parent, MemberName name, TypeParameters tparams, Modifiers mods, MemberKind kind)
: base (parent, name, mods | Modifiers.PRIVATE, kind)
{
if (tparams != null) {
var type_params = name.TypeParameters;
var src = new TypeParameterSpec[tparams.Count];
var dst = new TypeParameterSpec[tparams.Count];
for (int i = 0; i < tparams.Count; ++i) {
type_params[i] = tparams[i].CreateHoistedCopy (spec);
src[i] = tparams[i].Type;
dst[i] = type_params[i].Type;
}
// A copy is not enough, inflate any type parameter constraints
// using a new type parameters
var inflator = new TypeParameterInflator (this, null, src, dst);
for (int i = 0; i < tparams.Count; ++i) {
src[i].InflateConstraints (inflator, dst[i]);
}
mutator = new TypeParameterMutator (tparams, type_params);
}
}
开发者ID:rabink,项目名称:mono,代码行数:26,代码来源:anonymous.cs
示例19: MemberBase
protected MemberBase (TypeDefinition parent, FullNamedExpression type, Modifiers mod, Modifiers allowed_mod, Modifiers def_mod, MemberName name, Attributes attrs)
: base (parent, name, attrs)
{
this.Parent = parent;
this.type_expr = type;
if (name != MemberName.Null)
ModFlags = ModifiersExtensions.Check (allowed_mod, mod, def_mod, Location, Report);
}
开发者ID:fvalette,项目名称:mono,代码行数:9,代码来源:class.cs
示例20: InterfaceMemberBase
public InterfaceMemberBase (TypeDefinition parent, FullNamedExpression type, Modifiers mod, Modifiers allowed_mod, MemberName name, Attributes attrs)
: base (parent, type, mod, allowed_mod, Modifiers.PRIVATE, name, attrs)
{
IsInterface = parent.Kind == MemberKind.Interface;
IsExplicitImpl = (MemberName.ExplicitInterface != null);
explicit_mod_flags = mod;
}
开发者ID:fvalette,项目名称:mono,代码行数:7,代码来源:class.cs
注:本文中的Mono.CSharp.Modifiers类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论