Silence IDE0290.
This rule recommends use of primary constructors. Apply the suggestions on simple POCOs, adjusting some to readonly/structs/records at the same time. For more complex classes, the use of primary constructors is more distracting than helpful, so silence the rule. IDEs can still offer fixes for using primary constructors, but it will not show up as a build issue.
This commit is contained in:
committed by
Gustas Kažukauskas
parent
3de6a5fd5a
commit
36660b89e9
@@ -182,22 +182,14 @@ namespace OpenRA.Widgets
|
||||
protected virtual void Dispose(bool disposing) { }
|
||||
}
|
||||
|
||||
public struct WidgetBounds
|
||||
public struct WidgetBounds(int x, int y, int width, int height)
|
||||
{
|
||||
public int X, Y, Width, Height;
|
||||
public int X = x, Y = y, Width = width, Height = height;
|
||||
public readonly int Left => X;
|
||||
public readonly int Right => X + Width;
|
||||
public readonly int Top => Y;
|
||||
public readonly int Bottom => Y + Height;
|
||||
|
||||
public WidgetBounds(int x, int y, int width, int height)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
Width = width;
|
||||
Height = height;
|
||||
}
|
||||
|
||||
public readonly Rectangle ToRectangle()
|
||||
{
|
||||
return new Rectangle(X, Y, Width, Height);
|
||||
|
||||
Reference in New Issue
Block a user