本文整理汇总了C#中Modifiers类的典型用法代码示例。如果您正苦于以下问题:C# Modifiers类的具体用法?C# Modifiers怎么用?C# Modifiers使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Modifiers类属于命名空间,在下文中一共展示了Modifiers类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Hotkey
public Hotkey(Keys key, Modifiers modifiers, HotkeyHandler handler)
{
Key = key;
Modifiers = modifiers;
Handler = handler;
Id = GetHashCode();
}
示例2: DoControlGroup
public void DoControlGroup(World world, int group, Modifiers mods)
{
if (mods.HasModifier(Modifiers.Ctrl))
{
if (actors.Count == 0)
return;
controlGroups[group].Clear();
for (var i = 0; i < 10; i++) /* all control groups */
controlGroups[i].RemoveAll(a => actors.Contains(a));
controlGroups[group].AddRange(actors);
return;
}
if (mods.HasModifier(Modifiers.Alt))
{
Game.viewport.Center(controlGroups[group]);
return;
}
Combine(world, controlGroups[group],
mods.HasModifier(Modifiers.Shift), false);
}
示例3: CheckName
public string CheckName(SemanticModel ctx, string name, AffectedEntity entity, Modifiers accessibilty = Modifiers.Private, bool isStatic = false)
{
foreach (var rule in Rules)
{
if (!rule.AffectedEntity.HasFlag(entity))
{
continue;
}
if (!rule.VisibilityMask.HasFlag(accessibilty))
{
continue;
}
if (isStatic && !rule.IncludeStaticEntities || !isStatic && !rule.IncludeInstanceMembers)
{
continue;
}
if (!rule.IsValid(name))
{
IList<string> suggestedNames;
rule.GetErrorMessage(ctx, name, out suggestedNames);
if (suggestedNames.Any())
return suggestedNames[0];
}
}
return name;
}
示例4: ConstructorDeclaration
public ConstructorDeclaration(string name, Modifiers modifier,
List<ParameterDeclarationExpression> parameters,
ConstructorInitializer constructorInitializer,
List<AttributeSection> attributes)
: base(modifier, attributes, name, parameters)
{
}
示例5: CheckName
void CheckName(TypeDeclaration node, AffectedEntity entity, Identifier identifier, Modifiers accessibilty)
{
TypeResolveResult resolveResult = ctx.Resolve(node) as TypeResolveResult;
if (resolveResult == null)
return;
var type = resolveResult.Type;
if (type.DirectBaseTypes.Any(t => t.FullName == "System.Attribute")) {
if (CheckNamedResolveResult(resolveResult, node, AffectedEntity.CustomAttributes, identifier, accessibilty)) {
return;
}
} else if (type.DirectBaseTypes.Any(t => t.FullName == "System.EventArgs")) {
if (CheckNamedResolveResult(resolveResult, node, AffectedEntity.CustomEventArgs, identifier, accessibilty)) {
return;
}
} else if (type.DirectBaseTypes.Any(t => t.FullName == "System.Exception")) {
if (CheckNamedResolveResult(resolveResult, node, AffectedEntity.CustomExceptions, identifier, accessibilty)) {
return;
}
}
var typeDef = type.GetDefinition();
if (typeDef != null && typeDef.Attributes.Any(attr => attr.AttributeType.FullName == "NUnit.Framework.TestFixtureAttribute")) {
if (CheckNamedResolveResult(resolveResult, node, AffectedEntity.TestType, identifier, accessibilty)) {
return;
}
}
CheckNamedResolveResult(resolveResult, node, entity, identifier, accessibilty);
}
示例6: DestructorDeclarationNode
public DestructorDeclarationNode(Token token,
ParseNodeList attributes,
Modifiers modifiers,
AtomicNameNode name,
BlockStatementNode body)
: base(ParseNodeType.DestructorDeclaration, token, attributes, modifiers, /* return type */ null, name, new ParseNodeList(), body) {
}
示例7: DoControlGroup
public void DoControlGroup(World world, WorldRenderer worldRenderer, int group, Modifiers mods, int MultiTapCount)
{
var addModifier = Platform.CurrentPlatform == PlatformType.OSX ? Modifiers.Meta : Modifiers.Ctrl;
if (mods.HasModifier(addModifier))
{
if (actors.Count == 0)
return;
if (!mods.HasModifier(Modifiers.Shift))
controlGroups[group].Clear();
for (var i = 0; i < 10; i++) /* all control groups */
controlGroups[i].RemoveAll(a => actors.Contains(a));
controlGroups[group].AddRange(actors.Where(a => a.Owner == world.LocalPlayer));
return;
}
var groupActors = controlGroups[group].Where(a => !a.IsDead() && !world.FogObscures(a));
if (mods.HasModifier(Modifiers.Alt) || MultiTapCount >= 2)
{
worldRenderer.Viewport.Center(groupActors);
return;
}
Combine(world, groupActors, mods.HasModifier(Modifiers.Shift), false);
}
示例8: DoControlGroup
public void DoControlGroup(World world, int group, Modifiers mods, int MultiTapCount)
{
var addModifier = Platform.CurrentPlatform == PlatformType.OSX ? Modifiers.Meta : Modifiers.Ctrl;
if (mods.HasModifier(addModifier))
{
if (actors.Count == 0)
return;
if (!mods.HasModifier(Modifiers.Shift))
controlGroups[group].Clear();
for (var i = 0; i < 10; i++) /* all control groups */
controlGroups[i].RemoveAll(a => actors.Contains(a));
controlGroups[group].AddRange(actors);
return;
}
if (mods.HasModifier(Modifiers.Alt) || MultiTapCount >= 2)
{
Game.viewport.Center(controlGroups[group]);
return;
}
Combine(world, controlGroups[group],
mods.HasModifier(Modifiers.Shift), false);
}
示例9: Check
// public void Add(Modifiers m)
// {
// Add(m.cur, m.Location);
// }
public void Check(Modifiers allowed)
{
Modifiers wrong = cur & ~allowed;
if (wrong != Modifiers.None) {
// parser.Error("modifier(s) " + wrong + " not allowed here");
}
}
示例10: ConstantFieldDeclarationNode
public ConstantFieldDeclarationNode(Token token,
ParseNodeList attributes,
Modifiers modifiers,
ParseNode type,
ParseNodeList initializers)
: base(ParseNodeType.ConstFieldDeclaration, token, attributes, modifiers, type, initializers, false) {
}
示例11: CharacterEventArgs
/// <summary>
/// Creates a new KeyboardEventArgs, given a time for the event, the key that was pressed, and
/// the modifiers that were applied at the time of the press, as well as the keyboard state at
/// the time the event occurred.
/// </summary>
public CharacterEventArgs(TimeSpan time, char character, Modifiers modifiers, KeyboardState state)
: base(time)
{
Character = character;
State = state;
Modifiers = modifiers;
}
示例12: ConvMemberAttributes
// FIXME: map all modifiers correctly
static MemberAttributes ConvMemberAttributes(Modifiers modifier)
{
MemberAttributes attr = (MemberAttributes)0;
if ((modifier & Modifiers.Abstract) != 0)
attr |= MemberAttributes.Abstract;
if ((modifier & Modifiers.Const) != 0)
attr |= MemberAttributes.Const;
if ((modifier & Modifiers.Sealed) != 0)
attr |= MemberAttributes.Final;
if ((modifier & Modifiers.New) != 0)
attr |= MemberAttributes.New;
if ((modifier & Modifiers.Virtual) != 0)
attr |= MemberAttributes.Overloaded;
if ((modifier & Modifiers.Override) != 0)
attr |= MemberAttributes.Override;
if ((modifier & Modifiers.Static) != 0)
attr |= MemberAttributes.Static;
if ((modifier & Modifiers.Private) != 0)
attr |= MemberAttributes.Private;
else if ((modifier & Modifiers.Public) != 0)
attr |= MemberAttributes.Public;
else if ((modifier & Modifiers.Internal) != 0 && (modifier & Modifiers.Protected) != 0)
attr |= MemberAttributes.FamilyOrAssembly;
else if ((modifier & Modifiers.Internal) != 0)
attr |= MemberAttributes.Assembly;
else if ((modifier & Modifiers.Protected) != 0)
attr |= MemberAttributes.Family;
return attr;
}
示例13: VariableDeclarationNode
public VariableDeclarationNode(Token token,
ParseNodeList attributes,
Modifiers modifiers,
ParseNode type,
ParseNodeList initializers,
bool isFixed)
: this(ParseNodeType.VariableDeclaration, token, attributes, modifiers, type, initializers, isFixed) {
}
示例14: 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);
}
示例15: GlobalHotKey
public GlobalHotKey(IntPtr handle, Key keys, Modifiers modifiers, Action handler)
{
this.handle = handle;
this.key = keys;
this.modifiers = modifiers;
this.handler = handler;
this.id = (int)keys ^ (int)modifiers;
}