-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Declare internal source attributes in consuming projects
- Loading branch information
Showing
3 changed files
with
45 additions
and
1 deletion.
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
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,13 @@ | ||
<Project> | ||
|
||
<PropertyGroup> | ||
<OwnershipAttributesPath Condition="'$(OwnershipAttributesPath)' == ''">$(MSBuildThisFileDirectory)OwnershipAttributes$(DefaultLanguageSourceExtension)</OwnershipAttributesPath> | ||
|
||
<IncludeOwnershipAttributes Condition="'$(IncludeOwnershipAttributes)' == '' and Exists($(OwnershipAttributesPath))">true</IncludeOwnershipAttributes> | ||
</PropertyGroup> | ||
|
||
<ItemGroup Condition="'$(IncludeOwnershipAttributes)' == 'true'"> | ||
<Compile Include="$(OwnershipAttributesPath)" Visible="false" /> | ||
</ItemGroup> | ||
|
||
</Project> |
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,28 @@ | ||
namespace IDisposableAnnotations | ||
{ | ||
using System; | ||
|
||
/// <summary> | ||
/// The return value must be disposed by the caller. | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.ReturnValue | AttributeTargets.Parameter, AllowMultiple = false, Inherited = true)] | ||
internal sealed class GivesOwnershipAttribute : Attribute | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// The return value must not be disposed by the caller. | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.ReturnValue | AttributeTargets.Parameter, AllowMultiple = false, Inherited = true)] | ||
internal sealed class KeepsOwnershipAttribute : Attribute | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// The ownership of instance is transferred and the receiver is responsible for disposing. | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = true)] | ||
internal sealed class TakesOwnershipAttribute : Attribute | ||
{ | ||
} | ||
} |