Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ide0100 reaction #11131

Merged
merged 4 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ private void ToolStripDropDown_Closing(object? sender, ToolStripDropDownClosingE
e.Cancel = false;
}

if (e.Cancel == false)
if (!e.Cancel)
{
// We WILL disappear
Debug.Assert(_lastPanelComponent is not null, "last panel component should not be null here... " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1412,7 +1412,7 @@ protected void OnMenuCopy(object? sender, EventArgs e)
stream.Seek(0, SeekOrigin.Begin);
byte[] bytes = stream.GetBuffer();
IDataObject dataObj = new DataObject(CF_DESIGNER, bytes);
if (ExecuteSafely(() => Clipboard.SetDataObject(dataObj), throwOnException: false) == false)
if (!ExecuteSafely(() => Clipboard.SetDataObject(dataObj), throwOnException: false))
{
_uiService?.ShowError(SR.ClipboardError);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ private void dataGridView_ColumnRemoved(object? sender, DataGridViewColumnEventA
// of the column collection but there is no event there and we are restricted from adding any
// Note: this does not break Undo/Redo because Undo/Redo uses serialization the same way
// the build does and DisplayIndex is not serialized
if (e.Column is not null && e.Column.IsDataBound == false)
if (e.Column is not null && !e.Column.IsDataBound)
e.Column.DisplayIndex = -1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ internal override void TrackInput(bool track)
// fine if it is an external manager, because it has already pushed a loop.
if (ComponentManager is not null && _externalComponentManager)
{
if (mustBeActive == false)
if (!mustBeActive)
{
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3748,7 +3748,7 @@ private unsafe void WaitForWaitHandle(WaitHandle waitHandle)
// If we didn't find the thread, or if GetExitCodeThread failed, we don't know the thread's state:
// if we don't know, we shouldn't throw.
if ((returnValue && exitCode != NTSTATUS.STILL_ACTIVE)
|| (returnValue == false && Marshal.GetLastWin32Error() == (int)WIN32_ERROR.ERROR_INVALID_HANDLE)
|| (!returnValue && Marshal.GetLastWin32Error() == (int)WIN32_ERROR.ERROR_INVALID_HANDLE)
|| AppDomain.CurrentDomain.IsFinalizingForUnload())
{
if (waitHandle.WaitOne(1, false))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3779,7 +3779,7 @@ protected override unsafe void WndProc(ref Message m)
// WM_MOUSELEAVE to ourselves, since that also sets up the right state. Or... at least the state is the same
// as with Theming on.

if (!Application.RenderWithVisualStyles && GetStyle(ControlStyles.UserPaint) == false
if (!Application.RenderWithVisualStyles && !GetStyle(ControlStyles.UserPaint)
&& DropDownStyle == ComboBoxStyle.DropDownList
&& (FlatStyle == FlatStyle.Flat || FlatStyle == FlatStyle.Popup))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10925,7 +10925,7 @@ private void MoveRowHeadersOrColumnResize(int x)

public virtual void NotifyCurrentCellDirty(bool dirty)
{
if (_dataGridViewState1[State1_IgnoringEditingChanges] == false)
if (!_dataGridViewState1[State1_IgnoringEditingChanges])
{
// autosizing has no effect since edited value hasn't been committed
// and autosizing code only looks at committed values.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3106,7 +3106,7 @@ public bool ReadOnly
Debug.Assert(_individualReadOnlyCells.Count == 0);
for (int columnIndex = 0; columnIndex < Columns.Count; columnIndex++)
{
Debug.Assert(Columns[columnIndex].ReadOnly == false);
Debug.Assert(!Columns[columnIndex].ReadOnly);
}

int rowCount = Rows.Count;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public bool ThreeState
DataGridView.InvalidateColumn(Index);
}

if (value && DefaultCellStyle.NullValue is bool boolValue && boolValue == false)
if (value && DefaultCellStyle.NullValue is bool boolValue && !boolValue)
{
DefaultCellStyle.NullValue = CheckState.Indeterminate;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ protected override void OnPaint(PaintEventArgs e)
// We only pass in the text color if it is explicitly set, else we let the renderer use the color
// specified by the theme. This is a temporary workaround till we find a good solution for the
// "default theme color" issue.
if (ShouldSerializeForeColor() || Enabled == false)
if (ShouldSerializeForeColor() || !Enabled)
{
Color textcolor = Enabled ? ForeColor : TextRenderer.DisabledTextColor(BackColor);
GroupBoxRenderer.DrawGroupBox(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ public override Font Font
{
base.Font = value;

if (_integralHeight == false)
if (!_integralHeight)
{
// Refresh the list to force the scroll bars to display
// when the integral height is false.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ public void BeginEdit()
if (Index >= 0)
{
ListView lv = ListView!;
if (lv.LabelEdit == false)
if (!lv.LabelEdit)
{
throw new InvalidOperationException(SR.ListViewBeginEditFailed);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ internal override void Collapse()

internal override void Expand()
{
if (this.TryGetOwnerAs(out GridEntry? owner) && owner.Expandable && owner.Expanded == false)
if (this.TryGetOwnerAs(out GridEntry? owner) && owner.Expandable && !owner.Expanded)
{
owner.Expanded = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ protected override bool ProcessDialogKey(Keys keyData)
protected override void SetVisibleCore(bool value)
{
// Make sure we don't have the mouse captured if we're going invisible.
if (value == false && HookMouseDown)
if (!value && HookMouseDown)
{
_mouseHook.HookMouseDown = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2593,7 +2593,7 @@ public void Paste(DataFormats.Format clipFormat)

protected override bool ProcessCmdKey(ref Message m, Keys keyData)
{
if (RichTextShortcutsEnabled == false)
if (!RichTextShortcutsEnabled)
{
foreach (int shortcutValue in s_shortcutsToDisable!)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ public bool Multiline
if (Multiline != value)
{
SetState(State.Multiline, value);
if (Multiline == false && (_alignment == TabAlignment.Left || _alignment == TabAlignment.Right))
if (!Multiline && (_alignment == TabAlignment.Left || _alignment == TabAlignment.Right))
{
_alignment = TabAlignment.Top;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2321,7 +2321,7 @@ private void PasteInt(string? text)
{
string? message = null;

if (!_flagState[s_isNullMask] && _maskedTextProvider.MaskCompleted == false)
if (!_flagState[s_isNullMask] && !_maskedTextProvider.MaskCompleted)
{
message = SR.MaskedTextBoxIncompleteMsg;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
// the shortcut key we are not supported in TextBox.
bool returnedValue = base.ProcessCmdKey(ref msg, keyData);

if (ShortcutsEnabled == false && s_shortcutsToDisable is not null)
if (!ShortcutsEnabled && s_shortcutsToDisable is not null)
{
foreach (int shortcutValue in s_shortcutsToDisable)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ internal bool CanHotTrack
if (!Focused)
{
// if ContainsFocus in one of the children = false, someone is just mousing by, we can hot track
return (ContainsFocus == false);
return !ContainsFocus;
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2012,7 +2012,7 @@ private void ShowCore()

private bool ShouldSerializeDropShadowEnabled()
{
return _dropShadowEnabled == false;
return !_dropShadowEnabled;
}

internal override bool ShouldSerializeLayoutStyle()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ private void SetActiveToolStripCore(ToolStrip toolStrip)
// For something that never closes, don't use menu mode.
ToolStripDropDown dropDown = (ToolStripDropDown)toolStrip;

if (dropDown.AutoClose == false)
if (!dropDown.AutoClose)
{
// Store off the current active hwnd
HWND hwndActive = PInvoke.GetActiveWindow();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ private static bool CanChangeSelection(ToolStrip start, ToolStrip toolStrip)
return false;
}

bool canChange = toolStrip.TabStop == false &&
bool canChange = !toolStrip.TabStop &&
toolStrip.Enabled &&
toolStrip.Visible &&
!toolStrip.IsDisposed &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public event EventHandler? DefaultItemChanged
remove => Events.RemoveHandler(s_eventDefaultItemChanged, value);
}

protected internal override bool DismissWhenClicked => DropDown.Visible != true;
protected internal override bool DismissWhenClicked => !DropDown.Visible;

internal override Rectangle DropDownButtonArea => DropDownButtonBounds;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ private int SendNextItemToOverflow(int spaceNeeded, bool horizontal)

// send the item to the overflow.
item.SetPlacement(ToolStripItemPlacement.Overflow);
if (OverflowRequired == false)
if (!OverflowRequired)
{
// this is the first item we're sending down.
// we now need to account for the width or height of the overflow button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1276,7 +1276,7 @@ public void BeginEdit()
if (HTREEITEMInternal != IntPtr.Zero)
{
TreeView tv = TreeView!;
if (tv.LabelEdit == false)
if (!tv.LabelEdit)
{
throw new InvalidOperationException(SR.TreeNodeBeginEditFailed);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ protected override void UpdateEditText()
"DecimalValue lies outside of [minimum, maximum]");

Text = GetNumberText(_currentValue);
Debug.Assert(ChangingText == false, "ChangingText should have been set to false");
Debug.Assert(!ChangingText, "ChangingText should have been set to false");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ protected virtual void OnTextBoxTextChanged(object? source, EventArgs e)
{
if (ChangingText)
{
Debug.Assert(UserEdit == false, "OnTextBoxTextChanged() - UserEdit == true");
Debug.Assert(!UserEdit, "OnTextBoxTextChanged() - UserEdit == true");
ChangingText = false;
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ internal bool PullData(bool reformat, bool force)
// on this binding because we know the value in the control was valid and has been accepted by
// the data source. But if the operation failed (or was cancelled), we must leave the dirty flag
// alone, so that the control's value will continue to be re-validated and re-pulled later.
if (args.BindingCompleteState == BindingCompleteState.Success && args.Cancel == false)
if (args.BindingCompleteState == BindingCompleteState.Success && !args.Cancel)
{
_state.ChangeFlags(BindingStates.Modified, false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ internal virtual void ApplyChanges(bool lastApply)
_cancelButton.Text = SR.CloseCaption;
_dirty = false;

if (lastApply == false)
if (!lastApply)
{
for (int n = 0; n < _pageSites.Length; n++)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6406,7 +6406,7 @@ private void WmNCDestroy(ref Message m)

if (Modal && _dialogResult == DialogResult.None)
{
if (GetState(States.Recreate) == false)
if (!GetState(States.Recreate))
{
DialogResult = DialogResult.Cancel;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ internal static void SetAutoSize(IArrangedElement element, bool value)
BitVector32 state = GetLayoutState(element);
state[s_autoSizeSection] = value ? 1 : 0;
SetLayoutState(element, state);
if (value == false)
if (!value)
{
// If autoSize is being turned off, restore the control to its specified bounds.
element.SetBounds(GetSpecifiedBounds(element), BoundsSpecified.None);
Expand Down