Skip to content

Commit

Permalink
Merge pull request #6808 from workgroupengineering/fixes/Warning_CS0067
Browse files Browse the repository at this point in the history
fix: Warning CS0067 The event is never used
  • Loading branch information
grokys authored Nov 19, 2021
2 parents 577ab25 + 07ab7f3 commit ba8dcbe
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ public void Signal(DispatcherPriority prio)

public bool CurrentThreadIsLoopThread => TlsCurrentThreadIsLoopThread;
public event Action<DispatcherPriority?> Signaled;
#pragma warning disable CS0067
public event Action<TimeSpan> Tick;
#pragma warning restore CS0067

}
}
2 changes: 1 addition & 1 deletion src/Avalonia.Controls/TextBoxTextInputMethodClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ internal class TextBoxTextInputMethodClient : ITextInputMethodClient

public bool SupportsSurroundingText => false;
public TextInputMethodSurroundingText SurroundingText => throw new NotSupportedException();
public event EventHandler SurroundingTextChanged;
public event EventHandler SurroundingTextChanged { add { } remove { } }
public string TextBeforeCursor => null;
public string TextAfterCursor => null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public event Action<IAvaloniaRemoteTransportConnection, object> OnMessage
remove { _onMessage -= value; }
}

public event Action<IAvaloniaRemoteTransportConnection, Exception> OnException;
public event Action<IAvaloniaRemoteTransportConnection, Exception> OnException { add { } remove { } }
public void Start()
{
UpdaterThread();
Expand Down
6 changes: 3 additions & 3 deletions src/Avalonia.FreeDesktop/DBusMenuExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -413,10 +413,10 @@ public async Task<bool> AboutToShowAsync(int Id)
#region Events

private event Action<((int, IDictionary<string, object>)[] updatedProps, (int, string[])[] removedProps)>
ItemsPropertiesUpdated;
ItemsPropertiesUpdated { add { } remove { } }
private event Action<(uint revision, int parent)> LayoutUpdated;
private event Action<(int id, uint timestamp)> ItemActivationRequested;
private event Action<PropertyChanges> PropertiesChanged;
private event Action<(int id, uint timestamp)> ItemActivationRequested { add { } remove { } }
private event Action<PropertyChanges> PropertiesChanged { add { } remove { } }

async Task<IDisposable> IDBusMenu.WatchItemsPropertiesUpdatedAsync(Action<((int, IDictionary<string, object>)[] updatedProps, (int, string[])[] removedProps)> handler, Action<Exception> onError)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Avalonia.Native/AvaloniaNativeMenuExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public AvaloniaNativeMenuExporter(IAvnTrayIcon trayIcon, IAvaloniaNativeFactory

public bool IsNativeMenuExported => _exported;

public event EventHandler OnIsNativeMenuExportedChanged;
public event EventHandler OnIsNativeMenuExportedChanged { add { } remove { } }

public void SetNativeMenu(NativeMenu menu)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Avalonia.X11/X11Window.Xim.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ public void Dispose()
public ValueTask<bool> HandleEventAsync(RawKeyEventArgs args, int keyVal, int keyCode) =>
new ValueTask<bool>(false);

public event Action<string> Commit;
public event Action<X11InputMethodForwardedKey> ForwardKey;
public event Action<string> Commit { add { } remove { } }
public event Action<X11InputMethodForwardedKey> ForwardKey { add { } remove { } }

}

Expand Down
2 changes: 1 addition & 1 deletion tests/Avalonia.Controls.UnitTests/ItemsSourceViewTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void Cannot_Create_ItemsSourceView_With_Collection_That_Implements_INCC_B

private class InvalidCollection : INotifyCollectionChanged, IEnumerable<string>
{
public event NotifyCollectionChangedEventHandler CollectionChanged;
public event NotifyCollectionChangedEventHandler CollectionChanged { add { } remove { } }

public IEnumerator<string> GetEnumerator()
{
Expand Down

0 comments on commit ba8dcbe

Please sign in to comment.