Skip to content

Commit 3b223c0

Browse files
authored
Merge pull request #44 from MADE-Apps/winux-port-1
PR for Partial Port of WinUX
2 parents c8da322 + 5784b55 commit 3b223c0

24 files changed

Lines changed: 1275 additions & 14 deletions

MADE.App.Diagnostics/MADE.App.Diagnostics.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<Authors>MADE Apps</Authors>
3333
<Company>MADE Apps</Company>
3434
<Product>MADE App Diagnostics Library</Product>
35-
<Description>Making App Development Easier with a collection of easy to diagnostic helpers for managing application exceptions and logging for .NET projects across Windows, Android, and iOS.</Description>
35+
<Description>Making App Development Easier with a collection of easy to use diagnostic helpers for managing application exceptions and logging for .NET projects across Windows, Android, and iOS.</Description>
3636
<Copyright>Copyright (C) MADE Apps. All rights reserved.</Copyright>
3737
<PackageLicenseUrl>https://github.com/MADE-Apps/MADE-App-Components/blob/master/LICENSE</PackageLicenseUrl>
3838
<PackageProjectUrl>https://github.com/MADE-Apps/MADE-App-Components</PackageProjectUrl>

MADE.App.Views.Dialogs/AppDialog.cs

Lines changed: 412 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
// --------------------------------------------------------------------------------------------------------------------
2+
// <copyright file="DialogButton.cs" company="MADE Apps">
3+
// Copyright (c) MADE Apps.
4+
// </copyright>
5+
// <summary>
6+
// Defines a button to be used within a application system alert dialog.
7+
// </summary>
8+
// --------------------------------------------------------------------------------------------------------------------
9+
10+
namespace MADE.App.Views.Dialogs.Buttons
11+
{
12+
/// <summary>
13+
/// Defines a button to be used within a application system alert dialog.
14+
/// </summary>
15+
public class DialogButton
16+
{
17+
/// <summary>
18+
/// Initializes a new instance of the <see cref="DialogButton"/> class.
19+
/// </summary>
20+
/// <param name="type">
21+
/// The type of button.
22+
/// </param>
23+
public DialogButton(DialogButtonType type)
24+
{
25+
this.Type = type;
26+
}
27+
28+
/// <summary>
29+
/// Initializes a new instance of the <see cref="DialogButton"/> class with content text.
30+
/// </summary>
31+
/// <param name="type">
32+
/// The type of button.
33+
/// </param>
34+
/// <param name="content">
35+
/// The content text to display on the button.
36+
/// </param>
37+
public DialogButton(DialogButtonType type, string content)
38+
{
39+
this.Type = type;
40+
this.Content = content;
41+
}
42+
43+
/// <summary>
44+
/// Initializes a new instance of the <see cref="DialogButton"/> class with content text and an invoke action.
45+
/// </summary>
46+
/// <param name="type">
47+
/// The type of button.
48+
/// </param>
49+
/// <param name="content">
50+
/// The content text to display on the button.
51+
/// </param>
52+
/// <param name="invokeAction">
53+
/// The action to perform when the button is invoked.
54+
/// </param>
55+
public DialogButton(DialogButtonType type, string content, DialogButtonInvokedHandler invokeAction)
56+
{
57+
this.Type = type;
58+
this.Content = content;
59+
this.InvokeAction = invokeAction;
60+
}
61+
62+
/// <summary>
63+
/// Gets the type of button.
64+
/// </summary>
65+
public DialogButtonType Type { get; }
66+
67+
/// <summary>
68+
/// Gets or sets the content text to display on the button.
69+
/// </summary>
70+
public string Content { get; set; }
71+
72+
/// <summary>
73+
/// Gets or sets the action to perform when the button is invoked.
74+
/// </summary>
75+
public DialogButtonInvokedHandler InvokeAction { get; set; }
76+
77+
/// <summary>
78+
/// Invokes the specified <see cref="InvokeAction"/>.
79+
/// </summary>
80+
public void Invoke()
81+
{
82+
this.InvokeAction?.Invoke(this);
83+
}
84+
}
85+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// --------------------------------------------------------------------------------------------------------------------
2+
// <copyright file="DialogButtonInvokedHandler.cs" company="MADE Apps">
3+
// Copyright (c) MADE Apps.
4+
// </copyright>
5+
// <summary>
6+
// The event handler for handling when a dialog button has been invoked.
7+
// </summary>
8+
// --------------------------------------------------------------------------------------------------------------------
9+
10+
namespace MADE.App.Views.Dialogs.Buttons
11+
{
12+
/// <summary>
13+
/// The event handler for handling when a dialog button has been invoked.
14+
/// </summary>
15+
/// <param name="button">
16+
/// The button.
17+
/// </param>
18+
public delegate void DialogButtonInvokedHandler(DialogButton button);
19+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// --------------------------------------------------------------------------------------------------------------------
2+
// <copyright file="DialogButtonType.cs" company="MADE Apps">
3+
// Copyright (c) MADE Apps.
4+
// </copyright>
5+
// <summary>
6+
// Defines values associated with the type of a dialog button.
7+
// </summary>
8+
// --------------------------------------------------------------------------------------------------------------------
9+
10+
namespace MADE.App.Views.Dialogs.Buttons
11+
{
12+
/// <summary>
13+
/// Defines values associated with the type of a dialog button.
14+
/// </summary>
15+
public enum DialogButtonType
16+
{
17+
/// <summary>
18+
/// The button is neutral and can be used to perform any action.
19+
/// </summary>
20+
Neutral,
21+
22+
/// <summary>
23+
/// The button is positive and can be used to perform positive actions, such as saving.
24+
/// </summary>
25+
Positive,
26+
27+
/// <summary>
28+
/// The button is negative and can be used to perform negative actions, such as cancelling.
29+
/// </summary>
30+
Negative
31+
}
32+
}
Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
// --------------------------------------------------------------------------------------------------------------------
2+
// <copyright file="IAppDialog.cs" company="MADE Apps">
3+
// Copyright (c) MADE Apps.
4+
// </copyright>
5+
// <summary>
6+
// Defines an interface for handling application system alert dialogs.
7+
// </summary>
8+
// --------------------------------------------------------------------------------------------------------------------
9+
10+
namespace MADE.App.Views.Dialogs
11+
{
12+
using System;
13+
using System.Threading.Tasks;
14+
15+
using MADE.App.Views.Dialogs.Buttons;
16+
17+
/// <summary>
18+
/// Defines an interface for handling application system alert dialogs.
19+
/// </summary>
20+
public interface IAppDialog
21+
{
22+
/// <summary>
23+
/// Shows an application system alert dialog with the specified message.
24+
/// </summary>
25+
/// <param name="message">
26+
/// The message to display.
27+
/// </param>
28+
void Show(string message);
29+
30+
/// <summary>
31+
/// Shows an application system alert dialog with the specified message and dialog buttons.
32+
/// </summary>
33+
/// <param name="message">
34+
/// The message to display.
35+
/// </param>
36+
/// <param name="buttons">
37+
/// The button definitions for performing actions.
38+
/// </param>
39+
void Show(string message, params DialogButton[] buttons);
40+
41+
/// <summary>
42+
/// Shows an application system alert dialog with the specified message, cancellation action and dialog buttons.
43+
/// </summary>
44+
/// <param name="message">
45+
/// The message to display.
46+
/// </param>
47+
/// <param name="cancelAction">
48+
/// The action to perform when the dialog has been cancelled/dismissed.
49+
/// </param>
50+
/// <param name="buttons">
51+
/// The button definitions for performing actions.
52+
/// </param>
53+
void Show(string message, Action cancelAction, params DialogButton[] buttons);
54+
55+
/// <summary>
56+
/// Shows an application system alert dialog with the specified title and message.
57+
/// </summary>
58+
/// <param name="title">
59+
/// The title to display.
60+
/// </param>
61+
/// <param name="message">
62+
/// The message to display.
63+
/// </param>
64+
void Show(string title, string message);
65+
66+
/// <summary>
67+
/// Shows an application system alert dialog with the specified title, message and dialog buttons.
68+
/// </summary>
69+
/// <param name="title">
70+
/// The title to display.
71+
/// </param>
72+
/// <param name="message">
73+
/// The message to display.
74+
/// </param>
75+
/// <param name="buttons">
76+
/// The button definitions for performing actions.
77+
/// </param>
78+
void Show(string title, string message, params DialogButton[] buttons);
79+
80+
/// <summary>
81+
/// Shows an application system alert dialog with the specified title, message, cancellation action and dialog buttons.
82+
/// </summary>
83+
/// <param name="title">
84+
/// The title to display.
85+
/// </param>
86+
/// <param name="message">
87+
/// The message to display.
88+
/// </param>
89+
/// <param name="cancelAction">
90+
/// The action to perform when the dialog has been cancelled/dismissed.
91+
/// </param>
92+
/// <param name="buttons">
93+
/// The button definitions for performing actions.
94+
/// </param>
95+
void Show(string title, string message, Action cancelAction, params DialogButton[] buttons);
96+
97+
/// <summary>
98+
/// Shows an application system alert dialog with the specified message.
99+
/// </summary>
100+
/// <param name="message">
101+
/// The message to display.
102+
/// </param>
103+
/// <returns>
104+
/// An asynchronous operation.
105+
/// </returns>
106+
Task ShowAsync(string message);
107+
108+
/// <summary>
109+
/// Shows an application system alert dialog with the specified message and dialog buttons.
110+
/// </summary>
111+
/// <param name="message">
112+
/// The message to display.
113+
/// </param>
114+
/// <param name="buttons">
115+
/// The button definitions for performing actions.
116+
/// </param>
117+
/// <returns>
118+
/// An asynchronous operation.
119+
/// </returns>
120+
Task ShowAsync(string message, params DialogButton[] buttons);
121+
122+
/// <summary>
123+
/// Shows an application system alert dialog with the specified message, cancellation action and dialog buttons.
124+
/// </summary>
125+
/// <param name="message">
126+
/// The message to display.
127+
/// </param>
128+
/// <param name="cancelAction">
129+
/// The action to perform when the dialog has been cancelled/dismissed.
130+
/// </param>
131+
/// <param name="buttons">
132+
/// The button definitions for performing actions.
133+
/// </param>
134+
/// <returns>
135+
/// An asynchronous operation.
136+
/// </returns>
137+
Task ShowAsync(string message, Action cancelAction, params DialogButton[] buttons);
138+
139+
/// <summary>
140+
/// Shows an application system alert dialog with the specified title and message.
141+
/// </summary>
142+
/// <param name="title">
143+
/// The title to display.
144+
/// </param>
145+
/// <param name="message">
146+
/// The message to display.
147+
/// </param>
148+
/// <returns>
149+
/// An asynchronous operation.
150+
/// </returns>
151+
Task ShowAsync(string title, string message);
152+
153+
/// <summary>
154+
/// Shows an application system alert dialog with the specified title, message and dialog buttons.
155+
/// </summary>
156+
/// <param name="title">
157+
/// The title to display.
158+
/// </param>
159+
/// <param name="message">
160+
/// The message to display.
161+
/// </param>
162+
/// <param name="buttons">
163+
/// The button definitions for performing actions.
164+
/// </param>
165+
/// <returns>
166+
/// An asynchronous operation.
167+
/// </returns>
168+
Task ShowAsync(string title, string message, params DialogButton[] buttons);
169+
170+
/// <summary>
171+
/// Shows an application system alert dialog with the specified title, message, cancellation action and dialog buttons.
172+
/// </summary>
173+
/// <param name="title">
174+
/// The title to display.
175+
/// </param>
176+
/// <param name="message">
177+
/// The message to display.
178+
/// </param>
179+
/// <param name="cancelAction">
180+
/// The action to perform when the dialog has been cancelled/dismissed.
181+
/// </param>
182+
/// <param name="buttons">
183+
/// The button definitions for performing actions.
184+
/// </param>
185+
/// <returns>
186+
/// An asynchronous operation.
187+
/// </returns>
188+
Task ShowAsync(string title, string message, Action cancelAction, params DialogButton[] buttons);
189+
}
190+
}

0 commit comments

Comments
 (0)