-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIUIElementBuilder.cs
47 lines (41 loc) · 1.35 KB
/
IUIElementBuilder.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Developed by Bulat Bagaviev (@sunnyyssh).
// This file is licensed to you under the MIT license.
namespace Sunnyyssh.ConsoleUI;
/// <summary>
/// Builds <see cref="UIElement"/> instance.
/// </summary>
public interface IUIElementBuilder
{
/// <summary>
/// The size of the future <see cref="UIElement"/> instance.
/// </summary>
Size Size { get; }
/// <summary>
/// Builds <see cref="UIElement"/> instance.
/// </summary>
/// <param name="args">Build args.</param>
/// <returns>Created instance.</returns>
UIElement Build(UIElementBuildArgs args);
internal IUIElementBuilder UnsafeWithSize(Size newSize)
{
return new UnsafeBuilder(this, newSize);
}
}
/// <summary>
/// Builds <see cref="TUIElement"/> instance.
/// </summary>
/// <typeparam name="TUIElement">The type of <see cref="UIElement"/> inheritor.</typeparam>
public interface IUIElementBuilder<out TUIElement> : IUIElementBuilder
where TUIElement : UIElement
{
/// <summary>
/// Builds <see cref="TUIElement"/> instance.
/// </summary>
/// <param name="args">Build args.</param>
/// <returns>Created instance.</returns>
new TUIElement Build(UIElementBuildArgs args);
internal new IUIElementBuilder<TUIElement> UnsafeWithSize(Size newSize)
{
return new UnsafeBuilder<TUIElement>(this, newSize);
}
}