Commit Graph
1282 Commits
Author SHA1 Message Date
Shane Weaver 3be99686a2 Merge branch 'shweaver/storage-helpers' of https://github.com/windows-toolkit/WindowsCommunityToolkit into shweaver/storage-helpers 2021-07-22 12:57:47 -07:00
Shane Weaver e94b20b1ef Removed default param from ISettingsStorageHelper.Read method and updated exception handling in ApplicationDataStorageHelper for missing keys 2021-07-22 12:57:41 -07:00
Shane WeaverandSergio Pedri abe9fce4d1 Update Microsoft.Toolkit/Helpers/ObjectStorage/IFileStorageHelper.cs
Co-authored-by: Sergio Pedri <sergio0694@live.com>
2021-07-22 12:26:08 -07:00
Shane Weaver f36432b1da Merge branch 'shweaver/storage-helpers' of https://github.com/windows-toolkit/WindowsCommunityToolkit into shweaver/storage-helpers 2021-07-22 12:16:06 -07:00
Shane Weaver 36a1d4f49e PR updates 2021-07-21 16:36:45 -07:00
Shane Weaver 3c06ece734 Merge branch 'main' into shweaver/storage-helpers 2021-07-21 13:53:05 -07:00
Michael Hawker MSFT (XAML Llama) d9af3b84bb Merge pull request #3894 from Nirmal4G/feature/refactor
Update package titles and consolidate build logic
2021-07-20 11:34:32 -07:00
Nirmal Guru c4fbb3ecd3 Replace the term 'Basic' in Package Titles
It was decided that the term 'Basic' is new and
has no established meaning in the software community.

So, Replacing the term 'Basic' with 'Common'. To disambiguate
multiple instances of 'Common', we use an already existing term
'Primitive' and we also append the Platform to which the package targets.
2021-07-20 21:45:23 +05:30
Nirmal Guru a2d56c7bdc Update Assembly/Package Titles
The package title doesn't follow a particular format and is not machine readable.
Thus, I propose the following format: "'Product' - 'Area' - 'Specifics' ('Source/Target')"
2021-07-20 21:45:18 +05:30
Nirmal Guru e6e4a221c3 Refactor Test project files
Remove redundant MSBuild logic
Consolidate common MSBuild logic
Reorder code-blocks for better readability
Fix-up comments and new-lines across project files

