Browse Source

Prevent all obsolete members from listing in auto-completions

pull/11200/head
Steven He 3 years ago
parent
commit
be14072ab2
  1. 3
      src/Avalonia.Base/Data/BindingPriority.cs
  2. 3
      src/Avalonia.Base/Data/InstancedBinding.cs
  3. 3
      src/Avalonia.Base/Input/DataFormats.cs
  4. 3
      src/Avalonia.Base/Input/DataObjectExtensions.cs
  5. 3
      src/Avalonia.Base/Media/Color.cs
  6. 7
      src/Avalonia.Base/Media/DrawingContext.cs
  7. 3
      src/Avalonia.Base/Threading/DispatcherPriority.cs
  8. 5
      src/Avalonia.Base/VisualTree/IVisualWithRoundRectClip.cs
  9. 4
      src/Avalonia.Controls/ContextMenu.cs
  10. 5
      src/Avalonia.Controls/Generators/ItemContainerGenerator.cs
  11. 7
      src/Avalonia.Controls/Generators/TreeItemContainerGenerator.cs
  12. 3
      src/Avalonia.Controls/ItemsControl.cs
  13. 3
      src/Avalonia.Controls/Platform/Dialogs/ISystemDialogImpl.cs
  14. 3
      src/Avalonia.Controls/Platform/Dialogs/SystemDialogImpl.cs
  15. 5
      src/Avalonia.Controls/Platform/Screen.cs
  16. 4
      src/Avalonia.Controls/Primitives/Popup.cs
  17. 19
      src/Avalonia.Controls/Primitives/ToggleButton.cs
  18. 3
      src/Avalonia.Controls/Screens.cs
  19. 15
      src/Avalonia.Controls/SystemDialog.cs
  20. 3
      src/Avalonia.Controls/TreeView.cs
  21. 5
      src/Avalonia.Dialogs/ManagedFileDialogExtensions.cs
  22. 4
      src/Avalonia.OpenGL/Controls/OpenGlControlBase.cs

3
src/Avalonia.Base/Data/BindingPriority.cs

@ -1,4 +1,5 @@
using System; using System;
using System.ComponentModel;
namespace Avalonia.Data namespace Avalonia.Data
{ {
@ -47,7 +48,7 @@ namespace Avalonia.Data
/// </summary> /// </summary>
Unset = int.MaxValue, Unset = int.MaxValue,
[Obsolete("Use Template priority")] [Obsolete("Use Template priority"), EditorBrowsable(EditorBrowsableState.Never)]
TemplatedParent = Template, TemplatedParent = Template,
} }
} }

3
src/Avalonia.Base/Data/InstancedBinding.cs

@ -1,4 +1,5 @@
using System; using System;
using System.ComponentModel;
using Avalonia.Reactive; using Avalonia.Reactive;
using ObservableEx = Avalonia.Reactive.Observable; using ObservableEx = Avalonia.Reactive.Observable;
@ -49,7 +50,7 @@ namespace Avalonia.Data
/// </summary> /// </summary>
public IObservable<object?> Source { get; } public IObservable<object?> Source { get; }
[Obsolete("Use Source property")] [Obsolete("Use Source property"), EditorBrowsable(EditorBrowsableState.Never)]
public IObservable<object?> Observable => Source; public IObservable<object?> Observable => Source;
/// <summary> /// <summary>

3
src/Avalonia.Base/Input/DataFormats.cs

@ -1,4 +1,5 @@
using System; using System;
using System.ComponentModel;
namespace Avalonia.Input namespace Avalonia.Input
{ {
@ -17,7 +18,7 @@ namespace Avalonia.Input
/// <summary> /// <summary>
/// Dataformat for one or more filenames /// Dataformat for one or more filenames
/// </summary> /// </summary>
[Obsolete("Use DataFormats.Files, this format is supported only on desktop platforms.")] [Obsolete("Use DataFormats.Files, this format is supported only on desktop platforms."), EditorBrowsable(EditorBrowsableState.Never)]
public static readonly string FileNames = nameof(FileNames); public static readonly string FileNames = nameof(FileNames);
} }
} }

3
src/Avalonia.Base/Input/DataObjectExtensions.cs

