Skip to content

Commit 5b68fad

Browse files
committed
Merge remote-tracking branch 'origin/main' into dev/rolf/msbuild-sdkdevpath
2 parents caf7e6b + c098811 commit 5b68fad

File tree

13 files changed

+106
-219
lines changed

13 files changed

+106
-219
lines changed

.github/agents/xml-doc-writer.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
name: xml-doc-writer
3+
description: Specialized agent for working with XML docs in C# source code.
4+
---
5+
6+
## Role
7+
8+
You are a specialized agent for writing XML docs in C# source code. Your job is to validate and improve existing XML docs, and also write XML docs.
9+
10+
## When to Invoke
11+
12+
- When asked to from the Copilot CLI.
13+
14+
## Workflow
15+
16+
Step 1: Gather required information
17+
18+
Before invoking this skill, make sure to know exactly which C# API whose XML docs to work on.
19+
20+
Step 2: Write XML docs
21+
22+
* Add XML docs for public or protected members and types that don't have any docs.
23+
* Remove any XML docs that are exactly "To be added."
24+
* If there's an XML doc that is added with an include attribute, replace the include attribute with the contents from the included file instead. Also remove the inlined content from the included file, and if there's nothing left in the included file, remove that file completely.
25+
* Verify existing XML comments for language, grammar, consistency and correctness.
26+
* Create 'see cref' attributes whenever suitable.
27+
* Remove unnecessary whitespace between the triple-slash and the xml comment; but keep/fix correct indentation.
28+
* Correct indentation: each nesting level adds exactly 2 spaces of indentation.
29+
* Reorder any top-level XML elements to have the following order: summary, value, param, return, exception, remarks.

builds/Versions-MacCatalyst.plist.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,6 @@
149149
<key>Optimizations</key>
150150
<dict>
151151
<!-- The key is the value to be passed to mtouch. The string is a very short description. Any IDE UI should also point to the documentation for the optimizations. -->
152-
<key>inline-intptr-size</key>
153-
<string>Inline IntPtr.Size</string>
154152
<key>inline-runtime-arch</key>
155153
<string>Inline NSObject.IsDirectBinding</string>
156154
<key>dead-code-elimination</key>

builds/Versions-iOS.plist.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,6 @@
173173
<key>Optimizations</key>
174174
<dict>
175175
<!-- The key is the value to be passed to mtouch. The string is a very short description. Any IDE UI should also point to the documentation for the optimizations. -->
176-
<key>inline-intptr-size</key>
177-
<string>Inline IntPtr.Size</string>
178176
<key>inline-runtime-arch</key>
179177
<string>Inline NSObject.IsDirectBinding</string>
180178
<key>dead-code-elimination</key>

builds/Versions-macOS.plist.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,6 @@
9494
<key>Optimizations</key>
9595
<dict>
9696
<!-- The key is the value to be passed to mmp. The string is a very short description. Any IDE UI should also point to the documentation for the optimizations. -->
97-
<key>inline-intptr-size</key>
98-
<string>Inline IntPtr.Size</string>
9997
<key>inline-runtime-arch</key>
10098
<string>Inline Runtime.Arch</string>
10199
<key>inline-isdirectbinding</key>

builds/Versions-tvOS.plist.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,6 @@
123123
<key>Optimizations</key>
124124
<dict>
125125
<!-- The key is the value to be passed to mtouch. The string is a very short description. Any IDE UI should also point to the documentation for the optimizations. -->
126-
<key>inline-intptr-size</key>
127-
<string>Inline IntPtr.Size</string>
128126
<key>inline-runtime-arch</key>
129127
<string>Inline NSObject.IsDirectBinding</string>
130128
<key>dead-code-elimination</key>

docs/api/UIKit/UIActionSheet.xml

Lines changed: 0 additions & 47 deletions
This file was deleted.

