/
githubmirror
/
PowerToys
Обзор
Документация
Войти
/
githubmirror
/
PowerToys
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/modules/MouseUtils/MouseJump.Models/Styles/BoxStyle.cs
98 строк
3 KB
Michael Clayton
Ready for Review - [Mouse Jump] - port upstream WinUI3 code to Mouse Jump (microsoft#48290) (#48393)
07 авг 2026, 08:34
Не верифицирован
07 авг 2026, 08:34
e0010c5
Код
Авторство
О чём код?
// Copyright (c) Microsoft Corporation // The Microsoft Corporation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. namespace MouseJump.Models.Styles; /// <summary> /// Represents the styles to apply to a simple box-layout based drawing object. /// </summary> public sealed class BoxStyle { /* see https://www.w3schools.com/css/css_boxmodel.asp +--------------[bounds]---------------+ |▒▒▒▒▒▒▒▒▒▒▒▒▒▒[margin]▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒| |▒▒▓▓▓▓▓▓▓▓▓▓▓▓[border]▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒| |▒▒▓▓░░░░░░░░░░[padding]░░░░░░░░░░▓▓▒▒| |▒▒▓▓░░ ░░▓▓▒▒| |▒▒▓▓░░ ░░▓▓▒▒| |▒▒▓▓░░ [content] ░░▓▓▒▒| |▒▒▓▓░░ ░░▓▓▒▒| |▒▒▓▓░░ ░░▓▓▒▒| |▒▒▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▒▒| |▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒| |▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒| +-------------------------------------+ */ public static readonly BoxStyle Empty = new( MarginStyle.Empty, BorderStyle.Empty, PaddingStyle.Empty, BackgroundStyle.Empty, isEmpty: true); public BoxStyle( MarginStyle marginStyle, BorderStyle borderStyle, PaddingStyle paddingStyle, BackgroundStyle backgroundStyle) : this(marginStyle, borderStyle, paddingStyle, backgroundStyle, false) { } private BoxStyle( MarginStyle marginStyle, BorderStyle borderStyle, PaddingStyle paddingStyle, BackgroundStyle backgroundStyle, bool isEmpty) { this.MarginStyle = marginStyle ?? throw new ArgumentNullException(nameof(marginStyle)); this.BorderStyle = borderStyle ?? throw new ArgumentNullException(nameof(borderStyle)); this.PaddingStyle = paddingStyle ?? throw new ArgumentNullException(nameof(paddingStyle)); this.BackgroundStyle = backgroundStyle ?? throw new ArgumentNullException(nameof(backgroundStyle)); this.IsEmpty = isEmpty; } /// <summary> /// Gets the margin style for this layout box. /// </summary> public MarginStyle MarginStyle { get; } /// <summary> /// Gets the border style for this layout box. /// </summary> public BorderStyle BorderStyle { get; } /// <summary> /// Gets the padding style for this layout box. /// </summary> public PaddingStyle PaddingStyle { get; } /// <summary> /// Gets the background fill style for the content area of this layout box. /// </summary> public BackgroundStyle BackgroundStyle { get; } public bool IsEmpty { get; } }