@ -1,4 +1,5 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel;
using System.Linq; using System.Linq;
using Avalonia.Platform.Storage; using Avalonia.Platform.Storage;
@ -25,7 +26,7 @@ namespace Avalonia.Input
/// <returns> /// <returns>
/// Collection of file names. If format isn't available, returns null. /// Collection of file names. If format isn't available, returns null.
/// </returns> /// </returns>
[System.Obsolete("Use GetFiles, this method is supported only on desktop platforms.")] [System.Obsolete("Use GetFiles, this method is supported only on desktop platforms."), EditorBrowsable(EditorBrowsableState.Never)]
public static IEnumerable<string>? GetFileNames(this IDataObject dataObject) public static IEnumerable<string>? GetFileNames(this IDataObject dataObject)
{ {
return (dataObject.Get(DataFormats.FileNames) as IEnumerable<string>) return (dataObject.Get(DataFormats.FileNames) as IEnumerable<string>)

3
src/Avalonia.Base/Media/Color.cs

@ -6,6 +6,7 @@
// Licensed to The Avalonia Project under MIT License, courtesy of The .NET Foundation. // Licensed to The Avalonia Project under MIT License, courtesy of The .NET Foundation.
using System; using System;
using System.ComponentModel;
using System.Globalization; using System.Globalization;
#if !BUILDTASK #if !BUILDTASK
using Avalonia.Animation.Animators; using Avalonia.Animation.Animators;
@ -465,7 +466,7 @@ namespace Avalonia.Media
} }
/// <inheritdoc cref="Color.ToUInt32"/> /// <inheritdoc cref="Color.ToUInt32"/>
[Obsolete("Use Color.ToUInt32() instead.")] [Obsolete("Use Color.ToUInt32() instead."), EditorBrowsable(EditorBrowsableState.Never)]
public uint ToUint32() public uint ToUint32()
{ {
return ToUInt32(); return ToUInt32();

7
src/Avalonia.Base/Media/DrawingContext.cs

@ -5,6 +5,7 @@ using Avalonia.Rendering.SceneGraph;
using Avalonia.Threading; using Avalonia.Threading;
using Avalonia.Utilities; using Avalonia.Utilities;
using Avalonia.Media.Imaging; using Avalonia.Media.Imaging;
using System.ComponentModel;
namespace Avalonia.Media namespace Avalonia.Media
{ {
@ -417,11 +418,11 @@ namespace Avalonia.Media
return new PushedState(this); return new PushedState(this);
} }
[Obsolete("Use PushTransform")] [Obsolete("Use PushTransform"), EditorBrowsable(EditorBrowsableState.Never)]
public PushedState PushPreTransform(Matrix matrix) => PushTransform(matrix); public PushedState PushPreTransform(Matrix matrix) => PushTransform(matrix);
[Obsolete("Use PushTransform")] [Obsolete("Use PushTransform"), EditorBrowsable(EditorBrowsableState.Never)]
public PushedState PushPostTransform(Matrix matrix) => PushTransform(matrix); public PushedState PushPostTransform(Matrix matrix) => PushTransform(matrix);
[Obsolete("Use PushTransform")] [Obsolete("Use PushTransform"), EditorBrowsable(EditorBrowsableState.Never)]
public PushedState PushTransformContainer() => PushTransform(Matrix.Identity); public PushedState PushTransformContainer() => PushTransform(Matrix.Identity);

3
src/Avalonia.Base/Threading/DispatcherPriority.cs

@ -1,4 +1,5 @@
using System; using System;
using System.ComponentModel;
namespace Avalonia.Threading namespace Avalonia.Threading
{ {
@ -100,7 +101,7 @@ namespace Avalonia.Threading
/// <summary> /// <summary>
/// The job will be processed with the same priority as data binding. /// The job will be processed with the same priority as data binding.
/// </summary> /// </summary>
[Obsolete("WPF compatibility")] public static readonly DispatcherPriority DataBind = new(Layout); [Obsolete("WPF compatibility"), EditorBrowsable(EditorBrowsableState.Never)] public static readonly DispatcherPriority DataBind = new(Layout);
/// <summary> /// <summary>
/// The job will be processed with normal priority. /// The job will be processed with normal priority.

5
src/Avalonia.Base/VisualTree/IVisualWithRoundRectClip.cs

@ -1,14 +1,15 @@
using System; using System;
using System.ComponentModel;
namespace Avalonia.VisualTree namespace Avalonia.VisualTree
{ {
[Obsolete("Internal API, will be removed in future versions, you've been warned")] [Obsolete("Internal API, will be removed in future versions, you've been warned"), EditorBrowsable(EditorBrowsableState.Never)]
public interface IVisualWithRoundRectClip public interface IVisualWithRoundRectClip
{ {
/// <summary> /// <summary>
/// Gets a value indicating the corner radius of control's clip bounds /// Gets a value indicating the corner radius of control's clip bounds
/// </summary> /// </summary>
[Obsolete("Internal API, will be removed in future versions, you've been warned")] [Obsolete("Internal API, will be removed in future versions, you've been warned"), EditorBrowsable(EditorBrowsableState.Never)]
CornerRadius ClipToBoundsRadius { get; } CornerRadius ClipToBoundsRadius { get; }
} }

4
src/Avalonia.Controls/ContextMenu.cs

@ -64,7 +64,7 @@ namespace Avalonia.Controls
/// <summary> /// <summary>
/// Defines the <see cref="PlacementMode"/> property. /// Defines the <see cref="PlacementMode"/> property.
/// </summary> /// </summary>
[Obsolete("Use the Placement property instead.")] [Obsolete("Use the Placement property instead."), EditorBrowsable(EditorBrowsableState.Never)]
public static readonly StyledProperty<PlacementMode> PlacementModeProperty = PlacementProperty; public static readonly StyledProperty<PlacementMode> PlacementModeProperty = PlacementProperty;
/// <summary> /// <summary>
@ -157,7 +157,7 @@ namespace Avalonia.Controls
} }
/// <inheritdoc cref="Placement"/> /// <inheritdoc cref="Placement"/>
[Obsolete("Use the Placement property instead.")] [Obsolete("Use the Placement property instead."), EditorBrowsable(EditorBrowsableState.Never)]
public PlacementMode PlacementMode public PlacementMode PlacementMode
{ {
get => GetValue(PlacementProperty); get => GetValue(PlacementProperty);

5
src/Avalonia.Controls/Generators/ItemContainerGenerator.cs

@ -1,4 +1,5 @@
using System; using System;
using System.ComponentModel;
namespace Avalonia.Controls.Generators namespace Avalonia.Controls.Generators
{ {
@ -131,10 +132,10 @@ namespace Avalonia.Controls.Generators
/// </remarks> /// </remarks>
public void ClearItemContainer(Control container) => _owner.ClearItemContainer(container); public void ClearItemContainer(Control container) => _owner.ClearItemContainer(container);
[Obsolete("Use ItemsControl.ContainerFromIndex")] [Obsolete("Use ItemsControl.ContainerFromIndex"), EditorBrowsable(EditorBrowsableState.Never)]
public Control? ContainerFromIndex(int index) => _owner.ContainerFromIndex(index); public Control? ContainerFromIndex(int index) => _owner.ContainerFromIndex(index);
[Obsolete("Use ItemsControl.IndexFromContainer")] [Obsolete("Use ItemsControl.IndexFromContainer"), EditorBrowsable(EditorBrowsableState.Never)]
public int IndexFromContainer(Control container) => _owner.IndexFromContainer(container); public int IndexFromContainer(Control container) => _owner.IndexFromContainer(container);
} }
} }

7
src/Avalonia.Controls/Generators/TreeItemContainerGenerator.cs

@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel;
namespace Avalonia.Controls.Generators namespace Avalonia.Controls.Generators
{ {
@ -20,13 +21,13 @@ namespace Avalonia.Controls.Generators
internal TreeContainerIndex(TreeView owner) => _owner = owner; internal TreeContainerIndex(TreeView owner) => _owner = owner;
[Obsolete("Use TreeView.GetRealizedTreeContainers")] [Obsolete("Use TreeView.GetRealizedTreeContainers"), EditorBrowsable(EditorBrowsableState.Never)]
public IEnumerable<Control> Containers => _owner.GetRealizedTreeContainers(); public IEnumerable<Control> Containers => _owner.GetRealizedTreeContainers();
[Obsolete("Use TreeView.TreeContainerFromItem")] [Obsolete("Use TreeView.TreeContainerFromItem"), EditorBrowsable(EditorBrowsableState.Never)]
public Control? ContainerFromItem(object item) => _owner.TreeContainerFromItem(item); public Control? ContainerFromItem(object item) => _owner.TreeContainerFromItem(item);
[Obsolete("Use TreeView.TreeItemFromContainer")] [Obsolete("Use TreeView.TreeItemFromContainer"), EditorBrowsable(EditorBrowsableState.Never)]
public object? ItemFromContainer(Control container) => _owner.TreeItemFromContainer(container); public object? ItemFromContainer(Control container) => _owner.TreeItemFromContainer(container);
} }
} }

3
src/Avalonia.Controls/ItemsControl.cs

@ -2,6 +2,7 @@ using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.Specialized; using System.Collections.Specialized;
using System.ComponentModel;
using Avalonia.Automation.Peers; using Avalonia.Automation.Peers;
using Avalonia.Controls.Generators; using Avalonia.Controls.Generators;
using Avalonia.Controls.Metadata; using Avalonia.Controls.Metadata;
@ -626,7 +627,7 @@ namespace Avalonia.Controls
/// TreeView to be able to create a <see cref="TreeItemContainerGenerator"/>. Can be /// TreeView to be able to create a <see cref="TreeItemContainerGenerator"/>. Can be
/// removed in 12.0. /// removed in 12.0.
/// </remarks> /// </remarks>
[Obsolete] [Obsolete, EditorBrowsable(EditorBrowsableState.Never)]
private protected virtual ItemContainerGenerator CreateItemContainerGenerator() private protected virtual ItemContainerGenerator CreateItemContainerGenerator()
{ {
return new ItemContainerGenerator(this); return new ItemContainerGenerator(this);

3
src/Avalonia.Controls/Platform/Dialogs/ISystemDialogImpl.cs

@ -1,4 +1,5 @@
using System; using System;
using System.ComponentModel;
using System.Threading.Tasks; using System.Threading.Tasks;
using Avalonia.Metadata; using Avalonia.Metadata;
@ -7,7 +8,7 @@ namespace Avalonia.Controls.Platform
/// <summary> /// <summary>
/// Defines a platform-specific system dialog implementation. /// Defines a platform-specific system dialog implementation.
/// </summary> /// </summary>
[Obsolete("Use Window.StorageProvider API or TopLevel.StorageProvider API")] [Obsolete("Use Window.StorageProvider API or TopLevel.StorageProvider API"), EditorBrowsable(EditorBrowsableState.Never)]
[Unstable] [Unstable]
public interface ISystemDialogImpl public interface ISystemDialogImpl
{ {

3
src/Avalonia.Controls/Platform/Dialogs/SystemDialogImpl.cs

@ -1,4 +1,5 @@
using System; using System;
using System.ComponentModel;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Avalonia.Platform.Storage; using Avalonia.Platform.Storage;
@ -10,7 +11,7 @@ namespace Avalonia.Controls.Platform
/// <summary> /// <summary>
/// Defines a platform-specific system dialog implementation. /// Defines a platform-specific system dialog implementation.
/// </summary> /// </summary>
[Obsolete] [Obsolete, EditorBrowsable(EditorBrowsableState.Never)]
internal class SystemDialogImpl : ISystemDialogImpl internal class SystemDialogImpl : ISystemDialogImpl
{ {
public async Task<string[]?> ShowFileDialogAsync(FileDialog dialog, Window parent) public async Task<string[]?> ShowFileDialogAsync(FileDialog dialog, Window parent)

5
src/Avalonia.Controls/Platform/Screen.cs

@ -1,4 +1,5 @@
using System; using System;
using System.ComponentModel;
namespace Avalonia.Platform namespace Avalonia.Platform
{ {
@ -17,7 +18,7 @@ namespace Avalonia.Platform
public double Scaling { get; } public double Scaling { get; }
/// <inheritdoc cref="Scaling"/> /// <inheritdoc cref="Scaling"/>
[Obsolete("Use the Scaling property instead.")] [Obsolete("Use the Scaling property instead."), EditorBrowsable(EditorBrowsableState.Never)]
public double PixelDensity => Scaling; public double PixelDensity => Scaling;
/// <summary> /// <summary>
@ -43,7 +44,7 @@ namespace Avalonia.Platform
public bool IsPrimary { get; } public bool IsPrimary { get; }
/// <inheritdoc cref="IsPrimary"/> /// <inheritdoc cref="IsPrimary"/>
[Obsolete("Use the IsPrimary property instead.")] [Obsolete("Use the IsPrimary property instead."), EditorBrowsable(EditorBrowsableState.Never)]
public bool Primary => IsPrimary; public bool Primary => IsPrimary;
/// <summary> /// <summary>

4
src/Avalonia.Controls/Primitives/Popup.cs

@ -74,7 +74,7 @@ namespace Avalonia.Controls.Primitives
/// <summary> /// <summary>
/// Defines the <see cref="PlacementMode"/> property. /// Defines the <see cref="PlacementMode"/> property.
/// </summary> /// </summary>
[Obsolete("Use the Placement property instead.")] [Obsolete("Use the Placement property instead."), EditorBrowsable(EditorBrowsableState.Never)]
public static readonly StyledProperty<PlacementMode> PlacementModeProperty = PlacementProperty; public static readonly StyledProperty<PlacementMode> PlacementModeProperty = PlacementProperty;
/// <summary> /// <summary>
@ -241,7 +241,7 @@ namespace Avalonia.Controls.Primitives
} }
/// <inheritdoc cref="Placement"/> /// <inheritdoc cref="Placement"/>
[Obsolete("Use the Placement property instead.")] [Obsolete("Use the Placement property instead."), EditorBrowsable(EditorBrowsableState.Never)]
public PlacementMode PlacementMode public PlacementMode PlacementMode
{ {
get => GetValue(PlacementProperty); get => GetValue(PlacementProperty);

19
src/Avalonia.Controls/Primitives/ToggleButton.cs

@ -1,4 +1,5 @@
using System; using System;
using System.ComponentModel;
using Avalonia.Automation.Peers; using Avalonia.Automation.Peers;
using Avalonia.Controls.Metadata; using Avalonia.Controls.Metadata;
using Avalonia.Data; using Avalonia.Data;
@ -28,7 +29,7 @@ namespace Avalonia.Controls.Primitives
/// <summary> /// <summary>
/// Defines the <see cref="Checked"/> event. /// Defines the <see cref="Checked"/> event.
/// </summary> /// </summary>
[Obsolete("Use IsCheckedChangedEvent instead.")] [Obsolete("Use IsCheckedChangedEvent instead."), EditorBrowsable(EditorBrowsableState.Never)]
public static readonly RoutedEvent<RoutedEventArgs> CheckedEvent = public static readonly RoutedEvent<RoutedEventArgs> CheckedEvent =
RoutedEvent.Register<ToggleButton, RoutedEventArgs>( RoutedEvent.Register<ToggleButton, RoutedEventArgs>(
nameof(Checked), nameof(Checked),
@ -37,7 +38,7 @@ namespace Avalonia.Controls.Primitives
/// <summary> /// <summary>
/// Defines the <see cref="Unchecked"/> event. /// Defines the <see cref="Unchecked"/> event.
/// </summary> /// </summary>
[Obsolete("Use IsCheckedChangedEvent instead.")] [Obsolete("Use IsCheckedChangedEvent instead."), EditorBrowsable(EditorBrowsableState.Never)]
public static readonly RoutedEvent<RoutedEventArgs> UncheckedEvent = public static readonly RoutedEvent<RoutedEventArgs> UncheckedEvent =
RoutedEvent.Register<ToggleButton, RoutedEventArgs>( RoutedEvent.Register<ToggleButton, RoutedEventArgs>(
nameof(Unchecked), nameof(Unchecked),
@ -46,7 +47,7 @@ namespace Avalonia.Controls.Primitives
/// <summary> /// <summary>
/// Defines the <see cref="Unchecked"/> event. /// Defines the <see cref="Unchecked"/> event.
/// </summary> /// </summary>
[Obsolete("Use IsCheckedChangedEvent instead.")] [Obsolete("Use IsCheckedChangedEvent instead."), EditorBrowsable(EditorBrowsableState.Never)]
public static readonly RoutedEvent<RoutedEventArgs> IndeterminateEvent = public static readonly RoutedEvent<RoutedEventArgs> IndeterminateEvent =
RoutedEvent.Register<ToggleButton, RoutedEventArgs>( RoutedEvent.Register<ToggleButton, RoutedEventArgs>(
nameof(Indeterminate), nameof(Indeterminate),
@ -72,7 +73,7 @@ namespace Avalonia.Controls.Primitives
/// <summary> /// <summary>
/// Raised when a <see cref="ToggleButton"/> is checked. /// Raised when a <see cref="ToggleButton"/> is checked.
/// </summary> /// </summary>
[Obsolete("Use IsCheckedChanged instead.")] [Obsolete("Use IsCheckedChanged instead."), EditorBrowsable(EditorBrowsableState.Never)]
public event EventHandler<RoutedEventArgs>? Checked public event EventHandler<RoutedEventArgs>? Checked
{ {
add => AddHandler(CheckedEvent, value); add => AddHandler(CheckedEvent, value);
@ -82,7 +83,7 @@ namespace Avalonia.Controls.Primitives
/// <summary> /// <summary>
/// Raised when a <see cref="ToggleButton"/> is unchecked. /// Raised when a <see cref="ToggleButton"/> is unchecked.
/// </summary> /// </summary>
[Obsolete("Use IsCheckedChanged instead.")] [Obsolete("Use IsCheckedChanged instead."), EditorBrowsable(EditorBrowsableState.Never)]
public event EventHandler<RoutedEventArgs>? Unchecked public event EventHandler<RoutedEventArgs>? Unchecked
{ {
add => AddHandler(UncheckedEvent, value); add => AddHandler(UncheckedEvent, value);
@ -92,7 +93,7 @@ namespace Avalonia.Controls.Primitives
/// <summary> /// <summary>
/// Raised when a <see cref="ToggleButton"/> is neither checked nor unchecked. /// Raised when a <see cref="ToggleButton"/> is neither checked nor unchecked.
/// </summary> /// </summary>
[Obsolete("Use IsCheckedChanged instead.")] [Obsolete("Use IsCheckedChanged instead."), EditorBrowsable(EditorBrowsableState.Never)]
public event EventHandler<RoutedEventArgs>? Indeterminate public event EventHandler<RoutedEventArgs>? Indeterminate
{ {
add => AddHandler(IndeterminateEvent, value); add => AddHandler(IndeterminateEvent, value);
@ -168,7 +169,7 @@ namespace Avalonia.Controls.Primitives
/// Called when <see cref="IsChecked"/> becomes true. /// Called when <see cref="IsChecked"/> becomes true.
/// </summary> /// </summary>
/// <param name="e">Event arguments for the routed event that is raised by the default implementation of this method.</param> /// <param name="e">Event arguments for the routed event that is raised by the default implementation of this method.</param>
[Obsolete("Use OnIsCheckedChanged instead.")] [Obsolete("Use OnIsCheckedChanged instead."), EditorBrowsable(EditorBrowsableState.Never)]
protected virtual void OnChecked(RoutedEventArgs e) protected virtual void OnChecked(RoutedEventArgs e)
{ {
RaiseEvent(e); RaiseEvent(e);
@ -178,7 +179,7 @@ namespace Avalonia.Controls.Primitives
/// Called when <see cref="IsChecked"/> becomes false. /// Called when <see cref="IsChecked"/> becomes false.
/// </summary> /// </summary>
/// <param name="e">Event arguments for the routed event that is raised by the default implementation of this method.</param> /// <param name="e">Event arguments for the routed event that is raised by the default implementation of this method.</param>
[Obsolete("Use OnIsCheckedChanged instead.")] [Obsolete("Use OnIsCheckedChanged instead."), EditorBrowsable(EditorBrowsableState.Never)]
protected virtual void OnUnchecked(RoutedEventArgs e) protected virtual void OnUnchecked(RoutedEventArgs e)
{ {
RaiseEvent(e); RaiseEvent(e);
@ -188,7 +189,7 @@ namespace Avalonia.Controls.Primitives
/// Called when <see cref="IsChecked"/> becomes null. /// Called when <see cref="IsChecked"/> becomes null.
/// </summary> /// </summary>
/// <param name="e">Event arguments for the routed event that is raised by the default implementation of this method.</param> /// <param name="e">Event arguments for the routed event that is raised by the default implementation of this method.</param>
[Obsolete("Use OnIsCheckedChanged instead.")] [Obsolete("Use OnIsCheckedChanged instead."), EditorBrowsable(EditorBrowsableState.Never)]
protected virtual void OnIndeterminate(RoutedEventArgs e) protected virtual void OnIndeterminate(RoutedEventArgs e)
{ {
RaiseEvent(e); RaiseEvent(e);

3
src/Avalonia.Controls/Screens.cs

@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel;
using System.Linq; using System.Linq;
using Avalonia.Platform; using Avalonia.Platform;
@ -68,7 +69,7 @@ namespace Avalonia.Controls
/// </summary> /// </summary>
/// <param name="window">The window impl for which to retrieve the Screen.</param> /// <param name="window">The window impl for which to retrieve the Screen.</param>
/// <returns>The <see cref="Screen"/>.</returns> /// <returns>The <see cref="Screen"/>.</returns>
[Obsolete("Use ScreenFromWindow(WindowBase) overload.")] [Obsolete("Use ScreenFromWindow(WindowBase) overload."), EditorBrowsable(EditorBrowsableState.Never)]
public Screen? ScreenFromWindow(IWindowBaseImpl window) public Screen? ScreenFromWindow(IWindowBaseImpl window)
{ {
return _iScreenImpl.ScreenFromWindow(window); return _iScreenImpl.ScreenFromWindow(window);

15
src/Avalonia.Controls/SystemDialog.cs

@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Avalonia.Controls.Platform; using Avalonia.Controls.Platform;
@ -11,7 +12,7 @@ namespace Avalonia.Controls
/// <summary> /// <summary>
/// Base class for system file dialogs. /// Base class for system file dialogs.
/// </summary> /// </summary>
[Obsolete("Use Window.StorageProvider API or TopLevel.StorageProvider API")] [Obsolete("Use Window.StorageProvider API or TopLevel.StorageProvider API"), EditorBrowsable(EditorBrowsableState.Never)]
public abstract class FileDialog : FileSystemDialog public abstract class FileDialog : FileSystemDialog
{ {
/// <summary> /// <summary>
@ -29,7 +30,7 @@ namespace Avalonia.Controls
/// <summary> /// <summary>
/// Base class for system file and directory dialogs. /// Base class for system file and directory dialogs.
/// </summary> /// </summary>
[Obsolete("Use Window.StorageProvider API or TopLevel.StorageProvider API")] [Obsolete("Use Window.StorageProvider API or TopLevel.StorageProvider API"), EditorBrowsable(EditorBrowsableState.Never)]
public abstract class FileSystemDialog : SystemDialog public abstract class FileSystemDialog : SystemDialog
{ {
/// <summary> /// <summary>
@ -42,7 +43,7 @@ namespace Avalonia.Controls
/// <summary> /// <summary>
/// Represents a system dialog that prompts the user to select a location for saving a file. /// Represents a system dialog that prompts the user to select a location for saving a file.
/// </summary> /// </summary>
[Obsolete("Use Window.StorageProvider API or TopLevel.StorageProvider API")] [Obsolete("Use Window.StorageProvider API or TopLevel.StorageProvider API"), EditorBrowsable(EditorBrowsableState.Never)]
public class SaveFileDialog : FileDialog public class SaveFileDialog : FileDialog
{ {
/// <summary> /// <summary>
@ -91,7 +92,7 @@ namespace Avalonia.Controls
/// <summary> /// <summary>
/// Represents a system dialog that allows the user to select one or more files to open. /// Represents a system dialog that allows the user to select one or more files to open.
/// </summary> /// </summary>
[Obsolete("Use Window.StorageProvider API or TopLevel.StorageProvider API")] [Obsolete("Use Window.StorageProvider API or TopLevel.StorageProvider API"), EditorBrowsable(EditorBrowsableState.Never)]
public class OpenFileDialog : FileDialog public class OpenFileDialog : FileDialog
{ {
/// <summary> /// <summary>
@ -132,7 +133,7 @@ namespace Avalonia.Controls
/// <summary> /// <summary>
/// Represents a system dialog that allows the user to select a directory. /// Represents a system dialog that allows the user to select a directory.
/// </summary> /// </summary>
[Obsolete("Use Window.StorageProvider API or TopLevel.StorageProvider API")] [Obsolete("Use Window.StorageProvider API or TopLevel.StorageProvider API"), EditorBrowsable(EditorBrowsableState.Never)]
public class OpenFolderDialog : FileSystemDialog public class OpenFolderDialog : FileSystemDialog
{ {
/// <summary> /// <summary>
@ -167,7 +168,7 @@ namespace Avalonia.Controls
/// <summary> /// <summary>
/// Base class for system dialogs. /// Base class for system dialogs.
/// </summary> /// </summary>
[Obsolete("Use Window.StorageProvider API or TopLevel.StorageProvider API")] [Obsolete("Use Window.StorageProvider API or TopLevel.StorageProvider API"), EditorBrowsable(EditorBrowsableState.Never)]
public abstract class SystemDialog public abstract class SystemDialog
{ {
static SystemDialog() static SystemDialog()
@ -188,7 +189,7 @@ namespace Avalonia.Controls
/// <summary> /// <summary>
/// Represents a filter in an <see cref="OpenFileDialog"/> or an <see cref="SaveFileDialog"/>. /// Represents a filter in an <see cref="OpenFileDialog"/> or an <see cref="SaveFileDialog"/>.
/// </summary> /// </summary>
[Obsolete("Use Window.StorageProvider API or TopLevel.StorageProvider API")] [Obsolete("Use Window.StorageProvider API or TopLevel.StorageProvider API"), EditorBrowsable(EditorBrowsableState.Never)]
public class FileDialogFilter public class FileDialogFilter
{ {
/// <summary> /// <summary>

3
src/Avalonia.Controls/TreeView.cs

@ -3,6 +3,7 @@ using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.Specialized; using System.Collections.Specialized;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using System.Linq; using System.Linq;
using Avalonia.Collections; using Avalonia.Collections;
@ -715,7 +716,7 @@ namespace Avalonia.Controls
} }
} }
[Obsolete] [Obsolete, EditorBrowsable(EditorBrowsableState.Never)]
private protected override ItemContainerGenerator CreateItemContainerGenerator() private protected override ItemContainerGenerator CreateItemContainerGenerator()
{ {
return new TreeItemContainerGenerator(this); return new TreeItemContainerGenerator(this);

5
src/Avalonia.Dialogs/ManagedFileDialogExtensions.cs

@ -1,6 +1,7 @@
#nullable enable #nullable enable
using System; using System;
using System.ComponentModel;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Avalonia.Controls; using Avalonia.Controls;
@ -39,11 +40,11 @@ namespace Avalonia.Dialogs
return builder; return builder;
} }
[Obsolete("Use Window.StorageProvider API or TopLevel.StorageProvider API")] [Obsolete("Use Window.StorageProvider API or TopLevel.StorageProvider API"), EditorBrowsable(EditorBrowsableState.Never)]
public static Task<string[]> ShowManagedAsync(this OpenFileDialog dialog, Window parent, public static Task<string[]> ShowManagedAsync(this OpenFileDialog dialog, Window parent,
ManagedFileDialogOptions? options = null) => ShowManagedAsync<Window>(dialog, parent, options); ManagedFileDialogOptions? options = null) => ShowManagedAsync<Window>(dialog, parent, options);
[Obsolete("Use Window.StorageProvider API or TopLevel.StorageProvider API")] [Obsolete("Use Window.StorageProvider API or TopLevel.StorageProvider API"), EditorBrowsable(EditorBrowsableState.Never)]
public static async Task<string[]> ShowManagedAsync<TWindow>(this OpenFileDialog dialog, Window parent, public static async Task<string[]> ShowManagedAsync<TWindow>(this OpenFileDialog dialog, Window parent,
ManagedFileDialogOptions? options = null) where TWindow : Window, new() ManagedFileDialogOptions? options = null) where TWindow : Window, new()
{ {

4
src/Avalonia.OpenGL/Controls/OpenGlControlBase.cs

@ -8,6 +8,8 @@ using Avalonia.Rendering;
using Avalonia.Rendering.Composition; using Avalonia.Rendering.Composition;
using Avalonia.VisualTree; using Avalonia.VisualTree;
using Avalonia.Platform; using Avalonia.Platform;
using System.ComponentModel;
namespace Avalonia.OpenGL.Controls namespace Avalonia.OpenGL.Controls
{ {
public abstract class OpenGlControlBase : Control public abstract class OpenGlControlBase : Control
@ -217,7 +219,7 @@ namespace Avalonia.OpenGL.Controls
return true; return true;
} }
[Obsolete("Use RequestNextFrameRendering()")] [Obsolete("Use RequestNextFrameRendering()"), EditorBrowsable(EditorBrowsableState.Never)]
// ReSharper disable once MemberCanBeProtected.Global // ReSharper disable once MemberCanBeProtected.Global
public new void InvalidateVisual() => RequestNextFrameRendering(); public new void InvalidateVisual() => RequestNextFrameRendering();

Loading…
Cancel
Save