Compare commits

...

11 Commits

Author SHA1 Message Date
Ikiru Yoshizaki
e9cf488b0d
chore: add .editorconfig 2025-05-14 11:20:03 +09:00
Ikiru Yoshizaki
57fdc250ce
ci: fix ghalint 2025-05-13 17:51:44 +09:00
Ikiru Yoshizaki
8beb9e1996 ci: use Cysharp/Actions checkout instead of 3rd party directly 2025-03-19 15:39:53 +09:00
Ikiru Yoshizaki
5bc5ea17c7
Merge pull request #95 from Cysharp/feature/pin_action
ci: Pinning third party GitHub Actions sha
2025-03-18 17:23:32 +09:00
Ikiru Yoshizaki
bd6e249304 ci: Pinning third party GitHub Actions sha 2025-03-18 16:51:13 +09:00
Yoshifumi Kawai
6f5de33bff
Merge pull request #90 from erri120/fix/89
Fix incrementing `-1` indices
2024-12-16 12:12:48 +09:00
erri120
7c4974c36a
Fix incrementing -1 indices
Fixes https://github.com/Cysharp/ObservableCollections/issues/89
2024-12-13 17:06:14 +01:00
Yoshifumi Kawai
a16edc16ed
Merge pull request #85 from Skurdt/patch-1
Added out keyword to ObservableStack.TryPeek
2024-11-11 16:42:53 +09:00
Skurdt
6e263fa123
Added out keyword to ObservableStack.TryPeek 2024-11-11 03:30:56 +01:00
Yoshifumi Kawai
b92e0de242
Merge pull request #84 from prozolic/pullreq
Fix README
2024-10-24 01:23:22 +09:00
prozolic
890388ea5e Fix README 2024-10-23 23:15:23 +09:00
9 changed files with 69 additions and 10 deletions

41
.editorconfig Normal file
View File

