diff --git a/Epoxy.sln b/Epoxy.sln index 5fc8ce77..4e8dcb3d 100644 --- a/Epoxy.sln +++ b/Epoxy.sln @@ -17,8 +17,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution nuget.config = nuget.config README.ja.md = README.ja.md README.md = README.md - test-templates-nuget.config = test-templates-nuget.config - test-templates.bat = test-templates.bat EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "playground", "playground", "{21C50AF6-746E-4FA9-9058-AF2301B23ED8}" diff --git a/README.ja.md b/README.ja.md index 5c314fa9..cdd531b3 100644 --- a/README.ja.md +++ b/README.ja.md @@ -832,6 +832,7 @@ Apache-v2 * Xamarin Formsを廃止。 * テンプレートプロジェクトを廃止。 * まだしばらくは新規プロジェクト生成として機能すると思いますが、更新されません。 + * 互換性の為に残されていたObsoleteメンバーを削除。 * 1.14.0: * Avalonia 11で、XAMLからEpoxyを参照する際の名前空間にURLを指定可能にしました。 `xmlns:epoxy="https://github.com/kekyo/Epoxy"` のように指定できます。 diff --git a/README.md b/README.md index 7be68d80..677938a5 100644 --- a/README.md +++ b/README.md @@ -826,6 +826,7 @@ Apache-v2 * Deprecated Xamarin Forms. * Deprecated Template Projects. * Will still function as a new project generation for a while, but will not be updated. + * Removed Obsolete member left for compatibility. * 1.14.0: * In Avalonia 11, allow URLs to be specified in the namespace when referencing Epoxy from XAML. It can be specified as `xmlns:epoxy="https://github.com/kekyo/Epoxy"`. diff --git a/playground/EpoxyHello.Core/Models/Reddit.cs b/playground/EpoxyHello.Core/Models/Reddit.cs deleted file mode 100644 index 57e5063f..00000000 --- a/playground/EpoxyHello.Core/Models/Reddit.cs +++ /dev/null @@ -1,83 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// -// Epoxy - An independent flexible XAML MVVM library for .NET -// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//////////////////////////////////////////////////////////////////////////// - -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System; -using System.IO; -using System.Linq; -using System.Net.Http; -using System.Text; -using System.Threading.Tasks; - -namespace EpoxyHello.Models; - -[Obsolete("Old sample implementation.")] -public static class Reddit -{ - private static readonly HttpClient httpClient = new HttpClient(); - - public static async ValueTask FetchNewPostsAsync(string name) - { - // Uses Reddit with Json API - using (var response = - await httpClient. - GetAsync($"https://www.reddit.com/{name}/new.json"). - ConfigureAwait(false)) - { - using (var stream = - await response.Content.ReadAsStreamAsync(). - ConfigureAwait(false)) - { - var tr = new StreamReader(stream, Encoding.UTF8, true); - var jr = new JsonTextReader(tr); - - var serializer = new JsonSerializer(); - - var root = serializer.Deserialize(jr); - - return root!["data"]!["children"]!. - Select(child => child["data"]!). - Where(data => Path.GetExtension(((Uri)data["url"]!).AbsolutePath) switch { ".jpg" => true, ".png" => true, _ => false }). - Select(data => new RedditPost((string)data["title"]!, (Uri)data["url"]!, (int)data["score"]!)). - ToArray(); - } - } - } - - public static async ValueTask FetchImageAsync(Uri url) - { - using (var response = - await httpClient. - GetAsync(url). - ConfigureAwait(false)) - { - using (var stream = - await response.Content.ReadAsStreamAsync(). - ConfigureAwait(false)) - { - var ms = new MemoryStream(); - await stream.CopyToAsync(ms). - ConfigureAwait(false); - - return ms.ToArray(); - } - } - } -} diff --git a/playground/EpoxyHello.Core/Models/RedditPost.cs b/playground/EpoxyHello.Core/Models/RedditPost.cs deleted file mode 100644 index de6a18b9..00000000 --- a/playground/EpoxyHello.Core/Models/RedditPost.cs +++ /dev/null @@ -1,37 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// -// Epoxy - An independent flexible XAML MVVM library for .NET -// Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//////////////////////////////////////////////////////////////////////////// - -using System; - -namespace EpoxyHello.Models; - -[Obsolete("Old sample implementation.")] -public sealed class RedditPost -{ - public readonly string Title; - public readonly Uri Url; - public readonly int Score; - - public RedditPost(string title, Uri url, int score) - { - this.Title = title; - this.Url = url; - this.Score = score; - } -} diff --git a/src/Epoxy.Core/Advanced/GlobalService.cs b/src/Epoxy.Core/Advanced/GlobalService.cs index f30294ec..757c1723 100644 --- a/src/Epoxy.Core/Advanced/GlobalService.cs +++ b/src/Epoxy.Core/Advanced/GlobalService.cs @@ -83,33 +83,4 @@ public static class GlobalService /// public static readonly GlobalServiceAccessor Accessor = InternalGlobalService.Accessor; - - #region Obsoleted - /// - /// Static Register() method is obsoleted, will remove in future release. Use Accessor.Register() instead. - /// - [Obsolete("Static Register() method is obsoleted, will remove in future release. Use Accessor.Register() instead.")] - public static void Register( - object instance, RegisteringValidations validation = RegisteringValidations.Strict) => - InternalGlobalService.Register(instance, validation); - - /// - /// Static Unregister() method is obsoleted, will remove in future release. Use Accessor.Unregister() instead. - /// - [Obsolete("Static Unregister() method is obsoleted, will remove in future release. Use Accessor.Unregister() instead.")] - public static void Unregister(object instance) => - InternalGlobalService.Unregister(instance); - - /// - /// Static ExecuteAsync() method is obsoleted, will remove future release. Use Accessor.ExecuteAsync() instead. - /// - [Obsolete("Static ExecuteAsync() method is obsoleted, will remove future release. Use Accessor.ExecuteAsync() instead.")] - public static ValueTask ExecuteAsync( - Func action, bool ignoreNotPresent = false) => - InternalGlobalService.ExecuteAsync(action, ignoreNotPresent); - [Obsolete("Static ExecuteAsync() method is obsoleted, will remove future release. Use Accessor.ExecuteAsync() instead.")] - public static ValueTask ExecuteAsync( - Func> action) => - InternalGlobalService.ExecuteAsync(action); - #endregion } diff --git a/src/Epoxy/CommandFactoryExtension.cs b/src/Epoxy/CommandFactoryExtension.cs index 2cf99cbc..62b34a03 100644 --- a/src/Epoxy/CommandFactoryExtension.cs +++ b/src/Epoxy/CommandFactoryExtension.cs @@ -28,60 +28,6 @@ namespace Epoxy; -/// -/// CommandFactory class is obsoleted. Use Command.Factory instead. -/// -[Obsolete("CommandFactory class is obsoleted. Use Command.Factory instead.")] -[DebuggerStepThrough] -public static class CommandFactory -{ - /// - /// CommandFactory class is obsoleted. Use Command.Factory instead. - /// - /// Asynchronous handler - /// A Command instance - [Obsolete("CommandFactory class is obsoleted. Use Command.Factory instead.")] - public static Command Create( - Func executeAsync) => - new DelegatedCommand(() => executeAsync().AsValueTaskUnit()); - - /// - /// CommandFactory class is obsoleted. Use Command.Factory instead. - /// - /// Asynchronous handler - /// Responder for be able to execute - /// A Command instance - [Obsolete("CommandFactory class is obsoleted. Use Command.Factory instead.")] - public static Command Create( - Func executeAsync, - Func canExecute) => - new DelegatedCommand(() => executeAsync().AsValueTaskUnit(), canExecute); - - /// - /// CommandFactory class is obsoleted. Use Command.Factory instead. - /// - /// Handler parameter type - /// Asynchronous handler - /// A Command instance - [Obsolete("CommandFactory class is obsoleted. Use Command.Factory instead.")] - public static Command Create( - Func executeAsync) => - new DelegatedCommand(p => executeAsync(p).AsValueTaskUnit()); - - /// - /// CommandFactory class is obsoleted. Use Command.Factory instead. - /// - /// Handler parameter type - /// Asynchronous handler - /// Responder for be able to execute - /// A Command instance - [Obsolete("CommandFactory class is obsoleted. Use Command.Factory instead.")] - public static Command Create( - Func executeAsync, - Func canExecute) => - new DelegatedCommand(p => executeAsync(p).AsValueTaskUnit(), canExecute); -} - /// /// Command factory methods for ValueTask based asynchronous handler. /// diff --git a/src/Epoxy/Pile.cs b/src/Epoxy/Pile.cs index ec5efbb9..76c7cb22 100644 --- a/src/Epoxy/Pile.cs +++ b/src/Epoxy/Pile.cs @@ -63,32 +63,6 @@ namespace Epoxy; -/// -/// PileFactory class is obsoleted. Use Pile.Factory instead. -/// -[Obsolete("PileFactory class is obsoleted. Use Pile.Factory instead.")] -[DebuggerStepThrough] -public static class PileFactory -{ - /// - /// PileFactory class is obsoleted. Use Pile.Factory instead. - /// - /// Pile instance - [Obsolete("PileFactory class is obsoleted. Use Pile.Factory instead.")] - public static Pile Create() => - new Pile(); - - /// - /// PileFactory class is obsoleted. Use Pile.Factory instead. - /// - /// Target control type - /// Pile instance - [Obsolete("PileFactory class is obsoleted. Use Pile.Factory instead.")] - public static Pile Create() - where TUIElement : UIElement => - new Pile(); -} - /// /// The Pile factory. /// diff --git a/src/Epoxy/UIThread.cs b/src/Epoxy/UIThread.cs index a0bdee47..9ee8e874 100644 --- a/src/Epoxy/UIThread.cs +++ b/src/Epoxy/UIThread.cs @@ -60,13 +60,6 @@ public static class UIThread public static ValueTask IsBoundAsync() => InternalUIThread.IsBoundAsync(); - /// - /// Detects current thread context on the UI thread. - /// - [Obsolete("IsBound property is deprecated. Use IsBoundAsync() method instead.", true)] - public static bool IsBound => - throw new NotImplementedException(); - /// /// Binds current task to the UI thread context manually. /// diff --git a/src/FSharp.Epoxy/Advanced/GlobalServiceAccessorExtension.fs b/src/FSharp.Epoxy/Advanced/GlobalServiceAccessorExtension.fs index f5d3d858..8d0737a9 100644 --- a/src/FSharp.Epoxy/Advanced/GlobalServiceAccessorExtension.fs +++ b/src/FSharp.Epoxy/Advanced/GlobalServiceAccessorExtension.fs @@ -26,43 +26,6 @@ open System.Runtime.InteropServices open Epoxy.Advanced open Epoxy.Internal -[] -[] -module public GlobalServiceExtension = - - type public GlobalService with - - /// - /// Static register() method is obsoleted, will remove future release. Use Accessor.register() instead. - /// - [] - static member register(instance: obj, [] validation: RegisteringValidations) = - InternalGlobalService.Register(instance, validation) - - /// - /// Static unregister() method is obsoleted, will remove future release. Use Accessor.unregister() instead. - /// - /// Target instance - [] - static member unregister(instance: obj) = - InternalGlobalService.Unregister(instance) - - /// - /// Static executeAsync() method is obsoleted, will remove future release. Use Accessor.executeAsync() instead. - /// - [] - static member executeAsync(action: 'TService -> Async, [] ignoreNotPresent: bool) = - InternalGlobalService.ExecuteAsync<'TService>(action >> asyncUnitAsValueTaskVoid |> asFunc1, ignoreNotPresent) - |> valueTaskVoidAsAsyncResult - - /// - /// Static executeAsync() method is obsoleted, will remove future release. Use Accessor.executeAsync() instead. - /// - [] - static member executeAsync(action: 'TService -> Async<'TResult>) = - InternalGlobalService.ExecuteAsync<'TService, 'TResult>(action >> asyncAsValueTask |> asFunc1) - |> valueTaskAsAsyncResult - /// /// GlobalService is a simple and lightweight dependency injection infrastructure. /// diff --git a/src/FSharp.Epoxy/CommandFactory.fs b/src/FSharp.Epoxy/CommandFactory.fs index de310eb9..521f0b0c 100644 --- a/src/FSharp.Epoxy/CommandFactory.fs +++ b/src/FSharp.Epoxy/CommandFactory.fs @@ -34,54 +34,6 @@ module private CommandFactoryGenerator = let inline createP0 executeAsync = new DelegatedCommand<'TParameter>(executeAsync) :> Command let inline createP1 executeAsync canExecute = new DelegatedCommand<'TParameter>(executeAsync, canExecute) :> Command -/// -/// CommandFactory class is obsoleted. Use Command.Factory instead. -/// -[] -[] -[] -[] -type public CommandFactory = - /// - /// CommandFactory class is obsoleted. Use Command.Factory instead. - /// - /// Asynchronous handler - /// A Command instance - [] - static member create executeAsync = - create0 (executeAsync >> asyncUnitAsValueTaskUnit |> asFunc0) - - /// - /// CommandFactory class is obsoleted. Use Command.Factory instead. - /// - /// Asynchronous handler - /// Responder for be able to execute - /// A Command instance - [] - static member create (executeAsync, canExecute) = - create1 (executeAsync >> asyncUnitAsValueTaskUnit |> asFunc0) (canExecute |> asFunc0) - - /// - /// CommandFactory class is obsoleted. Use Command.Factory instead. - /// - /// Handler parameter type - /// Asynchronous handler - /// A Command instance - [] - static member create (executeAsync: 'TParameter -> Async) = - createP0 (executeAsync >> asyncUnitAsValueTaskUnit |> asFunc1) - - /// - /// CommandFactory class is obsoleted. Use Command.Factory instead. - /// - /// Handler parameter type - /// Asynchronous handler - /// Responder for be able to execute - /// A Command instance - [] - static member create (executeAsync: 'TParameter -> Async, canExecute) = - createP1 (executeAsync >> asyncUnitAsValueTaskUnit |> asFunc1) (canExecute |> asFunc1) - /// /// Command factory functions for Async<unit> based asynchronous handler. /// diff --git a/src/FSharp.Epoxy/Pile.fs b/src/FSharp.Epoxy/Pile.fs index 94368ea6..f3ffafa2 100644 --- a/src/FSharp.Epoxy/Pile.fs +++ b/src/FSharp.Epoxy/Pile.fs @@ -39,31 +39,6 @@ open Microsoft.UI.Xaml open System.Windows #endif -/// -/// PileFactory class is obsoleted. Use Pile.Factory instead. -/// -[] -[] -[] -type public PileFactory = - - /// - /// PileFactory class is obsoleted. Use Pile.Factory instead. - /// - /// Pile instance - [] - static member create() = - new Pile() - - /// - /// PileFactory class is obsoleted. Use Pile.Factory instead. - /// - /// Target control type - /// Pile instance - [] - static member create<'TUIElement when 'TUIElement :> UIElement>() = - new Pile<'TUIElement>() - /// /// The Pile factory. ///