本文整理汇总了C#中TypeMemberModifiers类的典型用法代码示例。如果您正苦于以下问题:C# TypeMemberModifiers类的具体用法?C# TypeMemberModifiers怎么用?C# TypeMemberModifiers使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TypeMemberModifiers类属于命名空间,在下文中一共展示了TypeMemberModifiers类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ConvModifiers
MemberAttributes ConvModifiers(TypeMemberModifiers modifier, MemberAttributes defaultVisibility)
{
MemberAttributes attr = 0;
if ((modifier & TypeMemberModifiers.Abstract) == TypeMemberModifiers.Abstract)
attr |= MemberAttributes.Abstract;
if ((modifier & TypeMemberModifiers.Final) == TypeMemberModifiers.Final)
attr |= MemberAttributes.Const;
if ((modifier & TypeMemberModifiers.Internal) == TypeMemberModifiers.Internal)
attr |= MemberAttributes.Assembly;
if ((modifier & TypeMemberModifiers.Override) == TypeMemberModifiers.Override)
attr |= MemberAttributes.Override;
if ((modifier & TypeMemberModifiers.Private) == TypeMemberModifiers.Private)
attr |= MemberAttributes.Private;
if ((modifier & TypeMemberModifiers.Protected) == TypeMemberModifiers.Protected)
attr |= MemberAttributes.Family;
if ((modifier & TypeMemberModifiers.Public) == TypeMemberModifiers.Public)
attr |= MemberAttributes.Public;
if ((modifier & TypeMemberModifiers.Static) == TypeMemberModifiers.Static)
attr |= MemberAttributes.Static;
if ((modifier & TypeMemberModifiers.Virtual) != TypeMemberModifiers.Virtual)
attr |= MemberAttributes.Final;
if ((modifier & TypeMemberModifiers.VisibilityMask) == TypeMemberModifiers.None)
attr |= defaultVisibility;
return attr;
}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:25,代码来源:CodeDomVisitor.cs
示例2: CreateConstructor
public static Constructor CreateConstructor(Node lexicalInfoProvider, TypeMemberModifiers modifiers)
{
Constructor constructor = new Constructor(lexicalInfoProvider.LexicalInfo);
constructor.Modifiers = modifiers;
constructor.IsSynthetic = true;
return constructor;
}
开发者ID:w4x,项目名称:boolangstudio,代码行数:7,代码来源:AstUtil.cs
示例3: BooMethodBuilder
public BooMethodBuilder(BooCodeBuilder codeBuilder, string name, IType returnType, TypeMemberModifiers modifiers)
{
if (null == codeBuilder)
throw new ArgumentNullException("codeBuilder");
if (null == name)
throw new ArgumentNullException("name");
_codeBuilder = codeBuilder;
_method = _codeBuilder.CreateMethod(name, returnType, modifiers);
}
开发者ID:0xb1dd1e,项目名称:boo,代码行数:10,代码来源:BooMethodBuilder.cs
示例4: ShouldSerialize
public bool ShouldSerialize(TypeMemberModifiers value)
{
return value != TypeMemberModifiers.None;
}
开发者ID:w4x,项目名称:boolangstudio,代码行数:4,代码来源:CodeSerializer.cs
示例5: CreateMethodFromPrototype
public Method CreateMethodFromPrototype(LexicalInfo lexicalInfo, IMethod baseMethod, TypeMemberModifiers newModifiers)
{
return CreateMethodFromPrototype(lexicalInfo, baseMethod, newModifiers, baseMethod.Name);
}
开发者ID:0xb1dd1e,项目名称:boo,代码行数:4,代码来源:BooCodeBuilder.cs
示例6: CreateMethod
public Method CreateMethod(string name, TypeReference returnType, TypeMemberModifiers modifiers)
{
Method method = new Method(name);
method.Modifiers = modifiers;
method.ReturnType = returnType;
method.IsSynthetic = true;
EnsureEntityFor(method);
return method;
}
开发者ID:0xb1dd1e,项目名称:boo,代码行数:9,代码来源:BooCodeBuilder.cs
示例7: CreateConstructor
public Constructor CreateConstructor(TypeMemberModifiers modifiers)
{
Constructor constructor = new Constructor();
constructor.Modifiers = modifiers;
constructor.IsSynthetic = true;
EnsureEntityFor(constructor);
return constructor;
}
开发者ID:0xb1dd1e,项目名称:boo,代码行数:8,代码来源:BooCodeBuilder.cs
示例8: OnStrictMode
protected virtual void OnStrictMode()
{
_defaultTypeVisibility = TypeMemberModifiers.Private;
_defaultMethodVisibility = TypeMemberModifiers.Private;
_defaultPropertyVisibility = TypeMemberModifiers.Private;
_defaultEventVisibility = TypeMemberModifiers.Private;
_defaultFieldVisibility = TypeMemberModifiers.Private;
EnableWarning(CompilerWarningFactory.Codes.ImplicitReturn);
EnableWarning(CompilerWarningFactory.Codes.VisibleMemberDoesNotDeclareTypeExplicitely);
//by default strict mode forbids implicit downcasts
//disable warning so we get only the regular incompatible type error
DisableWarning(CompilerWarningFactory.Codes.ImplicitDowncast);
}
开发者ID:erikojebo,项目名称:boo,代码行数:15,代码来源:CompilerParameters.cs
示例9: CreateInitializerMethod
Method CreateInitializerMethod(TypeDefinition type, string name, TypeMemberModifiers modifiers)
{
Method method = CodeBuilder.CreateMethod(name, TypeSystemServices.VoidType, modifiers);
type.Members.Add(method);
MarkVisited(method);
return method;
}
开发者ID:stuman08,项目名称:boo,代码行数:7,代码来源:ProcessMethodBodies.cs
示例10: IsModifierSet
public bool IsModifierSet(TypeMemberModifiers modifiers)
{
return modifiers == (_modifiers & modifiers);
}
开发者ID:Bombadil77,项目名称:boo,代码行数:4,代码来源:TypeMember.cs
示例11: AddMethod
public BooMethodBuilder AddMethod(string name, IType returnType, TypeMemberModifiers modifiers)
{
BooMethodBuilder builder = new BooMethodBuilder(_codeBuilder, name, returnType, modifiers);
_cd.Members.Add(builder.Method);
return builder;
}
开发者ID:neonux,项目名称:boo,代码行数:6,代码来源:BooClassBuilder.cs
示例12: AddField
public Field AddField(string name, IType type, TypeMemberModifiers modifiers)
{
Field field = AddField(name, type);
field.Modifiers = modifiers;
return field;
}
开发者ID:neonux,项目名称:boo,代码行数:6,代码来源:BooClassBuilder.cs
示例13: CreateInitializerMethod
Method CreateInitializerMethod(TypeDefinition type, string name, TypeMemberModifiers modifiers)
{
Method method = new Method(name);
method.Modifiers |= modifiers;
method.ReturnType = CodeBuilder.CreateTypeReference(TypeSystemServices.VoidType);
InternalMethod entity = new InternalMethod(TypeSystemServices, method);
method.Entity = entity;
type.Members.Add(method);
MarkVisited(method);
return method;
}
开发者ID:w4x,项目名称:boolangstudio,代码行数:12,代码来源:ProcessMethodBodies.cs
示例14: modifiers
//throws RecognitionException, TokenStreamException
protected void modifiers()
{
_modifiers = TypeMemberModifiers.None;
try { // for error handling
{ // ( ... )*
for (;;)
{
switch ( LA(1) )
{
case STATIC:
{
match(STATIC);
if (0==inputState.guessing)
{
_modifiers |= TypeMemberModifiers.Static;
}
break;
}
case PUBLIC:
{
match(PUBLIC);
if (0==inputState.guessing)
{
_modifiers |= TypeMemberModifiers.Public;
}
break;
}
case PROTECTED:
{
match(PROTECTED);
if (0==inputState.guessing)
{
_modifiers |= TypeMemberModifiers.Protected;
}
break;
}
case PRIVATE:
{
match(PRIVATE);
if (0==inputState.guessing)
{
_modifiers |= TypeMemberModifiers.Private;
}
break;
}
case INTERNAL:
{
match(INTERNAL);
if (0==inputState.guessing)
{
_modifiers |= TypeMemberModifiers.Internal;
}
break;
}
case FINAL:
{
match(FINAL);
if (0==inputState.guessing)
{
_modifiers |= TypeMemberModifiers.Final;
}
break;
}
case TRANSIENT:
{
match(TRANSIENT);
if (0==inputState.guessing)
{
_modifiers |= TypeMemberModifiers.Transient;
}
break;
}
case OVERRIDE:
{
match(OVERRIDE);
if (0==inputState.guessing)
{
_modifiers |= TypeMemberModifiers.Override;
}
break;
}
case ABSTRACT:
{
match(ABSTRACT);
if (0==inputState.guessing)
{
_modifiers |= TypeMemberModifiers.Abstract;
}
break;
}
case VIRTUAL:
{
match(VIRTUAL);
if (0==inputState.guessing)
{
_modifiers |= TypeMemberModifiers.Virtual;
}
break;
//.........这里部分代码省略.........
开发者ID:w4x,项目名称:boolangstudio,代码行数:101,代码来源:WSABooParserBase.cs
示例15: CreateMethodFromPrototype
public Method CreateMethodFromPrototype(LexicalInfo location, IMethod baseMethod, TypeMemberModifiers newModifiers, string newMethodName)
{
var method = new Method(location);
method.Name = newMethodName;
method.Modifiers = newModifiers;
method.IsSynthetic = true;
if (null != baseMethod.GenericInfo)
DeclareGenericParameters(method, baseMethod.GenericInfo.GenericParameters);
DeclareParameters(method, baseMethod.GetParameters(), baseMethod.IsStatic ? 0 : 1);
method.ReturnType = CreateTypeReference(baseMethod.ReturnType);
EnsureEntityFor(method);
return method;
}
开发者ID:carlosaml,项目名称:boo,代码行数:16,代码来源:BooCodeBuilder.cs
示例16: type_member_modifier
protected void type_member_modifier() //throws RecognitionException, TokenStreamException
{
IToken t = null;
try { // for error handling
switch ( LA(1) )
{
case STATIC:
{
match(STATIC);
if (0==inputState.guessing)
{
_modifiers |= TypeMemberModifiers.Static;
}
break;
}
case PUBLIC:
{
match(PUBLIC);
if (0==inputState.guessing)
{
_modifiers |= TypeMemberModifiers.Public;
}
break;
}
case PROTECTED:
{
match(PROTECTED);
if (0==inputState.guessing)
{
_modifiers |= TypeMemberModifiers.Protected;
}
break;
}
case PRIVATE:
{
match(PRIVATE);
if (0==inputState.guessing)
{
_modifiers |= TypeMemberModifiers.Private;
}
break;
}
case INTERNAL:
{
match(INTERNAL);
if (0==inputState.guessing)
{
_modifiers |= TypeMemberModifiers.Internal;
}
break;
}
case FINAL:
{
match(FINAL);
if (0==inputState.guessing)
{
_modifiers |= TypeMemberModifiers.Final;
}
break;
}
case TRANSIENT:
{
t = LT(1);
match(TRANSIENT);
if (0==inputState.guessing)
{
_modifiers |= TypeMemberModifiers.Transient;
EmitTransientKeywordDeprecationWarning(ToLexicalInfo(t));
}
break;
}
case OVERRIDE:
{
match(OVERRIDE);
if (0==inputState.guessing)
{
_modifiers |= TypeMemberModifiers.Override;
}
break;
}
case ABSTRACT:
{
match(ABSTRACT);
if (0==inputState.guessing)
{
_modifiers |= TypeMemberModifiers.Abstract;
}
break;
}
case VIRTUAL:
{
match(VIRTUAL);
if (0==inputState.guessing)
{
//.........这里部分代码省略.........
开发者ID:hlizard,项目名称:boo,代码行数:101,代码来源:BooParserBase.cs
示例17: InvalidCombination
void InvalidCombination(TypeMember member, TypeMemberModifiers mod1, TypeMemberModifiers mod2)
{
if (!member.IsModifierSet(mod1) || !member.IsModifierSet(mod2)) return;
Error(
CompilerErrorFactory.InvalidCombinationOfModifiers(
member,
EntityFor(member),
string.Format("{0}, {1}", mod1.ToString().ToLower(), mod2.ToString().ToLower())));
}
开发者ID:scottstephens,项目名称:boo,代码行数:9,代码来源:PreErrorChecking.cs
示例18: ShouldSerialize
public bool ShouldSerialize(TypeMemberModifiers value)
{
return (long)value != 0;
}
开发者ID:0xb1dd1e,项目名称:boo,代码行数:4,代码来源:CodeSerializer.cs
示例19: TypeMember
protected TypeMember(TypeMemberModifiers modifiers, string name)
{
this.Modifiers = modifiers;
this.Name = name;
}
开发者ID:Bombadil77,项目名称:boo,代码行数:5,代码来源:TypeMember.cs
示例20: Serialize
public Expression Serialize(TypeMemberModifiers value)
{
return SerializeEnum("TypeMemberModifiers", (long)value);
}
开发者ID:0xb1dd1e,项目名称:boo,代码行数:4,代码来源:CodeSerializer.cs
注:本文中的TypeMemberModifiers类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论