Skip to content

Commit eee5498

Browse files
committed
Add Some Docs for Methods with Copilot AI
1 parent 054f9d7 commit eee5498

38 files changed

Lines changed: 1288 additions & 41 deletions

dev/DevWinUI/Attach/PanelAttach.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,21 @@ public enum PanelTransitionCollection
1717
}
1818
public partial class PanelAttach
1919
{
20+
/// <summary>
21+
/// Retrieves the collection of transitions associated with a specified panel.
22+
/// </summary>
23+
/// <param name="obj">The dependency object from which to retrieve the transitions.</param>
24+
/// <returns>A collection of transitions related to the specified dependency object.</returns>
2025
public static PanelTransitionCollection GetChildrenTransitions(DependencyObject obj)
2126
{
2227
return (PanelTransitionCollection)obj.GetValue(ChildrenTransitionsProperty);
2328
}
2429

30+
/// <summary>
31+
/// Sets the collection of transitions for the children of a specified panel.
32+
/// </summary>
33+
/// <param name="obj">The target dependency object whose children will have transitions applied.</param>
34+
/// <param name="value">The collection of transitions to be set for the children of the specified dependency object.</param>
2535
public static void SetChildrenTransitions(DependencyObject obj, PanelTransitionCollection value)
2636
{
2737
obj.SetValue(ChildrenTransitionsProperty, value);

dev/DevWinUI/Attach/ThemeServiceAttach.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
namespace DevWinUI;
22
public static partial class ThemeServiceAttach
33
{
4+
/// <summary>
5+
/// Retrieves the theme service associated with a specified ComboBox.
6+
/// </summary>
7+
/// <param name="obj">The dependency object from which the theme service is being retrieved.</param>
8+
/// <returns>Returns the theme service linked to the provided dependency object.</returns>
49
public static IThemeService GetThemeService(DependencyObject obj)
510
{
611
return (IThemeService)obj.GetValue(ThemeServiceProperty);
712
}
813

14+
/// <summary>
15+
/// Sets a theme service for a specified ComboBox.
16+
/// </summary>
17+
/// <param name="obj">The dependency object that will receive the theme service.</param>
18+
/// <param name="value">The theme service instance to be associated with the dependency object.</param>
919
public static void SetThemeService(DependencyObject obj, IThemeService value)
1020
{
1121
obj.SetValue(ThemeServiceProperty, value);
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
namespace DevWinUI;
22

3-
// This is an attribute that triggers the source generator in the Nucs.JsonSettings.AutosaveGenerator package
4-
3+
/// <summary>
4+
/// Triggers the source generator in the Nucs.JsonSettings.AutosaveGenerator package. It is applied to classes and is
5+
/// not inherited.
6+
/// </summary>
57
[AttributeUsage(AttributeTargets.Class, Inherited = false)]
68
public class GenerateAutoSaveOnChangeAttribute : Attribute
79
{
8-
}
10+
}

dev/DevWinUI/Common/MessageBox/MessageBox.cs

Lines changed: 147 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,27 @@
1-
using WinRT.Interop;
2-
3-
namespace DevWinUI;
1+
namespace DevWinUI;
42
public static class MessageBox
53
{
4+
/// <summary>
5+
/// Displays a message box with specified options and returns the user's response.
6+
/// </summary>
7+
/// <param name="window">Specifies the owner window of the message box.</param>
8+
/// <param name="message">Text that will be shown in the message box.</param>
9+
/// <param name="title">Sets the title of the message box window.</param>
10+
/// <param name="messageBoxStyle">Determines the style and buttons that will be available in the message box.</param>
11+
/// <returns>Returns the result of the user's interaction with the message box.</returns>
612
public static MessageBoxResult Show(Microsoft.UI.Xaml.Window window, string message, string title, MessageBoxStyle messageBoxStyle)
713
{
814
return Show(WindowNative.GetWindowHandle(window), message, title, messageBoxStyle);
915
}
16+
17+
/// <summary>
18+
/// Displays a message box with specified options and returns the user's response.
19+
/// </summary>
20+
/// <param name="hwnd">Specifies the owner window of the message box.</param>
21+
/// <param name="message">Text that will be shown in the message box.</param>
22+
/// <param name="title">Sets the title of the message box window.</param>
23+
/// <param name="messageBoxStyle">Determines the style and buttons that will be available in the message box.</param>
24+
/// <returns>Returns the result of the user's interaction with the message box.</returns>
1025
public static MessageBoxResult Show(IntPtr hwnd, string message, string title, MessageBoxStyle messageBoxStyle)
1126
{
1227
Windows.Win32.UI.WindowsAndMessaging.MESSAGEBOX_STYLE mbStyle = 0;
@@ -120,81 +135,210 @@ public static MessageBoxResult Show(IntPtr hwnd, string message, string title, M
120135
}
121136
}
122137

138+
/// <summary>
139+
/// Displays a message box with a specified message and title in the context of a given window.
140+
/// </summary>
141+
/// <param name="window">Specifies the owner window of the message box.</param>
142+
/// <param name="message">Text that will be shown in the message box.</param>
143+
/// <param name="title">Sets the title of the message box window.</param>
144+
/// <returns>Returns the result of the user's interaction with the message box.</returns>
123145
public static MessageBoxResult Show(Microsoft.UI.Xaml.Window window, string message, string title)
124146
{
125147
return Show(WindowNative.GetWindowHandle(window), message, title);
126148
}
149+
150+
/// <summary>
151+
/// Displays a message box with an OK button to the user.
152+
/// </summary>
153+
/// <param name="hwnd">Specifies the owner window of the message box.</param>
154+
/// <param name="message">Text that will be shown in the message box.</param>
155+
/// <param name="title">Sets the title of the message box window.</param>
156+
/// <returns>Returns the result of the user's interaction with the message box.</returns>
127157
public static MessageBoxResult Show(IntPtr hwnd, string message, string title)
128158
{
129159
return Show(hwnd, message, title, MessageBoxStyle.Ok);
130160
}
131161

162+
/// <summary>
163+
/// Displays a message box in the specified window with a given message and style.
164+
/// </summary>
165+
/// <param name="window">Specifies the owner window of the message box.</param>
166+
/// <param name="message">Text that will be shown in the message box.</param>
167+
/// <param name="messageBoxStyle">Determines the style and buttons that will be available in the message box.</param>
168+
/// <returns>Returns the result of the user's interaction with the message box.</returns>
132169
public static MessageBoxResult Show(Microsoft.UI.Xaml.Window window, string message, MessageBoxStyle messageBoxStyle)
133170
{
134171
return Show(WindowNative.GetWindowHandle(window), message, messageBoxStyle);
135172
}
173+
174+
/// <summary>
175+
/// Displays a message box with specified text and style. It also includes the product name in the message box.
176+
/// </summary>
177+
/// <param name="hwnd">Specifies the owner window of the message box.</param>
178+
/// <param name="message">Text that will be shown in the message box.</param>
179+
/// <param name="messageBoxStyle">Determines the style and buttons that will be available in the message box.</param>
180+
/// <returns>Returns the result of the user's interaction with the message box.</returns>
136181
public static MessageBoxResult Show(IntPtr hwnd, string message, MessageBoxStyle messageBoxStyle)
137182
{
138183
return Show(hwnd, message, ProcessInfoHelper.ProductName, messageBoxStyle);
139184
}
140185

186+
/// <summary>
187+
/// Displays a message box in the specified window with a given message.
188+
/// </summary>
189+
/// <param name="window">Specifies the owner window of the message box.</param>
190+
/// <param name="message">Text that will be shown in the message box.</param>
191+
/// <returns>Returns the result of the user's interaction with the message box.</returns>
141192
public static MessageBoxResult Show(Microsoft.UI.Xaml.Window window, string message)
142193
{
143194
return Show(WindowNative.GetWindowHandle(window), message);
144195
}
196+
197+
/// <summary>
198+
/// Displays a message box with a specified message and an OK button.
199+
/// </summary>
200+
/// <param name="hwnd">Specifies the owner window of the message box.</param>
201+
/// <param name="message">Text that will be shown in the message box.</param>
202+
/// <returns>Returns the result of the message box interaction.</returns>
145203
public static MessageBoxResult Show(IntPtr hwnd, string message)
146204
{
147205
return Show(hwnd, message, ProcessInfoHelper.ProductName, MessageBoxStyle.Ok);
148206
}
149207

208+
/// <summary>
209+
/// Displays an information message box in the specified window.
210+
/// </summary>
211+
/// <param name="window">Specifies the owner window of the message box.</param>
212+
/// <param name="message">Text that will be shown in the message box.</param>
213+
/// <param name="title">Sets the title of the message box window.</param>
214+
/// <returns>Returns the result of the message box interaction.</returns>
150215
public static MessageBoxResult ShowInformation(Microsoft.UI.Xaml.Window window, string message, string title)
151216
{
152217
return ShowInformation(WindowNative.GetWindowHandle(window), message, title);
153218
}
219+
220+
/// <summary>
221+
/// Displays an information message box with an OK button and an information icon.
222+
/// </summary>
223+
/// <param name="hwnd">Specifies the owner window of the message box.</param>
224+
/// <param name="message">Text that will be shown in the message box.</param>
225+
/// <param name="title">Sets the title of the message box window.</param>
226+
/// <returns>Returns the result of the user's interaction with the message box.</returns>
154227
public static MessageBoxResult ShowInformation(IntPtr hwnd, string message, string title)
155228
{
156229
return Show(hwnd, message, title, MessageBoxStyle.Ok | MessageBoxStyle.IconInformation);
157230
}
158231

232+
/// <summary>
233+
/// Displays an information message box in the specified window.
234+
/// </summary>
235+
/// <param name="window">Specifies the owner window of the message box.</param>
236+
/// <param name="message">Text that will be shown in the message box.</param>
237+
/// <returns>Returns the result of the user's interaction with the message box.</returns>
159238
public static MessageBoxResult ShowInformation(Microsoft.UI.Xaml.Window window, string message)
160239
{
161240
return ShowInformation(WindowNative.GetWindowHandle(window), message);
162241
}
242+
243+
/// <summary>
244+
/// Displays an information message box to the user with an OK button and an information icon.
245+
/// </summary>
246+
/// <param name="hwnd">Specifies the owner window of the message box.</param>
247+
/// <param name="message">Text that will be shown in the message box.</param>
248+
/// <returns>Returns the result of the user's interaction with the message box.</returns>
163249
public static MessageBoxResult ShowInformation(IntPtr hwnd, string message)
164250
{
165251
return Show(hwnd, message, ProcessInfoHelper.ProductName, MessageBoxStyle.Ok | MessageBoxStyle.IconInformation);
166252
}
167253

254+
/// <summary>
255+
/// Displays an error message in a message box associated with a specified window.
256+
/// </summary>
257+
/// <param name="window">Specifies the owner window of the message box.</param>
258+
/// <param name="message">Text that will be shown in the message box.</param>
259+
/// <param name="title">Sets the title of the message box window.</param>
260+
/// <returns>Returns the result of the user's interaction with the message box.</returns>
168261
public static MessageBoxResult ShowError(Microsoft.UI.Xaml.Window window, string message, string title)
169262
{
170263
return ShowError(WindowNative.GetWindowHandle(window), message, title);
171264
}
265+
266+
/// <summary>
267+
/// Displays an error message box with a specified message and title.
268+
/// </summary>
269+
/// <param name="hwnd">Specifies the owner window of the message box.</param>
270+
/// <param name="message">Text that will be shown in the message box.</param>
271+
/// <param name="title">Sets the title of the message box window.</param>
272+
/// <returns>Returns the result of the user's interaction with the message box.</returns>
172273
public static MessageBoxResult ShowError(IntPtr hwnd, string message, string title)
173274
{
174275
return Show(hwnd, message, title, MessageBoxStyle.Ok | MessageBoxStyle.IconError);
175276
}
277+
278+
/// <summary>
279+
/// Displays an error message in a message box associated with a specified window.
280+
/// </summary>
281+
/// <param name="window">Specifies the owner window of the message box.</param>
282+
/// <param name="message">Text that will be shown in the message box.</param>
283+
/// <returns>Returns the result of the message box interaction.</returns>
176284
public static MessageBoxResult ShowError(Microsoft.UI.Xaml.Window window, string message)
177285
{
178286
return ShowError(WindowNative.GetWindowHandle(window), message);
179287
}
288+
289+
/// <summary>
290+
/// Displays an error message box to the user with an OK button and an error icon.
291+
/// </summary>
292+
/// <param name="hwnd">Specifies the owner window of the message box.</param>
293+
/// <param name="message">Text that will be shown in the message box.</param>
294+
/// <returns>Returns the result of the user's interaction with the message box.</returns>
180295
public static MessageBoxResult ShowError(IntPtr hwnd, string message)
181296
{
182297
return Show(hwnd, message, ProcessInfoHelper.ProductName, MessageBoxStyle.Ok | MessageBoxStyle.IconError);
183298
}
184299

300+
/// <summary>
301+
/// Displays a warning message box in the specified window. It provides a way to show a message with a title to the
302+
/// user.
303+
/// </summary>
304+
/// <param name="window">Specifies the owner window of the message box.</param>
305+
/// <param name="message">Text that will be shown in the message box.</param>
306+
/// <param name="title">Sets the title of the message box window.</param>
307+
/// <returns>Returns the result of the user's interaction with the message box.</returns>
185308
public static MessageBoxResult ShowWarning(Microsoft.UI.Xaml.Window window, string message, string title)
186309
{
187310
return ShowWarning(WindowNative.GetWindowHandle(window), message, title);
188311
}
312+
313+
/// <summary>
314+
/// Displays a warning message box with an OK button and a warning icon.
315+
/// </summary>
316+
/// <param name="hwnd">Specifies the owner window of the message box.</param>
317+
/// <param name="message">Text that will be shown in the message box.</param>
318+
/// <param name="title">Sets the title of the message box window.</param>
319+
/// <returns>Returns the result of the user's interaction with the message box.</returns>
189320
public static MessageBoxResult ShowWarning(IntPtr hwnd, string message, string title)
190321
{
191322
return Show(hwnd, message, title, MessageBoxStyle.Ok | MessageBoxStyle.IconWarning);
192323
}
193324

325+
/// <summary>
326+
/// Displays a warning message box in the specified window. It utilizes the window handle to present the message.
327+
/// </summary>
328+
/// <param name="window">Specifies the owner window of the message box.</param>
329+
/// <param name="message">Text that will be shown in the message box.</param>
330+
/// <returns>Returns the result of the user's interaction with the message box.</returns>
194331
public static MessageBoxResult ShowWarning(Microsoft.UI.Xaml.Window window, string message)
195332
{
196333
return ShowWarning(WindowNative.GetWindowHandle(window), message);
197334
}
335+
336+
/// <summary>
337+
/// Displays a warning message box to the user with an OK button and a warning icon.
338+
/// </summary>
339+
/// <param name="hwnd">Specifies the owner window of the message box.</param>
340+
/// <param name="message">Text that will be shown in the message box.</param>
341+
/// <returns>Returns the result of the user's interaction with the message box.</returns>
198342
public static MessageBoxResult ShowWarning(IntPtr hwnd, string message)
199343
{
200344
return Show(hwnd, message, ProcessInfoHelper.ProductName, MessageBoxStyle.Ok | MessageBoxStyle.IconWarning);

dev/DevWinUI/Common/ModernSystemMenu/ModernSystemMenu.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,20 @@ public bool IsWindowMaximized
3535
}
3636
}
3737

38+
/// <summary>
39+
/// Initializes a new instance of the ModernSystemMenu with a specified MenuFlyout.
40+
/// </summary>
41+
/// <param name="window">The window where the modern system menu will be displayed.</param>
42+
/// <param name="menuFlyout">The menu that will be shown as a flyout in the title bar.</param>
3843
public ModernSystemMenu(Microsoft.UI.Xaml.Window window, MenuFlyout menuFlyout) : this(window)
3944
{
4045
titleBarMenuFlyout = menuFlyout;
4146
}
4247

48+
/// <summary>
49+
/// Initializes a new instance of the ModernSystemMenu.
50+
/// </summary>
51+
/// <param name="window">The window instance for which the modern system menu is being created.</param>
4352
public ModernSystemMenu(Microsoft.UI.Xaml.Window window)
4453
{
4554
this.window = window;
@@ -122,7 +131,7 @@ private void CreateMenuFlyout()
122131
Icon = new FontIcon { Glyph = GeneralHelper.GetGlyph("E922") },
123132
Command = MaximizeCommand
124133
};
125-
//
134+
126135
var closeItem = new MenuFlyoutItem
127136
{
128137
Style = menuFlyoutItemStyle,

0 commit comments

Comments
 (0)