-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3506106
commit aec93bf
Showing
12 changed files
with
359 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/UiPath.CoreIpc/Polyfills/CallerArgumentExpressionAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#pragma warning disable | ||
|
||
#if !NET5_0_OR_GREATER | ||
|
||
namespace System.Runtime.CompilerServices; | ||
|
||
using System.Diagnostics; | ||
using System.Diagnostics.CodeAnalysis; | ||
|
||
// | ||
// Summary: | ||
// Allows capturing of the expressions passed to a method. | ||
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] | ||
internal sealed class CallerArgumentExpressionAttribute : Attribute | ||
{ | ||
// | ||
// Summary: | ||
// Initializes a new instance of the System.Runtime.CompilerServices.CallerArgumentExpressionAttribute | ||
// class. | ||
// | ||
// Parameters: | ||
// parameterName: | ||
// The name of the targeted parameter. | ||
public CallerArgumentExpressionAttribute(string parameterName) => ParameterName = parameterName; | ||
|
||
// | ||
// Summary: | ||
// Gets the target parameter name of the CallerArgumentExpression. | ||
// | ||
// Returns: | ||
// The name of the targeted parameter of the CallerArgumentExpression. | ||
public string ParameterName { get; } | ||
} | ||
|
||
|
||
#endif |
56 changes: 56 additions & 0 deletions
56
src/UiPath.CoreIpc/Polyfills/CompilerFeatureRequiredAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// <auto-generated /> | ||
#pragma warning disable | ||
|
||
#if !NET7_0_OR_GREATER | ||
|
||
namespace System.Runtime.CompilerServices; | ||
|
||
using System.Diagnostics; | ||
using System.Diagnostics.CodeAnalysis; | ||
using Link = System.ComponentModel.DescriptionAttribute; | ||
|
||
/// <summary> | ||
/// Indicates that compiler support for a particular feature is required for the location where this attribute is applied. | ||
/// </summary> | ||
[ExcludeFromCodeCoverage] | ||
[DebuggerNonUserCode] | ||
[AttributeUsage( | ||
validOn: AttributeTargets.All, | ||
AllowMultiple = true, | ||
Inherited = false)] | ||
[Link("https://learn.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.compilerfeaturerequiredattribute")] | ||
#if PolyPublic | ||
public | ||
#endif | ||
sealed class CompilerFeatureRequiredAttribute : | ||
Attribute | ||
{ | ||
/// <summary> | ||
/// Initialize a new instance of <see cref="CompilerFeatureRequiredAttribute"/> | ||
/// </summary> | ||
/// <param name="featureName">The name of the required compiler feature.</param> | ||
public CompilerFeatureRequiredAttribute(string featureName) => | ||
FeatureName = featureName; | ||
|
||
/// <summary> | ||
/// The name of the compiler feature. | ||
/// </summary> | ||
public string FeatureName { get; } | ||
|
||
/// <summary> | ||
/// If true, the compiler can choose to allow access to the location where this attribute is applied if it does not understand <see cref="FeatureName"/>. | ||
/// </summary> | ||
public bool IsOptional { get; init; } | ||
|
||
/// <summary> | ||
/// The <see cref="FeatureName"/> used for the ref structs C# feature. | ||
/// </summary> | ||
public const string RefStructs = nameof(RefStructs); | ||
|
||
/// <summary> | ||
/// The <see cref="FeatureName"/> used for the required members C# feature. | ||
/// </summary> | ||
public const string RequiredMembers = nameof(RequiredMembers); | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#pragma warning disable | ||
|
||
#if !NET5_0_OR_GREATER | ||
|
||
namespace System.Runtime.CompilerServices; | ||
|
||
using System.Diagnostics; | ||
using System.Diagnostics.CodeAnalysis; | ||
|
||
/// <summary> | ||
/// Reserved to be used by the compiler for tracking metadata. This class should not be used by developers in source code. | ||
/// </summary> | ||
[ExcludeFromCodeCoverage] | ||
[DebuggerNonUserCode] | ||
internal static class IsExternalInit | ||
{ | ||
} | ||
|
||
#endif |
71 changes: 71 additions & 0 deletions
71
src/UiPath.CoreIpc/Polyfills/MemberNotNullWhenAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
// <auto-generated /> | ||
#pragma warning disable | ||
|
||
#if NETSTANDARD || NETFRAMEWORK || NETCOREAPPX | ||
|
||
namespace System.Diagnostics.CodeAnalysis; | ||
|
||
using Targets = AttributeTargets; | ||
|
||
/// <summary> | ||
/// Specifies that the method or property will ensure that the listed field and property members have | ||
/// non-<see langword="null"/> values when returning with the specified return value condition. | ||
/// </summary> | ||
[ExcludeFromCodeCoverage] | ||
[DebuggerNonUserCode] | ||
[AttributeUsage( | ||
validOn: Targets.Method | | ||
Targets.Property, | ||
Inherited = false, | ||
AllowMultiple = true)] | ||
#if PolyPublic | ||
public | ||
#endif | ||
sealed class MemberNotNullWhenAttribute : | ||
Attribute | ||
{ | ||
/// <summary> | ||
/// Gets the return value condition. | ||
/// </summary> | ||
public bool ReturnValue { get; } | ||
|
||
/// <summary> | ||
/// Gets field or property member names. | ||
/// </summary> | ||
public string[] Members { get; } | ||
|
||
/// <summary> | ||
/// Initializes the attribute with the specified return value condition and a field or property member. | ||
/// </summary> | ||
/// <param name="returnValue"> | ||
/// The return value condition. If the method returns this value, | ||
/// the associated parameter will not be <see langword="null"/>. | ||
/// </param> | ||
/// <param name="member"> | ||
/// The field or property member that is promised to be not-<see langword="null"/>. | ||
/// </param> | ||
public MemberNotNullWhenAttribute(bool returnValue, string member) | ||
{ | ||
ReturnValue = returnValue; | ||
Members = [member]; | ||
} | ||
|
||
/// <summary> | ||
/// Initializes the attribute with the specified return value condition and list | ||
/// of field and property members. | ||
/// </summary> | ||
/// <param name="returnValue"> | ||
/// The return value condition. If the method returns this value, | ||
/// the associated parameter will not be <see langword="null"/>. | ||
/// </param> | ||
/// <param name="members"> | ||
/// The list of field and property members that are promised to be not-null. | ||
/// </param> | ||
public MemberNotNullWhenAttribute(bool returnValue, params string[] members) | ||
{ | ||
ReturnValue = returnValue; | ||
Members = members; | ||
} | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// <auto-generated /> | ||
#pragma warning disable | ||
|
||
#if NETSTANDARD2_0 || NETFRAMEWORK || NETCOREAPP2X | ||
|
||
namespace System.Diagnostics.CodeAnalysis; | ||
|
||
using Targets = AttributeTargets; | ||
|
||
[ExcludeFromCodeCoverage] | ||
[DebuggerNonUserCode] | ||
[AttributeUsage( | ||
validOn: Targets.Parameter | | ||
Targets.Property | | ||
Targets.ReturnValue, | ||
AllowMultiple = true)] | ||
#if PolyPublic | ||
public | ||
#endif | ||
sealed class NotNullIfNotNullAttribute : | ||
Attribute | ||
{ | ||
/// <summary> | ||
/// Gets the associated parameter name. | ||
/// The output will be non-<see langword="null"/> if the argument to the | ||
/// parameter specified is non-<see langword="null"/>. | ||
/// </summary> | ||
public string ParameterName { get; } | ||
|
||
/// <summary> | ||
/// Initializes the attribute with the associated parameter name. | ||
/// </summary> | ||
/// <param name="parameterName"> | ||
/// The associated parameter name. | ||
/// The output will be non-<see langword="null"/> if the argument to the | ||
/// parameter specified is non-<see langword="null"/>. | ||
/// </param> | ||
public NotNullIfNotNullAttribute(string parameterName) => | ||
ParameterName = parameterName; | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// <auto-generated /> | ||
#pragma warning disable | ||
|
||
#if NETSTANDARD2_0 || NETFRAMEWORK || NETCOREAPP2X | ||
|
||
namespace System.Diagnostics.CodeAnalysis; | ||
|
||
/// <summary> | ||
/// Specifies that when a method returns <see cref="ReturnValue"/>, | ||
/// the parameter will not be <see langword="null"/> even if the corresponding type allows it. | ||
/// </summary> | ||
[ExcludeFromCodeCoverage] | ||
[DebuggerNonUserCode] | ||
[AttributeUsage(AttributeTargets.Parameter)] | ||
#if PolyPublic | ||
public | ||
#endif | ||
sealed class NotNullWhenAttribute : | ||
Attribute | ||
{ | ||
/// <summary> | ||
/// Gets the return value condition. | ||
/// If the method returns this value, the associated parameter will not be <see langword="null"/>. | ||
/// </summary> | ||
public bool ReturnValue { get; } | ||
|
||
/// <summary> | ||
/// Initializes the attribute with the specified return value condition. | ||
/// </summary> | ||
/// <param name="returnValue"> | ||
/// The return value condition. | ||
/// If the method returns this value, the associated parameter will not be <see langword="null"/>. | ||
/// </param> | ||
public NotNullWhenAttribute(bool returnValue) => | ||
ReturnValue = returnValue; | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// <auto-generated /> | ||
#pragma warning disable | ||
|
||
#if !NET7_0_OR_GREATER | ||
|
||
namespace System.Runtime.CompilerServices; | ||
|
||
using System.Diagnostics; | ||
using System.Diagnostics.CodeAnalysis; | ||
|
||
using Targets = AttributeTargets; | ||
|
||
/// <summary> | ||
/// Specifies that a type has required members or that a member is required. | ||
/// </summary> | ||
[ExcludeFromCodeCoverage] | ||
[DebuggerNonUserCode] | ||
[AttributeUsage( | ||
validOn: Targets.Class | | ||
Targets.Struct | | ||
Targets.Field | | ||
Targets.Property, | ||
Inherited = false)] | ||
#if PolyPublic | ||
public | ||
#endif | ||
sealed class RequiredMemberAttribute : | ||
Attribute; | ||
#endif |
20 changes: 20 additions & 0 deletions
20
src/UiPath.CoreIpc/Polyfills/SetsRequiredMembersAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// <auto-generated /> | ||
#pragma warning disable | ||
|
||
#if !NET7_0_OR_GREATER | ||
|
||
namespace System.Diagnostics.CodeAnalysis; | ||
|
||
/// <summary> | ||
/// Specifies that this constructor sets all required members for the current type, and callers | ||
/// do not need to set any required members themselves. | ||
/// </summary> | ||
[ExcludeFromCodeCoverage] | ||
[DebuggerNonUserCode] | ||
[AttributeUsage(AttributeTargets.Constructor)] | ||
#if PolyPublic | ||
public | ||
#endif | ||
sealed class SetsRequiredMembersAttribute : | ||
Attribute; | ||
#endif |
Oops, something went wrong.