本文整理汇总了C#中TypeMemberModifiers类的典型用法代码示例。如果您正苦于以下问题:C# TypeMemberModifiers类的具体用法?C# TypeMemberModifiers怎么用?C# TypeMemberModifiers使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TypeMemberModifiers类属于命名空间,在下文中一共展示了TypeMemberModifiers类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: CreateConstructor
public static Constructor CreateConstructor(Node lexicalInfoProvider, TypeMemberModifiers modifiers)
{
Constructor constructor = new Constructor(lexicalInfoProvider.LexicalInfo);
constructor.Modifiers = modifiers;
constructor.IsSynthetic = true;
return constructor;
}
示例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);
}
示例4: ShouldSerialize
public bool ShouldSerialize(TypeMemberModifiers value)
{
return value != TypeMemberModifiers.None;
}
示例5: CreateMethodFromPrototype
public Method CreateMethodFromPrototype(LexicalInfo lexicalInfo, IMethod baseMethod, TypeMemberModifiers newModifiers)
{
return CreateMethodFromPrototype(lexicalInfo, baseMethod, newModifiers, baseMethod.Name);
}
示例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;
}
示例7: CreateConstructor
public Constructor CreateConstructor(TypeMemberModifiers modifiers)
{
Constructor constructor = new Constructor();
constructor.Modifiers = modifiers;
constructor.IsSynthetic = true;
EnsureEntityFor(constructor);
return constructor;
}
示例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);
}
示例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;
}
示例10: IsModifierSet
public bool IsModifierSet(TypeMemberModifiers modifiers)
{
return modifiers == (_modifiers & modifiers);
}
示例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;
}
示例12: AddField
public Field AddField(string name, IType type, TypeMemberModifiers modifiers)
{
Field field = AddField(name, type);
field.Modifiers = modifiers;
return field;
}
示例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;
}
示例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;
//.........这里部分代码省略.........
示例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;
}