Skip to content

Commit

Permalink
Enable IDE0200 (remove unnecessary lambda expression) (dotnet#7916)
Browse files Browse the repository at this point in the history
  • Loading branch information
elachlan authored and v-elnovikova committed Oct 18, 2022
1 parent 3ac5229 commit 4d6bacc
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion eng/CodeAnalysis.src.globalconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1708,7 +1708,7 @@ dotnet_diagnostic.IDE0170.severity = warning
dotnet_diagnostic.IDE0180.severity = suggestion

# IDE0200: Remove unnecessary lambda expression
dotnet_diagnostic.IDE0200.severity = none # TODO: warning
dotnet_diagnostic.IDE0200.severity = warning

# IDE0210: Use top-level statements
dotnet_diagnostic.IDE0210.severity = silent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public override object EditValue(ITypeDescriptorContext context, IServiceProvide
_currentContext = context;

// Child modal dialog - launching in SystemAware mode.
CollectionForm localCollectionForm = DpiHelper.CreateInstanceInSystemAwareContext(() => CreateCollectionForm());
CollectionForm localCollectionForm = DpiHelper.CreateInstanceInSystemAwareContext(CreateCollectionForm);
ITypeDescriptorContext lastContext = _currentContext;
localCollectionForm.EditValue = value;
_ignoreChangingEvents = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2108,7 +2108,7 @@ protected void OnMenuPaste(object sender, EventArgs e)
return; // nothing we can do here!

IDataObject dataObj = null;
bool clipboardOperationSuccessful = ExecuteSafely(() => Clipboard.GetDataObject(), false, out dataObj);
bool clipboardOperationSuccessful = ExecuteSafely(Clipboard.GetDataObject, false, out dataObj);

if (clipboardOperationSuccessful)
{
Expand Down Expand Up @@ -3505,7 +3505,7 @@ protected void OnStatusPaste(object sender, EventArgs e)
// Not being inherited. Now look at the contents of the data
//
IDataObject dataObj = null;
bool clipboardOperationSuccessful = ExecuteSafely(() => Clipboard.GetDataObject(), false, out dataObj);
bool clipboardOperationSuccessful = ExecuteSafely(Clipboard.GetDataObject, false, out dataObj);

bool enable = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public object GetHandler(Type handlerType)

Debug.Assert(_handlers.Count > 0, "Should have handlers to look through.");

object handler = _handlers.FirstOrDefault(h => handlerType.IsInstanceOfType(h));
object handler = _handlers.FirstOrDefault(handlerType.IsInstanceOfType);

if (handler != null)
{
Expand Down

0 comments on commit 4d6bacc

Please sign in to comment.