@ -0,0 +1,41 @@
# top-most EditorConfig file
root = true
[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
# Visual Studio Spell checker configs (https://learn.microsoft.com/en-us/visualstudio/ide/text-spell-checker?view=vs-2022#how-to-customize-the-spell-checker)
spelling_exclusion_path = ./exclusion.dic
[*.cs]
indent_size = 4
charset = utf-8-bom
end_of_line = unset
# Solution files
[*.{sln,slnx}]
end_of_line = unset
# MSBuild project files
[*.{csproj,props,targets}]
end_of_line = unset
# Xml config files
[*.{ruleset,config,nuspec,resx,runsettings,DotSettings}]
end_of_line = unset
[*{_AssemblyInfo.cs,.notsupported.cs}]
generated_code = true
# C# code style settings
[*.{cs}]
dotnet_diagnostic.IDE0044.severity = none # IDE0044: Make field readonly
# https://stackoverflow.com/questions/79195382/how-to-disable-fading-unused-methods-in-visual-studio-2022-17-12-0
dotnet_diagnostic.IDE0051.severity = none # IDE0051: Remove unused private member
dotnet_diagnostic.IDE0130.severity = none # IDE0130: Namespace does not match folder structure

View File

@ -5,3 +5,8 @@ updates:
directory: "/"
schedule:
interval: "weekly" # Check for updates to GitHub Actions every week
ignore:
# I just want update action when major/minor version is updated. patch updates are too noisy.
- dependency-name: '*'
update-types:
- version-update:semver-patch

View File

@ -10,10 +10,12 @@ on:
jobs:
build-dotnet:
runs-on: ubuntu-latest
permissions:
contents: read
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: Cysharp/Actions/.github/actions/checkout@main
- uses: Cysharp/Actions/.github/actions/setup-dotnet@main
- run: dotnet build -c Debug
- run: dotnet test -c Debug --no-build

View File

@ -14,10 +14,12 @@ on:
jobs:
build-dotnet:
runs-on: ubuntu-latest
permissions:
contents: read
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: Cysharp/Actions/.github/actions/checkout@main
- uses: Cysharp/Actions/.github/actions/setup-dotnet@main
# build and pack
- run: dotnet build -c Release -p:Version=${{ inputs.tag }}
@ -33,6 +35,8 @@ jobs:
# release
create-release:
needs: [build-dotnet]
permissions:
contents: write
uses: Cysharp/Actions/.github/workflows/create-release.yaml@main
with:
commit-id: ${{ github.sha }}

View File

@ -7,4 +7,6 @@ on:
jobs:
detect:
permissions:
contents: read
uses: Cysharp/Actions/.github/workflows/prevent-github-change.yaml@main

View File

@ -7,4 +7,8 @@ on:
jobs:
stale:
permissions:
contents: read
pull-requests: write
issues: write
uses: Cysharp/Actions/.github/workflows/stale-issue.yaml@main

View File

@ -56,7 +56,6 @@ Observable<CollectionRemoveEvent<T>> IObservableCollection<T>.ObserveRemove()
Observable<CollectionReplaceEvent<T>> IObservableCollection<T>.ObserveReplace()
Observable<CollectionMoveEvent<T>> IObservableCollection<T>.ObserveMove()
Observable<CollectionResetEvent<T>> IObservableCollection<T>.ObserveReset()
Observable<CollectionResetEvent<T>> IObservableCollection<T>.ObserveReset()
Observable<Unit> IObservableCollection<T>.ObserveClear<T>()
Observable<(int Index, int Count)> IObservableCollection<T>.ObserveReverse<T>()
Observable<(int Index, int Count, IComparer<T>? Comparer)> IObservableCollection<T>.ObserveSort<T>()
@ -487,7 +486,7 @@ ObservableCollections provides these collections.
```csharp
class ObservableList<T> : IList<T>, IReadOnlyList<T>, IObservableCollection<T>, IReadOnlyObservableList<T>
class ObservableDictionary<TKey, TValue> : IDictionary<TKey, TValue>, IReadOnlyDictionary<TKey, TValue>, IObservableCollection<KeyValuePair<TKey, TValue>> where TKey : notnull
class ObservableDictionary<TKey, TValue> : IDictionary<TKey, TValue>, IReadOnlyDictionary<TKey, TValue>, IObservableCollection<KeyValuePair<TKey, TValue>>, IReadOnlyObservableDictionary<TKey, TValue> where TKey : notnull
class ObservableHashSet<T> : IReadOnlySet<T>, IReadOnlyCollection<T>, IObservableCollection<T> where T : notnull
class ObservableQueue<T> : IReadOnlyCollection<T>, IObservableCollection<T>
class ObservableStack<T> : IReadOnlyCollection<T>, IObservableCollection<T>
@ -684,7 +683,7 @@ public interface ISynchronizedViewList<out TView> : IReadOnlyList<TView>, IDispo
}
// Obsolete for public use
public interface INotifyCollectionChangedSynchronizedViewList<out TView> : ISynchronizedViewList<TView>, INotifyCollectionChanged, INotifyPropertyChanged
public interface INotifyCollectionChangedSynchronizedViewList<TView> : IList<TView>, IList, ISynchronizedViewList<TView>, INotifyCollectionChanged, INotifyPropertyChanged
{
}

View File

@ -167,10 +167,12 @@ sealed class ObservableCollectionChanged<T>(IObservableCollection<T> collection,
eventArgs.Action,
item,
eventArgs.OldItem,
i++,
newStartingIndex: i,
eventArgs.OldStartingIndex,
eventArgs.SortOperation);
if (eventArgs.NewStartingIndex != -1) i++;
observer.OnNext(newArgs);
}
}

View File

@ -166,7 +166,7 @@ namespace ObservableCollections
}
}
public bool TryPeek([MaybeNullWhen(false)] T result)
public bool TryPeek([MaybeNullWhen(false)] out T result)
{
lock (SyncRoot)
{
@ -212,4 +212,4 @@ namespace ObservableCollections
return GetEnumerator();
}
}
}
}