Browse Source
Merge pull request #9628 from workgroupengineering/features/NetAnalyzers/CA1815
feat: Enable Rule CA1815
pull/9672/head
Max Katz
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
46 changed files with
70 additions and
57 deletions
-
.editorconfig
-
src/Android/Avalonia.Android/AndroidInputMethod.cs
-
src/Avalonia.Base/Animation/Cue.cs
-
src/Avalonia.Base/Data/BindingValue.cs
-
src/Avalonia.Base/Input/PointerPoint.cs
-
src/Avalonia.Base/Input/Raw/RawPointerEventArgs.cs
-
src/Avalonia.Base/Input/TextInput/ITextInputMethodClient.cs
-
src/Avalonia.Base/Logging/ParametrizedLogger.cs
-
src/Avalonia.Base/Matrix.cs
-
src/Avalonia.Base/Media/BoxShadow.cs
-
src/Avalonia.Base/Media/BoxShadows.cs
-
src/Avalonia.Base/Media/DrawingContext.cs
-
src/Avalonia.Base/Media/FontMetrics.cs
-
src/Avalonia.Base/Media/GlyphMetrics.cs
-
src/Avalonia.Base/Media/GlyphRunMetrics.cs
-
src/Avalonia.Base/Media/TextCollapsingCreateInfo.cs
-
src/Avalonia.Base/Media/TextFormatting/ShapedBuffer.cs
-
src/Avalonia.Base/Media/TextFormatting/SplitResult.cs
-
src/Avalonia.Base/Media/TextFormatting/TextLineMetrics.cs
-
src/Avalonia.Base/Media/TextFormatting/TextMetrics.cs
-
src/Avalonia.Base/Media/TextFormatting/TextRange.cs
-
src/Avalonia.Base/Media/TextFormatting/TextRunBounds.cs
-
src/Avalonia.Base/Media/TextFormatting/TextShaperOptions.cs
-
src/Avalonia.Base/Media/TextFormatting/Unicode/Codepoint.cs
-
src/Avalonia.Base/Media/TextFormatting/Unicode/LineBreak.cs
-
src/Avalonia.Base/Media/TextHitTestResult.cs
-
src/Avalonia.Base/Media/Transformation/TransformOperation.cs
-
src/Avalonia.Base/Media/Transformation/TransformOperations.cs
-
src/Avalonia.Base/Media/UnicodeRange.cs
-
src/Avalonia.Base/Platform/IRuntimePlatform.cs
-
src/Avalonia.Base/Rendering/Composition/Transport/BatchStream.cs
-
src/Avalonia.Base/Styling/SelectorMatch.cs
-
src/Avalonia.Base/Utilities/SmallDictionary.cs
-
src/Avalonia.Base/Utilities/StringTokenizer.cs
-
src/Avalonia.Base/Utilities/SynchronousCompletionAsyncResult.cs
-
src/Avalonia.Base/Utilities/ValueSpan.cs
-
src/Avalonia.Controls/AcrylicPlatformCompensationLevels.cs
-
src/Avalonia.Controls/Primitives/PopupPositioning/IPopupPositioner.cs
-
src/Avalonia.Controls/Selection/ISelectionModel.cs
-
src/Avalonia.Controls/Selection/SelectionModel.cs
-
src/Avalonia.Controls/TextBlock.cs
-
src/Avalonia.FreeDesktop/IX11InputMethod.cs
-
src/Avalonia.OpenGL/GlVersion.cs
-
src/Avalonia.X11/X11Structs.cs
-
src/Windows/Avalonia.Direct2D1/OptionalDispose.cs
-
src/Windows/Avalonia.Win32/WinRT/WinRTColor.cs
|
|
|
@ -144,6 +144,8 @@ dotnet_diagnostic.CS1591.severity = suggestion |
|
|
|
dotnet_diagnostic.CA1304.severity = warning |
|
|
|
# CA1802: Use literals where appropriate |
|
|
|
dotnet_diagnostic.CA1802.severity = warning |
|
|
|
# CA1815: Override equals and operator equals on value types |
|
|
|
dotnet_diagnostic.CA1815.severity = warning |
|
|
|
# CA1820: Test for empty strings using string length |
|
|
|
dotnet_diagnostic.CA1820.severity = warning |
|
|
|
# CA1821: Remove empty finalizers |
|
|
|
|
|
|
|
@ -167,7 +167,7 @@ namespace Avalonia.Android |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public readonly struct ComposingRegion |
|
|
|
public readonly record struct ComposingRegion |
|
|
|
{ |
|
|
|
private readonly int _start = -1; |
|
|
|
private readonly int _end = -1; |
|
|
|
|
|
|
|
@ -8,7 +8,7 @@ namespace Avalonia.Animation |
|
|
|
/// Determines the time index for a <see cref="KeyFrame"/>.
|
|
|
|
/// </summary>
|
|
|
|
[TypeConverter(typeof(CueTypeConverter))] |
|
|
|
public readonly struct Cue : IEquatable<Cue>, IEquatable<double> |
|
|
|
public readonly record struct Cue : IEquatable<Cue>, IEquatable<double> |
|
|
|
{ |
|
|
|
/// <summary>
|
|
|
|
/// The normalized percent value, ranging from 0.0 to 1.0
|
|
|
|
@ -49,15 +49,6 @@ namespace Avalonia.Animation |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Checks for equality between two <see cref="Cue"/>s.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="other">The second cue.</param>
|
|
|
|
public bool Equals(Cue other) |
|
|
|
{ |
|
|
|
return CueValue == other.CueValue; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Checks for equality between a <see cref="Cue"/>
|
|
|
|
/// and a <see cref="double"/> value.
|
|
|
|
|
|
|
|
@ -80,7 +80,7 @@ namespace Avalonia.Data |
|
|
|
/// - For an unset value, use <see cref="Unset"/> or simply `default`
|
|
|
|
/// - For other types, call one of the static factory methods
|
|
|
|
/// </remarks>
|
|
|
|
public readonly struct BindingValue<T> |
|
|
|
public readonly record struct BindingValue<T> |
|
|
|
{ |
|
|
|
private readonly T _value; |
|
|
|
|
|
|
|
|
|
|
|
@ -5,7 +5,7 @@ namespace Avalonia.Input |
|
|
|
/// <summary>
|
|
|
|
/// Provides basic properties for the input pointer associated with a single mouse, pen/stylus, or touch contact.
|
|
|
|
/// </summary>
|
|
|
|
public struct PointerPoint |
|
|
|
public record struct PointerPoint |
|
|
|
{ |
|
|
|
public PointerPoint(IPointer pointer, Point position, PointerPointProperties properties) |
|
|
|
{ |
|
|
|
@ -33,7 +33,7 @@ namespace Avalonia.Input |
|
|
|
/// <summary>
|
|
|
|
/// Provides extended properties for a PointerPoint object.
|
|
|
|
/// </summary>
|
|
|
|
public struct PointerPointProperties |
|
|
|
public record struct PointerPointProperties |
|
|
|
{ |
|
|
|
/// <summary>
|
|
|
|
/// Gets a value that indicates whether the pointer input was triggered by the primary action mode of an input device.
|
|
|
|
|
|
|
|
@ -130,7 +130,7 @@ namespace Avalonia.Input.Raw |
|
|
|
internal IInputElement? InputHitTestResult { get; set; } |
|
|
|
} |
|
|
|
|
|
|
|
public struct RawPointerPoint |
|
|
|
public record struct RawPointerPoint |
|
|
|
{ |
|
|
|
/// <summary>
|
|
|
|
/// Pointer position, in client DIPs.
|
|
|
|
|
|
|
|
@ -46,7 +46,7 @@ namespace Avalonia.Input.TextInput |
|
|
|
void SelectInSurroundingText(int start, int end); |
|
|
|
} |
|
|
|
|
|
|
|
public struct TextInputMethodSurroundingText |
|
|
|
public record struct TextInputMethodSurroundingText |
|
|
|
{ |
|
|
|
public string Text { get; set; } |
|
|
|
public int CursorOffset { get; set; } |
|
|
|
|
|
|
|
@ -5,7 +5,7 @@ namespace Avalonia.Logging |
|
|
|
/// <summary>
|
|
|
|
/// Logger sink parametrized for given logging level.
|
|
|
|
/// </summary>
|
|
|
|
public readonly struct ParametrizedLogger |
|
|
|
public readonly record struct ParametrizedLogger |
|
|
|
{ |
|
|
|
private readonly ILogSink _sink; |
|
|
|
private readonly LogEventLevel _level; |
|
|
|
|
|
|
|
@ -571,7 +571,7 @@ namespace Avalonia |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
public struct Decomposed |
|
|
|
public record struct Decomposed |
|
|
|
{ |
|
|
|
public Vector Translate; |
|
|
|
public Vector Scale; |
|
|
|
|
|
|
|
@ -171,5 +171,11 @@ namespace Avalonia.Media |
|
|
|
|
|
|
|
public Rect TransformBounds(in Rect rect) |
|
|
|
=> IsInset ? rect : rect.Translate(new Vector(OffsetX, OffsetY)).Inflate(Spread + Blur); |
|
|
|
|
|
|
|
public static bool operator ==(BoxShadow left, BoxShadow right) => |
|
|
|
left.Equals(right); |
|
|
|
|
|
|
|
public static bool operator !=(BoxShadow left, BoxShadow right) => |
|
|
|
!(left == right); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -62,7 +62,9 @@ namespace Avalonia.Media |
|
|
|
} |
|
|
|
|
|
|
|
[EditorBrowsable(EditorBrowsableState.Never)] |
|
|
|
#pragma warning disable CA1815 // Override equals and operator equals on value types
|
|
|
|
public struct BoxShadowsEnumerator |
|
|
|
#pragma warning restore CA1815 // Override equals and operator equals on value types
|
|
|
|
{ |
|
|
|
private int _index; |
|
|
|
private BoxShadows _shadows; |
|
|
|
@ -149,5 +151,11 @@ namespace Avalonia.Media |
|
|
|
return hashCode; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public static bool operator ==(BoxShadows left, BoxShadows right) => |
|
|
|
left.Equals(right); |
|
|
|
|
|
|
|
public static bool operator !=(BoxShadows left, BoxShadows right) => |
|
|
|
!(left == right); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -261,7 +261,7 @@ namespace Avalonia.Media |
|
|
|
DrawRectangle(brush, null, rect, cornerRadius, cornerRadius); |
|
|
|
} |
|
|
|
|
|
|
|
public readonly struct PushedState : IDisposable |
|
|
|
public readonly record struct PushedState : IDisposable |
|
|
|
{ |
|
|
|
private readonly int _level; |
|
|
|
private readonly DrawingContext _context; |
|
|
|
|
|
|
|
@ -3,7 +3,7 @@ |
|
|
|
/// <summary>
|
|
|
|
/// The font metrics is holding information about a font's ascent, descent, etc. in design em units.
|
|
|
|
/// </summary>
|
|
|
|
public readonly struct FontMetrics |
|
|
|
public readonly record struct FontMetrics |
|
|
|
{ |
|
|
|
/// <summary>
|
|
|
|
/// Gets the font design units per em.
|
|
|
|
|
|
|
|
@ -1,6 +1,6 @@ |
|
|
|
namespace Avalonia.Media; |
|
|
|
|
|
|
|
public readonly struct GlyphMetrics |
|
|
|
public readonly record struct GlyphMetrics |
|
|
|
{ |
|
|
|
/// <summary>
|
|
|
|
/// Distance from the x-origin to the left extremum of the glyph.
|
|
|
|
|
|
|
|
@ -1,6 +1,6 @@ |
|
|
|
namespace Avalonia.Media |
|
|
|
{ |
|
|
|
public readonly struct GlyphRunMetrics |
|
|
|
public readonly record struct GlyphRunMetrics |
|
|
|
{ |
|
|
|
public GlyphRunMetrics(double width, double widthIncludingTrailingWhitespace, double height, |
|
|
|
int trailingWhitespaceLength, int newLineLength, int firstCluster, int lastCluster) |
|
|
|
|
|
|
|
@ -2,7 +2,7 @@ |
|
|
|
|
|
|
|
namespace Avalonia.Media |
|
|
|
{ |
|
|
|
public readonly struct TextCollapsingCreateInfo |
|
|
|
public readonly record struct TextCollapsingCreateInfo |
|
|
|
{ |
|
|
|
public readonly double Width; |
|
|
|
public readonly TextRunProperties TextRunProperties; |
|
|
|
|
|
|
|
@ -262,7 +262,7 @@ namespace Avalonia.Media.TextFormatting |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public readonly struct GlyphInfo |
|
|
|
public readonly record struct GlyphInfo |
|
|
|
{ |
|
|
|
public GlyphInfo(ushort glyphIndex, int glyphCluster, double glyphAdvance = 0, Vector glyphOffset = default) |
|
|
|
{ |
|
|
|
|
|
|
|
@ -1,6 +1,8 @@ |
|
|
|
namespace Avalonia.Media.TextFormatting |
|
|
|
{ |
|
|
|
#pragma warning disable CA1815 // Override equals and operator equals on value types
|
|
|
|
public readonly struct SplitResult<T> |
|
|
|
#pragma warning restore CA1815 // Override equals and operator equals on value types
|
|
|
|
{ |
|
|
|
public SplitResult(T first, T? second) |
|
|
|
{ |
|
|
|
|
|
|
|
@ -4,7 +4,7 @@ |
|
|
|
/// Represents a metric for a <see cref="TextLine"/> objects,
|
|
|
|
/// that holds information about ascent, descent, line gap, size and origin of the text line.
|
|
|
|
/// </summary>
|
|
|
|
public readonly struct TextLineMetrics |
|
|
|
public readonly record struct TextLineMetrics |
|
|
|
{ |
|
|
|
public TextLineMetrics(bool hasOverflowed, double height, int newlineLength, double start, double textBaseline, |
|
|
|
int trailingWhitespaceLength, double width, |
|
|
|
|
|
|
|
@ -3,7 +3,7 @@ |
|
|
|
/// <summary>
|
|
|
|
/// A metric that holds information about text specific measurements.
|
|
|
|
/// </summary>
|
|
|
|
public readonly struct TextMetrics |
|
|
|
public readonly record struct TextMetrics |
|
|
|
{ |
|
|
|
public TextMetrics(IGlyphTypeface glyphTypeface, double fontRenderingEmSize) |
|
|
|
{ |
|
|
|
|
|
|
|
@ -5,7 +5,7 @@ namespace Avalonia.Media.TextFormatting |
|
|
|
/// <summary>
|
|
|
|
/// References a portion of a text buffer.
|
|
|
|
/// </summary>
|
|
|
|
public readonly struct TextRange |
|
|
|
public readonly record struct TextRange |
|
|
|
{ |
|
|
|
public TextRange(int start, int length) |
|
|
|
{ |
|
|
|
|
|
|
|
@ -3,7 +3,7 @@ |
|
|
|
/// <summary>
|
|
|
|
/// The bounding rectangle of text run
|
|
|
|
/// </summary>
|
|
|
|
public readonly struct TextRunBounds |
|
|
|
public readonly record struct TextRunBounds |
|
|
|
{ |
|
|
|
/// <summary>
|
|
|
|
/// Constructing TextRunBounds
|
|
|
|
|
|
|
|
@ -5,7 +5,7 @@ namespace Avalonia.Media.TextFormatting |
|
|
|
/// <summary>
|
|
|
|
/// Options to customize text shaping.
|
|
|
|
/// </summary>
|
|
|
|
public readonly struct TextShaperOptions |
|
|
|
public readonly record struct TextShaperOptions |
|
|
|
{ |
|
|
|
public TextShaperOptions( |
|
|
|
IGlyphTypeface typeface, |
|
|
|
|
|
|
|
@ -3,7 +3,7 @@ using System.Runtime.CompilerServices; |
|
|
|
|
|
|
|
namespace Avalonia.Media.TextFormatting.Unicode |
|
|
|
{ |
|
|
|
public readonly struct Codepoint |
|
|
|
public readonly record struct Codepoint |
|
|
|
{ |
|
|
|
private readonly uint _value; |
|
|
|
|
|
|
|
|
|
|
|
@ -24,7 +24,7 @@ namespace Avalonia.Media.TextFormatting.Unicode |
|
|
|
/// Information about a potential line break position
|
|
|
|
/// </summary>
|
|
|
|
[DebuggerDisplay("{PositionMeasure}/{PositionWrap} @ {Required}")] |
|
|
|
public readonly struct LineBreak |
|
|
|
public readonly record struct LineBreak |
|
|
|
{ |
|
|
|
/// <summary>
|
|
|
|
/// Constructor
|
|
|
|
|
|
|
|
@ -5,7 +5,7 @@ namespace Avalonia.Media |
|
|
|
/// <summary>
|
|
|
|
/// Holds a hit test result from a <see cref="TextLayout"/>.
|
|
|
|
/// </summary>
|
|
|
|
public readonly struct TextHitTestResult |
|
|
|
public readonly record struct TextHitTestResult |
|
|
|
{ |
|
|
|
public TextHitTestResult(CharacterHit characterHit, int textPosition, bool isInside, bool isTrailing) |
|
|
|
{ |
|
|
|
|
|
|
|
@ -5,7 +5,7 @@ namespace Avalonia.Media.Transformation |
|
|
|
/// <summary>
|
|
|
|
/// Represents a single primitive transform (like translation, rotation, scale, etc.).
|
|
|
|
/// </summary>
|
|
|
|
public struct TransformOperation |
|
|
|
public record struct TransformOperation |
|
|
|
{ |
|
|
|
public OperationType Type; |
|
|
|
public Matrix Matrix; |
|
|
|
@ -196,7 +196,7 @@ namespace Avalonia.Media.Transformation |
|
|
|
} |
|
|
|
|
|
|
|
[StructLayout(LayoutKind.Explicit)] |
|
|
|
public struct DataLayout |
|
|
|
public record struct DataLayout |
|
|
|
{ |
|
|
|
[FieldOffset(0)] public SkewLayout Skew; |
|
|
|
|
|
|
|
@ -206,25 +206,25 @@ namespace Avalonia.Media.Transformation |
|
|
|
|
|
|
|
[FieldOffset(0)] public RotateLayout Rotate; |
|
|
|
|
|
|
|
public struct SkewLayout |
|
|
|
public record struct SkewLayout |
|
|
|
{ |
|
|
|
public double X; |
|
|
|
public double Y; |
|
|
|
} |
|
|
|
|
|
|
|
public struct ScaleLayout |
|
|
|
public record struct ScaleLayout |
|
|
|
{ |
|
|
|
public double X; |
|
|
|
public double Y; |
|
|
|
} |
|
|
|
|
|
|
|
public struct TranslateLayout |
|
|
|
public record struct TranslateLayout |
|
|
|
{ |
|
|
|
public double X; |
|
|
|
public double Y; |
|
|
|
} |
|
|
|
|
|
|
|
public struct RotateLayout |
|
|
|
public record struct RotateLayout |
|
|
|
{ |
|
|
|
public double Angle; |
|
|
|
} |
|
|
|
|
|
|
|
@ -165,7 +165,7 @@ namespace Avalonia.Media.Transformation |
|
|
|
return Math.Max(from._operations.Count, to._operations.Count); |
|
|
|
} |
|
|
|
|
|
|
|
public readonly struct Builder |
|
|
|
public readonly record struct Builder |
|
|
|
{ |
|
|
|
private readonly List<TransformOperation> _operations; |
|
|
|
|
|
|
|
|
|
|
|
@ -7,7 +7,7 @@ namespace Avalonia.Media |
|
|
|
/// <summary>
|
|
|
|
/// The <see cref="UnicodeRange"/> descripes a set of Unicode characters.
|
|
|
|
/// </summary>
|
|
|
|
public readonly struct UnicodeRange |
|
|
|
public readonly record struct UnicodeRange |
|
|
|
{ |
|
|
|
public readonly static UnicodeRange Default = Parse("0-10FFFD"); |
|
|
|
|
|
|
|
@ -102,7 +102,7 @@ namespace Avalonia.Media |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public readonly struct UnicodeRangeSegment |
|
|
|
public readonly record struct UnicodeRangeSegment |
|
|
|
{ |
|
|
|
private static Regex s_regex = new Regex(@"^(?:[uU]\+)?(?:([0-9a-fA-F](?:[0-9a-fA-F?]{1,5})?))$"); |
|
|
|
|
|
|
|
|
|
|
|
@ -21,7 +21,7 @@ namespace Avalonia.Platform |
|
|
|
} |
|
|
|
|
|
|
|
[Unstable] |
|
|
|
public struct RuntimePlatformInfo |
|
|
|
public record struct RuntimePlatformInfo |
|
|
|
{ |
|
|
|
public OperatingSystemType OperatingSystem { get; set; } |
|
|
|
|
|
|
|
|
|
|
|
@ -21,7 +21,7 @@ internal class BatchStreamData |
|
|
|
public Queue<BatchStreamSegment<IntPtr>> Structs { get; } = new(); |
|
|
|
} |
|
|
|
|
|
|
|
public struct BatchStreamSegment<TData> |
|
|
|
public record struct BatchStreamSegment<TData> |
|
|
|
{ |
|
|
|
public TData Data { get; set; } |
|
|
|
public int ElementCount { get; set; } |
|
|
|
|
|
|
|
@ -43,7 +43,7 @@ namespace Avalonia.Styling |
|
|
|
/// A selector match describes whether and how a <see cref="Selector"/> matches a control, and
|
|
|
|
/// in addition whether the selector can ever match a control of the same type.
|
|
|
|
/// </remarks>
|
|
|
|
public readonly struct SelectorMatch |
|
|
|
public readonly record struct SelectorMatch |
|
|
|
{ |
|
|
|
/// <summary>
|
|
|
|
/// A selector match with the result of <see cref="SelectorMatchResult.NeverThisType"/>.
|
|
|
|
|
|
|
|
@ -5,7 +5,7 @@ using System.Diagnostics.CodeAnalysis; |
|
|
|
|
|
|
|
namespace Avalonia.Utilities; |
|
|
|
|
|
|
|
public struct InlineDictionary<TKey, TValue> : IEnumerable<KeyValuePair<TKey, TValue>> where TKey : class where TValue : class |
|
|
|
public record struct InlineDictionary<TKey, TValue> : IEnumerable<KeyValuePair<TKey, TValue>> where TKey : class where TValue : class |
|
|
|
{ |
|
|
|
object? _data; |
|
|
|
TValue? _value; |
|
|
|
|
|
|
|
@ -8,7 +8,7 @@ namespace Avalonia.Utilities |
|
|
|
#if !BUILDTASK
|
|
|
|
public |
|
|
|
#endif
|
|
|
|
struct StringTokenizer : IDisposable |
|
|
|
record struct StringTokenizer : IDisposable |
|
|
|
{ |
|
|
|
private const char DefaultSeparatorChar = ','; |
|
|
|
|
|
|
|
|
|
|
|
@ -8,7 +8,7 @@ namespace Avalonia.Utilities |
|
|
|
/// A task-like operation that is guaranteed to finish continuations synchronously,
|
|
|
|
/// can be used for parametrized one-shot events
|
|
|
|
/// </summary>
|
|
|
|
public struct SynchronousCompletionAsyncResult<T> : INotifyCompletion |
|
|
|
public record struct SynchronousCompletionAsyncResult<T> : INotifyCompletion |
|
|
|
{ |
|
|
|
private readonly SynchronousCompletionAsyncResultSource<T>? _source; |
|
|
|
private readonly T? _result; |
|
|
|
|
|
|
|
@ -3,7 +3,7 @@ |
|
|
|
/// <summary>
|
|
|
|
/// Pairing of value and positions sharing that value.
|
|
|
|
/// </summary>
|
|
|
|
public readonly struct ValueSpan<T> |
|
|
|
public readonly record struct ValueSpan<T> |
|
|
|
{ |
|
|
|
public ValueSpan(int start, int length, T value) |
|
|
|
{ |
|
|
|
|
|
|
|
@ -5,7 +5,7 @@ |
|
|
|
/// It controls the base opacity level of the 'tracing paper' layer that compensates
|
|
|
|
/// for low blur radius.
|
|
|
|
/// </summary>
|
|
|
|
public struct AcrylicPlatformCompensationLevels |
|
|
|
public record struct AcrylicPlatformCompensationLevels |
|
|
|
{ |
|
|
|
public AcrylicPlatformCompensationLevels(double transparent, double blurred, double acrylic) |
|
|
|
{ |
|
|
|
|
|
|
|
@ -64,7 +64,7 @@ namespace Avalonia.Controls.Primitives.PopupPositioning |
|
|
|
/// surface.
|
|
|
|
/// </remarks>
|
|
|
|
[Unstable] |
|
|
|
public struct PopupPositionerParameters |
|
|
|
public record struct PopupPositionerParameters |
|
|
|
{ |
|
|
|
private PopupGravity _gravity; |
|
|
|
private PopupAnchor _anchor; |
|
|
|
|
|
|
|
@ -39,7 +39,7 @@ namespace Avalonia.Controls.Selection |
|
|
|
return new BatchUpdateOperation(model); |
|
|
|
} |
|
|
|
|
|
|
|
public struct BatchUpdateOperation : IDisposable |
|
|
|
public record struct BatchUpdateOperation : IDisposable |
|
|
|
{ |
|
|
|
private readonly ISelectionModel _owner; |
|
|
|
private bool _isDisposed; |
|
|
|
|
|
|
|
@ -738,7 +738,7 @@ namespace Avalonia.Controls.Selection |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public struct BatchUpdateOperation : IDisposable |
|
|
|
public record struct BatchUpdateOperation : IDisposable |
|
|
|
{ |
|
|
|
private readonly SelectionModel<T> _owner; |
|
|
|
private bool _isDisposed; |
|
|
|
|
|
|
|
@ -827,7 +827,7 @@ namespace Avalonia.Controls |
|
|
|
InvalidateTextLayout(); |
|
|
|
} |
|
|
|
|
|
|
|
protected readonly struct SimpleTextSource : ITextSource |
|
|
|
protected readonly record struct SimpleTextSource : ITextSource |
|
|
|
{ |
|
|
|
private readonly CharacterBufferRange _text; |
|
|
|
private readonly TextRunProperties _defaultProperties; |
|
|
|
|
|
|
|
@ -11,7 +11,9 @@ namespace Avalonia.FreeDesktop |
|
|
|
(ITextInputMethodImpl method, IX11InputMethodControl control) CreateClient(IntPtr xid); |
|
|
|
} |
|
|
|
|
|
|
|
#pragma warning disable CA1815 // Override equals and operator equals on value types
|
|
|
|
public struct X11InputMethodForwardedKey |
|
|
|
#pragma warning restore CA1815 // Override equals and operator equals on value types
|
|
|
|
{ |
|
|
|
public int KeyVal { get; set; } |
|
|
|
public KeyModifiers Modifiers { get; set; } |
|
|
|
|
|
|
|
@ -6,7 +6,7 @@ namespace Avalonia.OpenGL |
|
|
|
OpenGLES |
|
|
|
} |
|
|
|
|
|
|
|
public struct GlVersion |
|
|
|
public record struct GlVersion |
|
|
|
{ |
|
|
|
public GlProfileType Type { get; } |
|
|
|
public int Major { get; } |
|
|
|
|
|
|
|
@ -1768,7 +1768,9 @@ namespace Avalonia.X11 { |
|
|
|
} |
|
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential)] |
|
|
|
#pragma warning disable CA1815 // Override equals and operator equals on value types
|
|
|
|
public unsafe struct XImage |
|
|
|
#pragma warning restore CA1815 // Override equals and operator equals on value types
|
|
|
|
{ |
|
|
|
public int width, height; /* size of image */ |
|
|
|
public int xoffset; /* number of pixels offset in X direction */ |
|
|
|
@ -1799,7 +1801,7 @@ namespace Avalonia.X11 { |
|
|
|
internal IntPtr green_mask; |
|
|
|
internal IntPtr blue_mask; |
|
|
|
internal int colormap_size; |
|
|
|
internal int bits_per_rgb; |
|
|
|
internal int bits_per_rgb; |
|
|
|
} |
|
|
|
|
|
|
|
internal enum XIMFeedback |
|
|
|
|
|
|
|
@ -2,7 +2,7 @@ |
|
|
|
|
|
|
|
namespace Avalonia.Direct2D1 |
|
|
|
{ |
|
|
|
public readonly struct OptionalDispose<T> : IDisposable where T : IDisposable |
|
|
|
public readonly record struct OptionalDispose<T> : IDisposable where T : IDisposable |
|
|
|
{ |
|
|
|
private readonly bool _dispose; |
|
|
|
|
|
|
|
|
|
|
|
@ -3,7 +3,7 @@ |
|
|
|
namespace Avalonia.Win32.WinRT |
|
|
|
{ |
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1)] |
|
|
|
public struct WinRTColor |
|
|
|
public record struct WinRTColor |
|
|
|
{ |
|
|
|
public byte A; |
|
|
|
public byte R; |
|
|
|
|