docs/website/optimizations.md

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -47,44 +47,6 @@ The default behavior can be overridden by passing `--optimize=[+|-]remove-uithre
4747

4848
[1]: /dotnet/api/UIKit.UIApplication.EnsureUIThread
4949

50-
## Inline IntPtr.Size
51-
52-
Inlines the constant value of `IntPtr.Size` according to the target platform.
53-
54-
This optimization will change the following type of code:
55-
56-
```csharp
57-
if (IntPtr.Size == 8) {
58-
Console.WriteLine ("64-bit platform");
59-
} else {
60-
Console.WriteLine ("32-bit platform");
61-
}
62-
```
63-
64-
into the following (when building for a 64-bit platform):
65-
66-
```csharp
67-
if (8 == 8) {
68-
Console.WriteLine ("64-bit platform");
69-
} else {
70-
Console.WriteLine ("32-bit platform");
71-
}
72-
```
73-
74-
This optimization requires the linker to be enabled, and is only applied to
75-
methods with the `[BindingImpl (BindingImplOptions.Optimizable)]` attribute.
76-
77-
By default it's enabled if targeting a single architecture, or for the
78-
platform assembly (**Xamarin.iOS.dll**, **Xamarin.TVOS.dll**,
79-
**Xamarin.WatchOS.dll** or **Xamarin.Mac.dll**).
80-
81-
If targeting multiple architectures, this optimization will create different
82-
assemblies for the 32-bit version and the 64-bit version of the app, and both
83-
versions will have to be included in the app, effectively increasing the final
84-
app size instead of decreasing it.
85-
86-
The default behavior can be overridden by passing `--optimize=[+|-]inline-intptr-size` to mtouch/mmp.
87-
8850
## Inline NSObject.IsDirectBinding
8951

9052
`NSObject.IsDirectBinding` is an instance property that determines whether a
@@ -254,24 +216,12 @@ the binding code for `NFCIso15693ReadMultipleBlocksConfiguration.Range`):
254216
NSRange ret;
255217
if (IsDirectBinding) {
256218
if (Runtime.Arch == Arch.DEVICE) {
257-
if (IntPtr.Size == 8) {
258-
ret = global::ObjCRuntime.Messaging.NSRange_objc_msgSend (this.Handle, Selector.GetHandle ("range"));
259-
} else {
260-
global::ObjCRuntime.Messaging.NSRange_objc_msgSend_stret (out ret, this.Handle, Selector.GetHandle ("range"));
261-
}
262-
} else if (IntPtr.Size == 8) {
263219
ret = global::ObjCRuntime.Messaging.NSRange_objc_msgSend (this.Handle, Selector.GetHandle ("range"));
264220
} else {
265221
ret = global::ObjCRuntime.Messaging.NSRange_objc_msgSend (this.Handle, Selector.GetHandle ("range"));
266222
}
267223
} else {
268224
if (Runtime.Arch == Arch.DEVICE) {
269-
if (IntPtr.Size == 8) {
270-
ret = global::ObjCRuntime.Messaging.NSRange_objc_msgSendSuper (this.SuperHandle, Selector.GetHandle ("range"));
271-
} else {
272-
global::ObjCRuntime.Messaging.NSRange_objc_msgSendSuper_stret (out ret, this.SuperHandle, Selector.GetHandle ("range"));
273-
}
274-
} else if (IntPtr.Size == 8) {
275225
ret = global::ObjCRuntime.Messaging.NSRange_objc_msgSendSuper (this.SuperHandle, Selector.GetHandle ("range"));
276226
} else {
277227
ret = global::ObjCRuntime.Messaging.NSRange_objc_msgSendSuper (this.SuperHandle, Selector.GetHandle ("range"));

src/CoreVideo/CVPixelBufferAttributes.cs

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -259,12 +259,7 @@ public int? PlaneAlignment {
259259
}
260260
}
261261

262-
// TODO: kCVPixelBufferIOSurfacePropertiesKey
263-
#if !MONOMAC
264-
// The presence of the IOSurfacePropertiesKey mandates the allocation via IOSurfaceProperty
265-
/// <summary>If this key is set, this instructs CoreVideo to allocate the video buffers using the IOSurface.    This is required for some uses of pixel buffers.</summary>
266-
/// <value>To be added.</value>
267-
/// <remarks>To be added.</remarks>
262+
/// <summary>If this key is set, this instructs CoreVideo to allocate the video buffers using the <see cref="IOSurface.IOSurface" />. This is required for some uses of pixel buffers.</summary>
268263
public bool? AllocateWithIOSurface {
269264
set {
270265
if (value.HasValue && value.Value)
@@ -277,11 +272,9 @@ public bool? AllocateWithIOSurface {
277272
}
278273
}
279274

280-
#if !__MACCATALYST__
275+
#if !__MACCATALYST__ && !__MACOS__
281276
/// <summary>Indicates whether the pixel buffer is compatible with OpenGL for Embedded Systems contexts.</summary>
282-
/// <value>
283-
/// </value>
284-
/// <remarks>The property uses constant kCVPixelBufferOpenGLESCompatibilityKey value to access the underlying dictionary.</remarks>
277+
/// <remarks>The property uses the <c>kCVPixelBufferOpenGLESCompatibilityKey</c> constant to access the underlying dictionary.</remarks>
285278
[SupportedOSPlatform ("ios")]
286279
[UnsupportedOSPlatform ("maccatalyst")]
287280
[UnsupportedOSPlatform ("macos")]
@@ -297,12 +290,6 @@ public bool? OpenGLESCompatibility {
297290
#endif
298291

299292
/// <summary>Indicates whether the pixel buffer is compatible with Metal.</summary>
300-
/// <value>To be added.</value>
301-
/// <remarks>To be added.</remarks>
302-
[SupportedOSPlatform ("ios")]
303-
[SupportedOSPlatform ("maccatalyst")]
304-
[SupportedOSPlatform ("tvos")]
305-
[UnsupportedOSPlatform ("macos")]
306293
public bool? MetalCompatibility {
307294
set {
308295
SetBooleanValue (CVPixelBuffer.MetalCompatibilityKey, value);
@@ -311,7 +298,6 @@ public bool? MetalCompatibility {
311298
return GetBoolValue (CVPixelBuffer.MetalCompatibilityKey);
312299
}
313300
}
314-
#endif
315-
#endif
301+
#endif // !COREBUILD
316302
}
317303
}

src/UIKit/UIActionSheet.cs

Lines changed: 53 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,53 @@
1212

1313
using System.Collections;
1414

15-
// Disable until we get around to enable + fix any issues.
16-
#nullable disable
15+
#nullable enable
1716

1817
namespace UIKit {
18+
/// <summary>A <see cref="UIView" /> that displays an action sheet with one or more buttons.</summary>
19+
/// <remarks>
20+
/// <para>Use <see cref="UIAlertController" /> rather than this class. Extensions may not use this class at all.</para>
21+
/// <para>
22+
/// The <see cref="UIActionSheet" /> control is a convenient way to allow the application user to choose among alternative actions.
23+
/// The following code and diagram are taken from the "Action Sheets" section of the "iOS Standard Controls" sample.
24+
/// </para>
25+
/// <example>
26+
/// <code lang="csharp lang-csharp"><![CDATA[
27+
/// protected void HandleBtnActionSheetWithOtherButtonsTouchUpInside (object sender, EventArgs e)
28+
/// {
29+
/// actionSheet = new UIActionSheet ("action sheet with other buttons");
30+
/// actionSheet.AddButton ("delete");
31+
/// actionSheet.AddButton ("cancel");
32+
/// actionSheet.AddButton ("a different option!");
33+
/// actionSheet.AddButton ("another option");
34+
/// actionSheet.DestructiveButtonIndex = 0;
35+
/// actionSheet.CancelButtonIndex = 1;
36+
/// //actionSheet.FirstOtherButtonIndex = 2;
37+
/// actionSheet.Clicked += delegate(object a, UIButtonEventArgs b) {
38+
/// Console.WriteLine ("Button " + b.ButtonIndex.ToString () + " clicked");
39+
/// };
40+
/// actionSheet.ShowInView (View);
41+
/// }
42+
/// ]]></code>
43+
/// </example>
44+
/// <para>
45+
/// <img href="~/xml/UIKit/_images/UIKit.UIActionSheet.png" alt="Screenshot showing the UIActionSheet" />
46+
/// </para>
47+
/// </remarks>
1948
public partial class UIActionSheet : IEnumerable {
2049

21-
/// <include file="../../docs/api/UIKit/UIActionSheet.xml" path="/Documentation/Docs[@DocId='M:UIKit.UIActionSheet.#ctor(System.String,UIKit.IUIActionSheetDelegate,System.String,System.String,System.String[])']/*" />
22-
public UIActionSheet (string title, IUIActionSheetDelegate del, string cancelTitle, string destroy, params string [] other)
23-
: this (title, del, null, null, (string) null)
50+
/// <summary>Initializes a <see cref="UIActionSheet" /> instance.</summary>
51+
/// <param name="title">A title to be displayed in the title area of the action sheet.</param>
52+
/// <param name="del">A delegate that will respond to taps in the action sheet.</param>
53+
/// <param name="cancelTitle">The title of the Cancel button. This will be displayed in a black button.</param>
54+
/// <param name="destroy">The title of the destructive button. This will be displayed in a red button.</param>
55+
/// <param name="other">An array of <see cref="string" /> to use for other buttons in the <see cref="UIActionSheet" />.</param>
56+
/// <remarks>
57+
/// <para>Pass <see langword="null" /> to <paramref name="title" /> if there is no text to display in the title area.</para>
58+
/// <para>If the action sheet is being presented on an iPad, then the <paramref name="cancelTitle" /> should be set to <see langword="null" />.</para>
59+
/// </remarks>
60+
public UIActionSheet (string? title, IUIActionSheetDelegate? del, string? cancelTitle, string? destroy, params string? []? other)
61+
: this (title, del, null, null, (string?) null)
2462
{
2563
if (destroy is not null)
2664
DestructiveButtonIndex = AddButton (destroy);
@@ -31,7 +69,7 @@ public UIActionSheet (string title, IUIActionSheetDelegate del, string cancelTit
3169
return;
3270
}
3371

34-
foreach (string b in other) {
72+
foreach (string? b in other) {
3573
if (b is not null)
3674
AddButton (b);
3775
}
@@ -44,26 +82,25 @@ public UIActionSheet (string title, IUIActionSheetDelegate del, string cancelTit
4482
/// <param name="title">A title to be displayed in the title area of the action sheet.</param>
4583
/// <param name="del">A delegate that will respond to taps in the action sheet.</param>
4684
/// <remarks>Pass <see langword="null" /> to <paramref name="title" /> if there is no text to display in the title area.</remarks>
47-
public UIActionSheet (string title, IUIActionSheetDelegate del)
48-
: this (title, del, null, null, (string) null) { }
85+
public UIActionSheet (string? title, IUIActionSheetDelegate? del)
86+
: this (title, del, null, null, (string?) null) { }
4987

88+
/// <summary>Initialize a <see cref="UIActionSheet" /> with a title.</summary>
5089
/// <param name="title">A title to be displayed in the title area of the action sheet.</param>
51-
/// <summary>Initialize an <see cref="UIKit.UIActionSheet" /> with a title.</summary>
52-
/// <remarks>Pass <see langword="null" /> to <paramref name="title" /> if there is no text to display in the title area.</remarks>
53-
public UIActionSheet (string title)
54-
: this (title, null, null, null, (string) null) { }
90+
/// <remarks>Pass <see langword="null" /> to <paramref name="title" /> if there is no text to display in the title area.</remarks>
91+
public UIActionSheet (string? title)
92+
: this (title, null, null, null, (string?) null) { }
5593

94+
/// <summary>Adds a button with the specified text.</summary>
5695
/// <param name="name">Text for the button.</param>
57-
/// <summary>Adds a button with the specified text.</summary>
58-
/// <remarks>This method exists to allow the class to be initialized with C# 3.0 object initializers. This is equivalent to calling AddButton (name).</remarks>
96+
/// <remarks>This method exists to allow the class to be initialized with C# 3.0 object initializers. This is equivalent to calling <see cref="AddButton" />.</remarks>
5997
public void Add (string name)
6098
{
6199
AddButton (name);
62100
}
63101

64102
/// <summary>Obtains an enumerator that returns the button titles.</summary>
65-
/// <returns>An IEnumerator.</returns>
66-
/// <remarks>To be added.</remarks>
103+
/// <returns>An <see cref="IEnumerator" />.</returns>
67104
public IEnumerator GetEnumerator ()
68105
{
69106
for (int i = 0; i < ButtonCount; i++)

src/uikit.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1726,7 +1726,6 @@ interface UIAccessibilityContentSizeCategoryImageAdjusting {
17261726
bool AdjustsImageSizeForAccessibilityContentSizeCategory { get; set; }
17271727
}
17281728

1729-
/// <include file="../docs/api/UIKit/UIActionSheet.xml" path="/Documentation/Docs[@DocId='T:UIKit.UIActionSheet']/*" />
17301729
[NoTV]
17311730
[BaseType (typeof (UIView), KeepRefUntil = "Dismissed", Delegates = new string [] { "WeakDelegate" }, Events = new Type [] { typeof (UIActionSheetDelegate) })]
17321731
[Deprecated (PlatformName.iOS, 8, 3, message: "Use 'UIAlertController' with 'UIAlertControllerStyle.ActionSheet' instead.")]

0 commit comments

Comments
 (0)