Improve support for Visual Studio 2022:
Since VS IDE 2022 (17.0) is 64-bit only, replace all 32-bit specific MSBuild properties with generic ones.
2021-07-20 21:45:10 +05:30
Nirmal Guru 39b8ce817f Refactor Core project files
Organize Package tags
Update Package descriptions
Remove redundant MSBuild logic
Consolidate common MSBuild logic
2021-07-20 21:45:09 +05:30
Shane Weaver f023742684 Merge branch 'main' into shweaver/storage-helpers 2021-07-19 13:51:40 -07:00
Michael Hawker MSFT (XAML Llama) 80bd2cdc13 Merge pull request #4117 from CommunityToolkit/fixNugetFeed
Org rename: windows-toolkit -> CommunityToolkit
2021-07-19 13:12:45 -07:00
Alexandre Zollinger Chohfi 874100e85a Org rename: windows-toolkit -> CommunityToolkit 2021-07-19 10:39:06 -07:00
Shane Weaver d5208704b0 Renamed SaveFile/FolderAsync to CreateFile/FolderAsync 2021-07-14 16:23:37 -07:00
Shane Weaver 023bbf5136 PR updates 2021-07-14 16:05:10 -07:00
Shane Weaver 0e1a375138 Fixed another potential null 2021-07-08 14:00:59 -07:00
Shane Weaver cf0b142bc6 Merge branch 'shweaver/storage-helpers' of https://github.com/windows-toolkit/WindowsCommunityToolkit into shweaver/storage-helpers 2021-07-08 13:42:36 -07:00
Shane Weaver 27032340d2 Fixed possible null reference warnings 2021-07-08 13:42:30 -07:00
Shane Weaver c98d3fa62c Merge branch 'main' into shweaver/storage-helpers 2021-07-08 13:22:37 -07:00
Shane Weaver d4b972fa3e Updated headers and bad namespace 2021-07-08 13:21:50 -07:00
Shane Weaver 1dc1947e82 Deprecated existing ObjectStorage classes and migrated some to the *.Toolkit package, out of *.Toolkit.Uwp.
Replaced Local/BaseObjectStorageHelper classes with ApplicationDataStorageHelper.
2021-07-08 12:37:40 -07:00
msftbot[bot] 5e02bea36d Expose public indexer and length properties on RefEnumerable<T> and ReadOnlyRefEnumerable<T> (#4047)
## Closes #4043
## PR Type
What kind of change does this PR introduce?
- Feature

## What is the current behavior?
Currently, `RefEnumerable<T>` (and its read-only variant) do not expose an indexer or their length. This can make it difficult to implement certain APIs against them, such as a function to reverse their data.

## What is the new behavior?
This PR exposes public length and indexer properties (for both `int` and `System.Index`) on both `RefEnumerable<T>` and `ReadOnlyRefEnumerable<T>`.

```diff
public partial readonly ref struct RefEnumerable<T>
{
+   public int Length { get; }
+   public ref T this[int index] { get; }
+   public ref T this[Index index] { get; }
}

public partial readonly ref struct ReadOnlyRefEnumerable<T>
{
+   public int Length { get; }
+   public ref readonly T this[int index] { get; }
+   public ref readonly T this[Index index] { get; }
}
```

## PR Checklist
Please check if your PR fulfills the following requirements:

- [x] Tested code with current [supported SDKs](../readme.md#supported)
- [ ] Pull Request has been submitted to the documentation repository [instructions](..\contributing.md#docs). Link: <!-- docs PR link -->
- [ ] ~Sample in sample app has been added / updated (for bug fixes / features)~
    - [ ] ~Icon has been created (if new sample) following the [Thumbnail Style Guide and templates](https://github.com/windows-toolkit/WindowsCommunityToolkit-design-assets)~
- [ ] ~New major technical changes in the toolkit have or will be added to the [Wiki](https://github.com/windows-toolkit/WindowsCommunityToolkit/wiki) e.g. build changes, source generators, testing infrastructure, sample creation changes, etc...~
- [x] Tests for the changes have been added (for bug fixes / features) (if applicable)
- [ ] ~Header has been added to all new source files (run *build/UpdateHeaders.bat*)~
- [x] Contains **NO** breaking changes

## Other information
It may be worthwhile to additionally expose the `Step` field and the newly-added `DangerousGetReference`/`DangerousGetReferenceAt` methods. This would allow for an implementation of `Reverse` that avoids bounds-checking.
2021-07-07 22:55:07 +00:00
Michael Hawker MSFT (XAML Llama) 61a527f9f1 Merge branch 'main' into feature/refenumerable-indexer 2021-07-07 14:39:00 -07:00
msftbot[bot] 2c136db739 Fix register/unregister issues of WeakReferenceMessenger (#4082)
<!-- 🚨 Please Do Not skip any instructions and information mentioned below as they are all required and essential to evaluate and test the PR. By fulfilling all the required information you will be able to reduce the volume of questions and most likely help merge the PR faster 🚨 -->

<!-- 👉 It is imperative to resolve ONE ISSUE PER PR and avoid making multiple changes unless the changes interrelate with each other --> 

<!-- 📝 Please always keep the "☑️ Allow edits by maintainers" button checked in the Pull Request Template as it increases collaboration with the Toolkit maintainers by permitting commits to your PR branch (only) created from your fork. This can let us quickly make fixes for minor typos or forgotten StyleCop issues during review without needing to wait on you doing extra work. Let us help you help us! 🎉 -->


## Fixes #4081
<!-- Add the relevant issue number after the "#" mentioned above (for ex: "## Fixes #1234") which will automatically close the issue once the PR is merged. -->

<!-- Add a brief overview here of the feature/bug & fix. -->

## PR Type
What kind of change does this PR introduce?
<!-- Please uncomment one or more options below that apply to this PR. -->

Bugfix
<!-- - Feature -->
<!-- - Code style update (formatting) -->
<!-- - Refactoring (no functional changes, no api changes) -->
<!-- - Build or CI related changes -->
<!-- - Documentation content changes -->
<!-- - Sample app changes -->
<!-- - Other... Please describe: -->


## What is the current behavior?
<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->
The attached message handlers of a WeakReferenceMessenger do not get called anymore correctly for all registered objects after unregistering one of them.

## What is the new behavior?
<!-- Describe how was this issue resolved or changed? -->
The attached message handlers get called for all registered objects.

There was an issue with the enumerator of the ConditionalWeakTable. The linked list nodes were not iterated correctly when a key gets removed while enumerating. In this case the "Next"-property of the node was set to null and the while loop stopped immediately (without checking the remaining nodes). 

As a fix the next node is now kept as a locale variable so that it does not get lost when removing the key.

## PR Checklist

Please check if your PR fulfills the following requirements:

- [x] Tested code with current [supported SDKs](../readme.md#supported)
- [ ] Pull Request has been submitted to the documentation repository [instructions](..\contributing.md#docs). Link: <!-- docs PR link -->
- [ ] Sample in sample app has been added / updated (for bug fixes / features)
    - [ ] Icon has been created (if new sample) following the [Thumbnail Style Guide and templates](https://github.com/windows-toolkit/WindowsCommunityToolkit-design-assets)
- [ ] New major technical changes in the toolkit have or will be added to the [Wiki](https://github.com/windows-toolkit/WindowsCommunityToolkit/wiki) e.g. build changes, source generators, testing infrastructure, sample creation changes, etc...
- [x] Tests for the changes have been added (for bug fixes / features) (if applicable)
- [ ] Header has been added to all new source files (run *build/UpdateHeaders.bat*)
- [x] Contains **NO** breaking changes

<!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below.
     Please note that breaking changes are likely to be rejected within minor release cycles or held until major versions. -->


## Other information
2021-07-05 17:26:44 +00:00
steinhilberandSergio Pedri e09772d9a0 Update UnitTests/UnitTests.Shared/Mvvm/Test_Messenger.cs
Co-authored-by: Sergio Pedri <sergio0694@live.com>
2021-06-23 06:49:22 +02:00
steinhilberandSergio Pedri b692df9990 Update UnitTests/UnitTests.Shared/Mvvm/Test_Messenger.cs
Co-authored-by: Sergio Pedri <sergio0694@live.com>
2021-06-23 06:48:45 +02:00
Stefan Steinhilber 1030a20fac Fix register/unregister issues of WeakReferenceMessenger 2021-06-21 11:32:38 +02:00
Michael Hawker MSFT (XAML Llama) 20ad4e505b Merge pull request #3893 from Nirmal4G/hotfix/clean-up
Clean-up project files and MSBuild logic
2021-06-15 14:16:22 -07:00
DaZombieKiller ea429c3878 Remove missed length parameter on RefEnumerable test 2021-06-11 20:25:55 +10:00
DaZombieKiller 170ca47490 Add RefEnumerable indexer exception tests 2021-06-11 20:20:16 +10:00
Nirmal Guru d52cc99280 Consolidate package versions
Update renamed files in the build logic
Use correct path format in the build logic
2021-06-04 21:00:29 +05:30
Nirmal Guru e6776530da Reorder code-blocks for better readability
To make diff understandable through blame and across similar project files,
I have re-organized some lines in these project files. This also improves
readability. Previously, the focus is per-project file but now—to maintain
project logic across repos and several similar logic across project files,
new way of authoring project files is required.

This refactor is the start of it.
2021-06-04 21:00:22 +05:30
Nirmal Guru 08d209dfb8 Fix-up comments across project files
Format comments to be legible.
 - Place comment start and end tags on a new line for multi-line comments.
 - Have space between start and end tags in a single line comment.

Place comments where appropriate.
 - If an entire block is common to the comment then place it above the block.
 - Only place a comment near or after the block, if it refers exclusively.

Sources are not formatted!
2021-06-04 21:00:21 +05:30
Nirmal Guru 35d785190b Fix-up white-spaces across project files
Add/Remove leading and trailing white-space (only in comments, code blocks, xml strings)
2021-06-04 21:00:20 +05:30
Nirmal Guru 4e90f97f06 Fix-up new-lines across project files
Add/Remove new-lines (only in project files, xml files and some source files)
2021-06-04 21:00:19 +05:30
DaZombieKiller 643974d610 Add XML documentation for index parameter on RefEnumerable indexers 2021-05-29 01:28:49 +10:00
DaZombieKiller 6f3fa5934f Add tests for RefEnumerable indexers 2021-05-28 21:55:39 +10:00
DaZombieKiller 5e8188896d Add AggressiveInlining to Length property on RefEnumerable 2021-05-28 21:55:06 +10:00
DaZombieKiller 13b290a354 Rework public length and indexer properties for RefEnumerable<T> 2021-05-28 03:31:18 +10:00
DaZombieKiller d8e2504dc9 Add newline before comments in DangerousGetReferenceAt 2021-05-27 20:38:13 +10:00
DaZombieKiller 90f6116df2 Expose public indexer and length properties on RefEnumerable<T> and ReadOnlyRefEnumerable<T> 2021-05-27 01:15:19 +10:00
Nirmal Guru d0f577f553 Revert Wrong formatting applied by .NET Tool
Both VS IDE Code Clean-up and dotnet-format applies this formatting.
Only Code labels and Code within pre-processor blocks are affected.

The reason may be that the indentation wasn't read/written properly
by the formatter within or around those code blocks.
2021-05-17 12:43:06 -07:00
Nirmal Guru f963491691 Wrong formatting applied by .NET Tool
Both VS IDE Code Clean-up and dotnet-format applies this formatting.
Only Code labels and Code within pre-processor blocks are affected.

The reason may be that the indentation wasn't read/written properly
by the formatter within or around those code blocks.

NOTE: We could ignore this commit but we keep it as a reference point
      for the VS C# Editor and .NET format team to diagnose this issue.
2021-05-17 12:43:06 -07:00
Nirmal Guru 1c2ef96077 Remove redundant xml meta-tag
XML files defaults to 'UTF-8' encoding.
Thus, the meta-tag is no longer needed!
2021-05-17 12:43:06 -07:00
Nirmal Guru 0ab624eaa9 Use Unicode charset without the BOM
Update and follow EditorConfig settings.
BOM: Byte Order Mark (Used to identify UTF-8 encoding).
We don't need BOM specified as the latest editors can work without it.
2021-05-17 12:43:06 -07:00
Nirmal Guru a661ee7522 Clean-up trailing white-spaces
Remove final new-lines
Remove trailing white-spaces
2021-05-17 12:43:06 -07:00
Michael Hawker MSFT (XAML Llama) 106d11be6a Merge pull request #4018 from Sergio0694/bugfix/messenger-tests
Improve Messenger tests
2021-05-11 17:48:29 -07:00
Sergio Pedri e9bb11841d Improved Messenger tests, fixed early GC collections
Should prevent #4017 from happening again
2021-05-10 22:49:28 +02:00
Sergio Pedri 203bd00bf7 Added missing ConfigureAwait(false) in AsyncCollectionRequestMessage<T> 2021-05-10 22:49:00 +02:00