Fixed "name can be simplified"

This commit is contained in:
Joshua Askharoun
2021-03-31 17:20:20 -05:00
parent 9b09412b45
commit 799fca8d97
384 changed files with 3966 additions and 3966 deletions
+5 -5
View File
@@ -8,11 +8,11 @@ namespace Microsoft.Iris.Input
{
internal class DragDropInfo : MouseInfo
{
private static InputInfo.InfoType s_poolType = InputInfo.InfoType.DragDrop;
private static InputInfo.InfoType s_poolType = InfoType.DragDrop;
private InputModifiers _modifiers;
private DragOperation _operation;
static DragDropInfo() => InputInfo.SetPoolLimitMode(DragDropInfo.s_poolType, false);
static DragDropInfo() => SetPoolLimitMode(s_poolType, false);
private DragDropInfo()
{
@@ -25,7 +25,7 @@ namespace Microsoft.Iris.Input
InputModifiers modifiers,
DragOperation operation)
{
DragDropInfo dragDropInfo = (DragDropInfo)InputInfo.GetFromPool(DragDropInfo.s_poolType) ?? new DragDropInfo();
DragDropInfo dragDropInfo = (DragDropInfo)GetFromPool(s_poolType) ?? new DragDropInfo();
dragDropInfo.Initialize(rawSource, x, y, modifiers, operation);
return dragDropInfo;
}
@@ -39,10 +39,10 @@ namespace Microsoft.Iris.Input
{
this._modifiers = modifiers;
this._operation = operation;
this.Initialize(rawSource, x, y, DragDropInfo.EventTypeForDragOperation(operation));
this.Initialize(rawSource, x, y, EventTypeForDragOperation(operation));
}
protected override InputInfo.InfoType PoolType => DragDropInfo.s_poolType;
protected override InputInfo.InfoType PoolType => s_poolType;
public InputModifiers Modifiers => this._modifiers;
@@ -65,7 +65,7 @@ namespace Microsoft.Iris.Input
public static CommandCode Find(uint usage, uint usagePage)
{
foreach (HIDCommandMapping mapping in HIDCommandMapping.s_mappings)
foreach (HIDCommandMapping mapping in s_mappings)
{
if ((int)mapping._usage == (int)usage && (int)mapping._usagePage == (int)usagePage)
return mapping._command;
+5 -5
View File
@@ -37,9 +37,9 @@ namespace Microsoft.Iris.Input
protected static void SetPoolLimitMode(InputInfo.InfoType type, bool keepSingle)
{
if (InputInfo.s_pools == null)
InputInfo.s_pools = new InputInfo.InfoPool[9];
InputInfo.s_pools[(int)type].SetLimitMode(keepSingle);
if (s_pools == null)
s_pools = new InputInfo.InfoPool[9];
s_pools[(int)type].SetLimitMode(keepSingle);
}
protected abstract InputInfo.InfoType PoolType { get; }
@@ -50,13 +50,13 @@ namespace Microsoft.Iris.Input
this._eventType = InputEventType.Invalid;
}
protected static InputInfo GetFromPool(InputInfo.InfoType poolType) => InputInfo.s_pools[(int)poolType].GetPooledInfo();
protected static InputInfo GetFromPool(InputInfo.InfoType poolType) => s_pools[(int)poolType].GetPooledInfo();
public void ReturnToPool()
{
if (!this.Poolable)
return;
InputInfo.s_pools[(int)this.PoolType].RecycleInfo(this);
s_pools[(int)this.PoolType].RecycleInfo(this);
}
private bool Poolable => this._lockCount == 0;
+8 -8
View File
@@ -27,7 +27,7 @@ namespace Microsoft.Iris.Input
ICookedInputSite target,
InputInfo info)
{
InputItem inputItem = InputItem.AllocateFromPool();
InputItem inputItem = AllocateFromPool();
inputItem._manager = manager;
inputItem._target = target;
inputItem._info = info;
@@ -37,12 +37,12 @@ namespace Microsoft.Iris.Input
private static InputItem AllocateFromPool()
{
InputItem inputItem = null;
if (InputItem.s_cache != null)
if (s_cache != null)
{
inputItem = InputItem.s_cache;
InputItem.s_cache = (InputItem)inputItem._next;
inputItem = s_cache;
s_cache = (InputItem)inputItem._next;
inputItem._next = null;
--InputItem.s_cachedCount;
--s_cachedCount;
}
if (inputItem == null)
inputItem = new InputItem();
@@ -61,11 +61,11 @@ namespace Microsoft.Iris.Input
this._prev = null;
this._next = null;
this._owner = null;
if (InputItem.s_cachedCount >= 5)
if (s_cachedCount >= 5)
return;
this._next = s_cache;
InputItem.s_cache = this;
++InputItem.s_cachedCount;
s_cache = this;
++s_cachedCount;
}
public InputManager Manager => this._manager;
+6 -6
View File
@@ -38,7 +38,7 @@ namespace Microsoft.Iris.Input
private readonly SimpleCallback _refreshHitTargetHandler;
private UIZone _mouseFocusZone;
private UIZone _keyFocusZone;
private static readonly DeferredHandler s_deliverCoalescedKey = new DeferredHandler(InputManager.DeliverCoalescedKey);
private static readonly DeferredHandler s_deliverCoalescedKey = new DeferredHandler(DeliverCoalescedKey);
internal InputManager(UISession session)
{
@@ -326,7 +326,7 @@ namespace Microsoft.Iris.Input
if (!this._currentCoalesceUndelivered)
{
this._currentCoalesceUndelivered = true;
this._inputQueue.RawInputIdleItem(DeferredCall.Create(InputManager.s_deliverCoalescedKey, this));
this._inputQueue.RawInputIdleItem(DeferredCall.Create(s_deliverCoalescedKey, this));
}
return true;
}
@@ -582,7 +582,7 @@ namespace Microsoft.Iris.Input
InputManager.ZoneDeliveryInfo newFocusInfo = new InputManager.ZoneDeliveryInfo();
if (mouseFocusInfo.State)
newFocusInfo = deliveryInfo;
InputManager.ProcessFocusUpdates(InputDeviceType.Mouse, ref this._mouseFocusZone, newFocusInfo, target as ITreeNode);
ProcessFocusUpdates(InputDeviceType.Mouse, ref this._mouseFocusZone, newFocusInfo, target as ITreeNode);
this._session.RootZone.UpdateCursor(null);
}
if (mouseFocusInfo.State && target == mouseFocusInfo.Other)
@@ -594,7 +594,7 @@ namespace Microsoft.Iris.Input
InputManager.ZoneDeliveryInfo newFocusInfo = new InputManager.ZoneDeliveryInfo();
if (keyFocusInfo.State)
newFocusInfo = deliveryInfo;
InputManager.ProcessFocusUpdates(InputDeviceType.Keyboard, ref this._keyFocusZone, newFocusInfo, target as ITreeNode);
ProcessFocusUpdates(InputDeviceType.Keyboard, ref this._keyFocusZone, newFocusInfo, target as ITreeNode);
}
if (keyFocusInfo.State && target == keyFocusInfo.Other)
flag = false;
@@ -615,10 +615,10 @@ namespace Microsoft.Iris.Input
return;
refCurrentFocusZone = newFocusInfo.zone;
if (refCurrentFocusZone == null)
InputManager.UpdateZoneFocusStates(focusType, zone, null, false, null);
UpdateZoneFocusStates(focusType, zone, null, false, null);
if (newFocusInfo.zone == null)
return;
InputManager.UpdateZoneFocusStates(focusType, newFocusInfo.zone, newFocusInfo.param, true, actualFocus);
UpdateZoneFocusStates(focusType, newFocusInfo.zone, newFocusInfo.param, true, actualFocus);
}
private static void UpdateZoneFocusStates(
+4 -4
View File
@@ -10,10 +10,10 @@ namespace Microsoft.Iris.Input
{
internal class KeyCharacterInfo : KeyActionInfo
{
private static InputInfo.InfoType s_poolType = InputInfo.InfoType.KeyCharacter;
private static InputInfo.InfoType s_poolType = InfoType.KeyCharacter;
private char _character;
static KeyCharacterInfo() => InputInfo.SetPoolLimitMode(KeyCharacterInfo.s_poolType, false);
static KeyCharacterInfo() => SetPoolLimitMode(s_poolType, false);
private KeyCharacterInfo()
{
@@ -30,7 +30,7 @@ namespace Microsoft.Iris.Input
int scanCode,
ushort eventFlags)
{
KeyCharacterInfo keyCharacterInfo = (KeyCharacterInfo)InputInfo.GetFromPool(KeyCharacterInfo.s_poolType) ?? new KeyCharacterInfo();
KeyCharacterInfo keyCharacterInfo = (KeyCharacterInfo)GetFromPool(s_poolType) ?? new KeyCharacterInfo();
keyCharacterInfo.Initialize(action, deviceType, modifiers, repeatCount, character, systemKey, nativeMessageID, scanCode, eventFlags);
return keyCharacterInfo;
}
@@ -52,7 +52,7 @@ namespace Microsoft.Iris.Input
public char Character => this._character;
protected override InputInfo.InfoType PoolType => KeyCharacterInfo.s_poolType;
protected override InputInfo.InfoType PoolType => s_poolType;
public override string ToString() => InvariantString.Format("{0}({1}, Key={2})", this.GetType().Name, Action, _character);
}
+4 -4
View File
@@ -10,10 +10,10 @@ namespace Microsoft.Iris.Input
{
internal class KeyCommandInfo : KeyActionInfo
{
private static InputInfo.InfoType s_poolType = InputInfo.InfoType.KeyCommand;
private static InputInfo.InfoType s_poolType = InfoType.KeyCommand;
public CommandCode _command;
static KeyCommandInfo() => InputInfo.SetPoolLimitMode(KeyCommandInfo.s_poolType, false);
static KeyCommandInfo() => SetPoolLimitMode(s_poolType, false);
private KeyCommandInfo()
{
@@ -24,7 +24,7 @@ namespace Microsoft.Iris.Input
InputDeviceType deviceType,
CommandCode command)
{
KeyCommandInfo keyCommandInfo = (KeyCommandInfo)InputInfo.GetFromPool(KeyCommandInfo.s_poolType) ?? new KeyCommandInfo();
KeyCommandInfo keyCommandInfo = (KeyCommandInfo)GetFromPool(s_poolType) ?? new KeyCommandInfo();
keyCommandInfo.Initialize(action, deviceType, command);
return keyCommandInfo;
}
@@ -37,7 +37,7 @@ namespace Microsoft.Iris.Input
public CommandCode Command => this._command;
protected override InputInfo.InfoType PoolType => KeyCommandInfo.s_poolType;
protected override InputInfo.InfoType PoolType => s_poolType;
public override string ToString() => InvariantString.Format("{0}({1}, Command={2})", this.GetType().Name, Action, _command);
}
+4 -4
View File
@@ -8,12 +8,12 @@ namespace Microsoft.Iris.Input
{
internal class KeyFocusInfo : KeyInfo
{
private static InputInfo.InfoType s_poolType = InputInfo.InfoType.KeyFocus;
private static InputInfo.InfoType s_poolType = InfoType.KeyFocus;
private bool _state;
private ICookedInputSite _other;
private KeyFocusReason _focusReason;
static KeyFocusInfo() => InputInfo.SetPoolLimitMode(KeyFocusInfo.s_poolType, true);
static KeyFocusInfo() => SetPoolLimitMode(s_poolType, true);
private KeyFocusInfo()
{
@@ -24,7 +24,7 @@ namespace Microsoft.Iris.Input
ICookedInputSite other,
KeyFocusReason focusReason)
{
KeyFocusInfo keyFocusInfo = (KeyFocusInfo)InputInfo.GetFromPool(KeyFocusInfo.s_poolType) ?? new KeyFocusInfo();
KeyFocusInfo keyFocusInfo = (KeyFocusInfo)GetFromPool(s_poolType) ?? new KeyFocusInfo();
keyFocusInfo.Initialize(state, other, focusReason);
return keyFocusInfo;
}
@@ -49,6 +49,6 @@ namespace Microsoft.Iris.Input
public KeyFocusReason FocusReason => this._focusReason;
protected override InputInfo.InfoType PoolType => KeyFocusInfo.s_poolType;
protected override InputInfo.InfoType PoolType => s_poolType;
}
}
+5 -5
View File
@@ -10,10 +10,10 @@ namespace Microsoft.Iris.Input
{
internal class KeyStateInfo : KeyActionInfo
{
private static InputInfo.InfoType s_poolType = InputInfo.InfoType.KeyState;
private static InputInfo.InfoType s_poolType = InfoType.KeyState;
private Keys _key;
static KeyStateInfo() => InputInfo.SetPoolLimitMode(KeyStateInfo.s_poolType, false);
static KeyStateInfo() => SetPoolLimitMode(s_poolType, false);
private KeyStateInfo()
{
@@ -30,7 +30,7 @@ namespace Microsoft.Iris.Input
int scanCode,
ushort eventFlags)
{
KeyStateInfo keyStateInfo = (KeyStateInfo)InputInfo.GetFromPool(KeyStateInfo.s_poolType) ?? new KeyStateInfo();
KeyStateInfo keyStateInfo = (KeyStateInfo)GetFromPool(s_poolType) ?? new KeyStateInfo();
keyStateInfo.Initialize(action, deviceType, modifiers, repeatCount, key, systemKey, nativeMessageID, scanCode, eventFlags);
return keyStateInfo;
}
@@ -52,11 +52,11 @@ namespace Microsoft.Iris.Input
public bool IsRepeatOf(KeyStateInfo other) => other != null && this._key == other._key && this.IsRepeatOf((KeyActionInfo)other);
public KeyStateInfo MakeRepeatableCopy() => KeyStateInfo.Create(this.Action, this.DeviceType, this.Modifiers, this.RepeatCount, this._key, this.SystemKey, this.NativeMessageID, this.ScanCode, this.KeyboardFlags);
public KeyStateInfo MakeRepeatableCopy() => Create(this.Action, this.DeviceType, this.Modifiers, this.RepeatCount, this._key, this.SystemKey, this.NativeMessageID, this.ScanCode, this.KeyboardFlags);
public Keys Key => this._key;
protected override InputInfo.InfoType PoolType => KeyStateInfo.s_poolType;
protected override InputInfo.InfoType PoolType => s_poolType;
public override string ToString() => InvariantString.Format("{0}({1}, Key={2})", this.GetType().Name, Action, _key);
}
+5 -5
View File
@@ -10,11 +10,11 @@ namespace Microsoft.Iris.Input
{
internal class MouseButtonInfo : MouseActionInfo
{
private static InputInfo.InfoType s_poolType = InputInfo.InfoType.MouseButton;
private static InputInfo.InfoType s_poolType = InfoType.MouseButton;
private bool _doubleClick;
private bool _state;
static MouseButtonInfo() => InputInfo.SetPoolLimitMode(MouseButtonInfo.s_poolType, false);
static MouseButtonInfo() => SetPoolLimitMode(s_poolType, false);
private MouseButtonInfo()
{
@@ -32,7 +32,7 @@ namespace Microsoft.Iris.Input
bool state,
uint messageID)
{
MouseButtonInfo mouseButtonInfo = (MouseButtonInfo)InputInfo.GetFromPool(MouseButtonInfo.s_poolType) ?? new MouseButtonInfo();
MouseButtonInfo mouseButtonInfo = (MouseButtonInfo)GetFromPool(s_poolType) ?? new MouseButtonInfo();
mouseButtonInfo.Initialize(rawSource, rawNatural, x, y, screenX, screenY, modifiers, button, state, messageID);
return mouseButtonInfo;
}
@@ -51,7 +51,7 @@ namespace Microsoft.Iris.Input
{
this._state = state;
this._doubleClick = false;
this.Initialize(rawSource, rawNatural, x, y, screenX, screenY, modifiers, MouseButtonInfo.EventTypeForMouseButton(state, button, modifiers), messageID, button, 0);
this.Initialize(rawSource, rawNatural, x, y, screenX, screenY, modifiers, EventTypeForMouseButton(state, button, modifiers), messageID, button, 0);
}
public override InputEventType EventType => this._doubleClick ? InputEventType.MouseDoubleClick : this._eventType;
@@ -73,7 +73,7 @@ namespace Microsoft.Iris.Input
public bool IsDown => this._state;
protected override InputInfo.InfoType PoolType => MouseButtonInfo.s_poolType;
protected override InputInfo.InfoType PoolType => s_poolType;
public override string ToString() => InvariantString.Format("{0}({1}, Button={2})", this.GetType().Name, this._state ? "Down" : "Up", Button);
}
+4 -4
View File
@@ -8,11 +8,11 @@ namespace Microsoft.Iris.Input
{
internal class MouseFocusInfo : MouseInfo
{
private static InputInfo.InfoType s_poolType = InputInfo.InfoType.MouseFocus;
private static InputInfo.InfoType s_poolType = InfoType.MouseFocus;
private bool _state;
private ICookedInputSite _other;
static MouseFocusInfo() => InputInfo.SetPoolLimitMode(MouseFocusInfo.s_poolType, true);
static MouseFocusInfo() => SetPoolLimitMode(s_poolType, true);
private MouseFocusInfo()
{
@@ -25,7 +25,7 @@ namespace Microsoft.Iris.Input
bool state,
ICookedInputSite other)
{
MouseFocusInfo mouseFocusInfo = (MouseFocusInfo)InputInfo.GetFromPool(MouseFocusInfo.s_poolType) ?? new MouseFocusInfo();
MouseFocusInfo mouseFocusInfo = (MouseFocusInfo)GetFromPool(s_poolType) ?? new MouseFocusInfo();
mouseFocusInfo.Initialize(rawSource, x, y, state, other);
return mouseFocusInfo;
}
@@ -52,6 +52,6 @@ namespace Microsoft.Iris.Input
public bool State => this._state;
protected override InputInfo.InfoType PoolType => MouseFocusInfo.s_poolType;
protected override InputInfo.InfoType PoolType => s_poolType;
}
}
+4 -4
View File
@@ -8,9 +8,9 @@ namespace Microsoft.Iris.Input
{
internal class MouseMoveInfo : MouseActionInfo
{
private static InputInfo.InfoType s_poolType = InputInfo.InfoType.MouseMove;
private static InputInfo.InfoType s_poolType = InfoType.MouseMove;
static MouseMoveInfo() => InputInfo.SetPoolLimitMode(MouseMoveInfo.s_poolType, true);
static MouseMoveInfo() => SetPoolLimitMode(s_poolType, true);
private MouseMoveInfo()
{
@@ -25,11 +25,11 @@ namespace Microsoft.Iris.Input
int screenY,
InputModifiers modifiers)
{
MouseMoveInfo mouseMoveInfo = (MouseMoveInfo)InputInfo.GetFromPool(MouseMoveInfo.s_poolType) ?? new MouseMoveInfo();
MouseMoveInfo mouseMoveInfo = (MouseMoveInfo)GetFromPool(s_poolType) ?? new MouseMoveInfo();
mouseMoveInfo.Initialize(rawSource, rawNatural, x, y, screenX, screenY, modifiers, InputEventType.MouseMove, 512U, MouseButtons.None, 0);
return mouseMoveInfo;
}
protected override InputInfo.InfoType PoolType => MouseMoveInfo.s_poolType;
protected override InputInfo.InfoType PoolType => s_poolType;
}
}
+4 -4
View File
@@ -11,9 +11,9 @@ namespace Microsoft.Iris.Input
internal class MouseWheelInfo : MouseActionInfo
{
public const int k_defaultDelta = 120;
private static InputInfo.InfoType s_poolType = InputInfo.InfoType.MouseWheel;
private static InputInfo.InfoType s_poolType = InfoType.MouseWheel;
static MouseWheelInfo() => InputInfo.SetPoolLimitMode(MouseWheelInfo.s_poolType, true);
static MouseWheelInfo() => SetPoolLimitMode(s_poolType, true);
private MouseWheelInfo()
{
@@ -29,13 +29,13 @@ namespace Microsoft.Iris.Input
InputModifiers modifiers,
int delta)
{
MouseWheelInfo mouseWheelInfo = (MouseWheelInfo)InputInfo.GetFromPool(MouseWheelInfo.s_poolType) ?? new MouseWheelInfo();
MouseWheelInfo mouseWheelInfo = (MouseWheelInfo)GetFromPool(s_poolType) ?? new MouseWheelInfo();
mouseWheelInfo.Initialize(rawSource, rawNatural, x, y, screenX, screenY, modifiers, InputEventType.MouseWheel, 522U, MouseButtons.None, delta);
return mouseWheelInfo;
}
public override string ToString() => InvariantString.Format("{0}(Delta={1})", this.GetType().Name, WheelDelta);
protected override InputInfo.InfoType PoolType => MouseWheelInfo.s_poolType;
protected override InputInfo.InfoType PoolType => s_poolType;
}
}