committed by
GitHub
80 changed files with 1231 additions and 1441 deletions
@ -0,0 +1,31 @@ |
|||
--- |
|||
name: Bug report |
|||
about: Create a report to help us improve |
|||
title: '' |
|||
labels: '' |
|||
assignees: '' |
|||
|
|||
--- |
|||
|
|||
**Describe the bug** |
|||
A clear and concise description of what the bug is. |
|||
|
|||
**To Reproduce** |
|||
Steps to reproduce the behavior: |
|||
1. Go to '...' |
|||
2. Click on '....' |
|||
3. Scroll down to '....' |
|||
4. See error |
|||
|
|||
**Expected behavior** |
|||
A clear and concise description of what you expected to happen. |
|||
|
|||
**Screenshots** |
|||
If applicable, add screenshots to help explain your problem. |
|||
|
|||
**Desktop (please complete the following information):** |
|||
- OS: [e.g. Windows, Mac, Linux (State distribution)] |
|||
- Version [e.g. 0.10.0-rc1 or 0.9.12] |
|||
|
|||
**Additional context** |
|||
Add any other context about the problem here. |
|||
@ -0,0 +1,20 @@ |
|||
--- |
|||
name: Feature request |
|||
about: Suggest an idea for this project |
|||
title: '' |
|||
labels: '' |
|||
assignees: '' |
|||
|
|||
--- |
|||
|
|||
**Is your feature request related to a problem? Please describe.** |
|||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] |
|||
|
|||
**Describe the solution you'd like** |
|||
A clear and concise description of what you want to happen. |
|||
|
|||
**Describe alternatives you've considered** |
|||
A clear and concise description of any alternative solutions or features you've considered. |
|||
|
|||
**Additional context** |
|||
Add any other context or screenshots about the feature request here. |
|||
File diff suppressed because it is too large
@ -1,9 +1,14 @@ |
|||
#ifndef keytransform_h |
|||
#define keytransform_h |
|||
#include "common.h" |
|||
#include "key.h" |
|||
#include <map> |
|||
|
|||
extern std::map<int, AvnKey> s_KeyMap; |
|||
|
|||
extern std::map<AvnKey, int> s_AvnKeyMap; |
|||
|
|||
extern std::map<int, const char*> s_QwertyKeyMap; |
|||
|
|||
extern std::map<AvnKey, int> s_UnicodeKeyMap; |
|||
|
|||
#endif |
|||
|
|||
@ -1,4 +0,0 @@ |
|||
Compat issues with assembly Avalonia.Base: |
|||
CannotAddAbstractMembers : Member 'protected System.IObservable<Avalonia.AvaloniaPropertyChangedEventArgs> Avalonia.AvaloniaProperty.GetChanged()' is abstract in the implementation but is missing in the contract. |
|||
TypesMustExist : Type 'Avalonia.Logging.DebugLogSink' does not exist in the implementation but it does exist in the contract. |
|||
Total Issues: 2 |
|||
@ -0,0 +1,14 @@ |
|||
using System; |
|||
|
|||
namespace Avalonia.Utilities |
|||
{ |
|||
public class NonPumpingLockHelper |
|||
{ |
|||
public interface IHelperImpl |
|||
{ |
|||
IDisposable Use(); |
|||
} |
|||
|
|||
public static IDisposable Use() => AvaloniaLocator.Current.GetService<IHelperImpl>()?.Use(); |
|||
} |
|||
} |
|||
@ -1,5 +0,0 @@ |
|||
Compat issues with assembly Avalonia.Controls.DataGrid: |
|||
MembersMustExist : Member 'public Avalonia.StyledProperty<System.String> Avalonia.StyledProperty<System.String> Avalonia.Controls.DataGridTextColumn.FontFamilyProperty' does not exist in the implementation but it does exist in the contract. |
|||
MembersMustExist : Member 'public System.String Avalonia.Controls.DataGridTextColumn.FontFamily.get()' does not exist in the implementation but it does exist in the contract. |
|||
MembersMustExist : Member 'public void Avalonia.Controls.DataGridTextColumn.FontFamily.set(System.String)' does not exist in the implementation but it does exist in the contract. |
|||
Total Issues: 3 |
|||
@ -1,26 +0,0 @@ |
|||
Compat issues with assembly Avalonia.Controls: |
|||
TypesMustExist : Type 'Avalonia.Controls.IndexPath' does not exist in the implementation but it does exist in the contract. |
|||
TypesMustExist : Type 'Avalonia.Controls.ISelectedItemInfo' does not exist in the implementation but it does exist in the contract. |
|||
TypesMustExist : Type 'Avalonia.Controls.ISelectionModel' does not exist in the implementation but it does exist in the contract. |
|||
MembersMustExist : Member 'public Avalonia.DirectProperty<Avalonia.Controls.Primitives.SelectingItemsControl, Avalonia.Controls.ISelectionModel> Avalonia.DirectProperty<Avalonia.Controls.Primitives.SelectingItemsControl, Avalonia.Controls.ISelectionModel> Avalonia.Controls.ListBox.SelectionProperty' does not exist in the implementation but it does exist in the contract. |
|||
MembersMustExist : Member 'public Avalonia.Controls.ISelectionModel Avalonia.Controls.ListBox.Selection.get()' does not exist in the implementation but it does exist in the contract. |
|||
MembersMustExist : Member 'public void Avalonia.Controls.ListBox.Selection.set(Avalonia.Controls.ISelectionModel)' does not exist in the implementation but it does exist in the contract. |
|||
TypesMustExist : Type 'Avalonia.Controls.SelectionModel' does not exist in the implementation but it does exist in the contract. |
|||
TypesMustExist : Type 'Avalonia.Controls.SelectionModelChildrenRequestedEventArgs' does not exist in the implementation but it does exist in the contract. |
|||
TypesMustExist : Type 'Avalonia.Controls.SelectionModelSelectionChangedEventArgs' does not exist in the implementation but it does exist in the contract. |
|||
MembersMustExist : Member 'public Avalonia.StyledProperty<Avalonia.Controls.IControl> Avalonia.StyledProperty<Avalonia.Controls.IControl> Avalonia.Controls.SplitView.ContentProperty' does not exist in the implementation but it does exist in the contract. |
|||
MembersMustExist : Member 'public Avalonia.StyledProperty<Avalonia.Controls.IControl> Avalonia.StyledProperty<Avalonia.Controls.IControl> Avalonia.Controls.SplitView.PaneProperty' does not exist in the implementation but it does exist in the contract. |
|||
MembersMustExist : Member 'public Avalonia.Controls.IControl Avalonia.Controls.SplitView.Content.get()' does not exist in the implementation but it does exist in the contract. |
|||
MembersMustExist : Member 'public void Avalonia.Controls.SplitView.Content.set(Avalonia.Controls.IControl)' does not exist in the implementation but it does exist in the contract. |
|||
MembersMustExist : Member 'public Avalonia.Controls.IControl Avalonia.Controls.SplitView.Pane.get()' does not exist in the implementation but it does exist in the contract. |
|||
MembersMustExist : Member 'public void Avalonia.Controls.SplitView.Pane.set(Avalonia.Controls.IControl)' does not exist in the implementation but it does exist in the contract. |
|||
MembersMustExist : Member 'public Avalonia.DirectProperty<Avalonia.Controls.TreeView, Avalonia.Controls.ISelectionModel> Avalonia.DirectProperty<Avalonia.Controls.TreeView, Avalonia.Controls.ISelectionModel> Avalonia.Controls.TreeView.SelectionProperty' does not exist in the implementation but it does exist in the contract. |
|||
MembersMustExist : Member 'public Avalonia.Interactivity.RoutedEvent<Avalonia.Controls.SelectionChangedEventArgs> Avalonia.Interactivity.RoutedEvent<Avalonia.Controls.SelectionChangedEventArgs> Avalonia.Controls.TreeView.SelectionChangedEvent' does not exist in the implementation but it does exist in the contract. |
|||
MembersMustExist : Member 'public Avalonia.Controls.ISelectionModel Avalonia.Controls.TreeView.Selection.get()' does not exist in the implementation but it does exist in the contract. |
|||
MembersMustExist : Member 'public void Avalonia.Controls.TreeView.Selection.set(Avalonia.Controls.ISelectionModel)' does not exist in the implementation but it does exist in the contract. |
|||
InterfacesShouldHaveSameMembers : Interface member 'public System.String[] Avalonia.Controls.ApplicationLifetimes.IClassicDesktopStyleApplicationLifetime.Args' is present in the implementation but not in the contract. |
|||
InterfacesShouldHaveSameMembers : Interface member 'public System.String[] Avalonia.Controls.ApplicationLifetimes.IClassicDesktopStyleApplicationLifetime.Args.get()' is present in the implementation but not in the contract. |
|||
MembersMustExist : Member 'public Avalonia.DirectProperty<Avalonia.Controls.Primitives.SelectingItemsControl, Avalonia.Controls.ISelectionModel> Avalonia.DirectProperty<Avalonia.Controls.Primitives.SelectingItemsControl, Avalonia.Controls.ISelectionModel> Avalonia.Controls.Primitives.SelectingItemsControl.SelectionProperty' does not exist in the implementation but it does exist in the contract. |
|||
MembersMustExist : Member 'protected Avalonia.Controls.ISelectionModel Avalonia.Controls.Primitives.SelectingItemsControl.Selection.get()' does not exist in the implementation but it does exist in the contract. |
|||
MembersMustExist : Member 'protected void Avalonia.Controls.Primitives.SelectingItemsControl.Selection.set(Avalonia.Controls.ISelectionModel)' does not exist in the implementation but it does exist in the contract. |
|||
Total Issues: 24 |
|||
@ -1 +0,0 @@ |
|||
Total Issues: 0 |
|||
@ -1,4 +0,0 @@ |
|||
Compat issues with assembly Avalonia.Input: |
|||
InterfacesShouldHaveSameMembers : Interface member 'public System.Boolean Avalonia.Input.IInputElement.IsKeyboardFocusWithin' is present in the implementation but not in the contract. |
|||
InterfacesShouldHaveSameMembers : Interface member 'public System.Boolean Avalonia.Input.IInputElement.IsKeyboardFocusWithin.get()' is present in the implementation but not in the contract. |
|||
Total Issues: 2 |
|||
@ -0,0 +1,36 @@ |
|||
using System.Windows.Input; |
|||
|
|||
namespace Avalonia.Input |
|||
{ |
|||
///<summary>
|
|||
/// An interface for classes that know how to invoke a Command.
|
|||
///</summary>
|
|||
public interface ICommandSource |
|||
{ |
|||
/// <summary>
|
|||
/// The command that will be executed when the class is "invoked."
|
|||
/// Classes that implement this interface should enable or disable based on the command's CanExecute return value.
|
|||
/// The property may be implemented as read-write if desired.
|
|||
/// </summary>
|
|||
ICommand Command { get; } |
|||
|
|||
/// <summary>
|
|||
/// The parameter that will be passed to the command when executing the command.
|
|||
/// The property may be implemented as read-write if desired.
|
|||
/// </summary>
|
|||
object CommandParameter { get; } |
|||
|
|||
|
|||
/// <summary>
|
|||
/// Bor the bheavior CanExecuteChanged
|
|||
/// </summary>
|
|||
/// <param name="sender"></param>
|
|||
/// <param name="e"></param>
|
|||
void CanExecuteChanged(object sender, System.EventArgs e); |
|||
|
|||
/// <summary>
|
|||
/// Gets a value indicating whether this control and all its parents are enabled.
|
|||
/// </summary>
|
|||
bool IsEffectivelyEnabled { get; } |
|||
} |
|||
} |
|||
@ -1,152 +0,0 @@ |
|||
using System.Collections.Generic; |
|||
using Avalonia.Input; |
|||
|
|||
namespace Avalonia.Native.Interop |
|||
{ |
|||
internal static class OsxUnicodeKeys |
|||
{ |
|||
enum OsxUnicodeSpecialKey |
|||
{ |
|||
NSUpArrowFunctionKey = 0xF700, |
|||
NSDownArrowFunctionKey = 0xF701, |
|||
NSLeftArrowFunctionKey = 0xF702, |
|||
NSRightArrowFunctionKey = 0xF703, |
|||
NSF1FunctionKey = 0xF704, |
|||
NSF2FunctionKey = 0xF705, |
|||
NSF3FunctionKey = 0xF706, |
|||
NSF4FunctionKey = 0xF707, |
|||
NSF5FunctionKey = 0xF708, |
|||
NSF6FunctionKey = 0xF709, |
|||
NSF7FunctionKey = 0xF70A, |
|||
NSF8FunctionKey = 0xF70B, |
|||
NSF9FunctionKey = 0xF70C, |
|||
NSF10FunctionKey = 0xF70D, |
|||
NSF11FunctionKey = 0xF70E, |
|||
NSF12FunctionKey = 0xF70F, |
|||
NSF13FunctionKey = 0xF710, |
|||
NSF14FunctionKey = 0xF711, |
|||
NSF15FunctionKey = 0xF712, |
|||
NSF16FunctionKey = 0xF713, |
|||
NSF17FunctionKey = 0xF714, |
|||
NSF18FunctionKey = 0xF715, |
|||
NSF19FunctionKey = 0xF716, |
|||
NSF20FunctionKey = 0xF717, |
|||
NSF21FunctionKey = 0xF718, |
|||
NSF22FunctionKey = 0xF719, |
|||
NSF23FunctionKey = 0xF71A, |
|||
NSF24FunctionKey = 0xF71B, |
|||
NSF25FunctionKey = 0xF71C, |
|||
NSF26FunctionKey = 0xF71D, |
|||
NSF27FunctionKey = 0xF71E, |
|||
NSF28FunctionKey = 0xF71F, |
|||
NSF29FunctionKey = 0xF720, |
|||
NSF30FunctionKey = 0xF721, |
|||
NSF31FunctionKey = 0xF722, |
|||
NSF32FunctionKey = 0xF723, |
|||
NSF33FunctionKey = 0xF724, |
|||
NSF34FunctionKey = 0xF725, |
|||
NSF35FunctionKey = 0xF726, |
|||
NSInsertFunctionKey = 0xF727, |
|||
NSDeleteFunctionKey = 0xF728, |
|||
NSHomeFunctionKey = 0xF729, |
|||
NSBeginFunctionKey = 0xF72A, |
|||
NSEndFunctionKey = 0xF72B, |
|||
NSPageUpFunctionKey = 0xF72C, |
|||
NSPageDownFunctionKey = 0xF72D, |
|||
NSPrintScreenFunctionKey = 0xF72E, |
|||
NSScrollLockFunctionKey = 0xF72F, |
|||
NSPauseFunctionKey = 0xF730, |
|||
NSSysReqFunctionKey = 0xF731, |
|||
NSBreakFunctionKey = 0xF732, |
|||
NSResetFunctionKey = 0xF733, |
|||
NSStopFunctionKey = 0xF734, |
|||
NSMenuFunctionKey = 0xF735, |
|||
NSUserFunctionKey = 0xF736, |
|||
NSSystemFunctionKey = 0xF737, |
|||
NSPrintFunctionKey = 0xF738, |
|||
NSClearLineFunctionKey = 0xF739, |
|||
NSClearDisplayFunctionKey = 0xF73A, |
|||
NSInsertLineFunctionKey = 0xF73B, |
|||
NSDeleteLineFunctionKey = 0xF73C, |
|||
NSInsertCharFunctionKey = 0xF73D, |
|||
NSDeleteCharFunctionKey = 0xF73E, |
|||
NSPrevFunctionKey = 0xF73F, |
|||
NSNextFunctionKey = 0xF740, |
|||
NSSelectFunctionKey = 0xF741, |
|||
NSExecuteFunctionKey = 0xF742, |
|||
NSUndoFunctionKey = 0xF743, |
|||
NSRedoFunctionKey = 0xF744, |
|||
NSFindFunctionKey = 0xF745, |
|||
NSHelpFunctionKey = 0xF746, |
|||
NSModeSwitchFunctionKey = 0xF747 |
|||
} |
|||
|
|||
private static Dictionary<Key, OsxUnicodeSpecialKey> s_osxKeys = new Dictionary<Key, OsxUnicodeSpecialKey> |
|||
{ |
|||
{Key.Up, OsxUnicodeSpecialKey.NSUpArrowFunctionKey }, |
|||
{Key.Down, OsxUnicodeSpecialKey.NSDownArrowFunctionKey }, |
|||
{Key.Left, OsxUnicodeSpecialKey.NSLeftArrowFunctionKey }, |
|||
{Key.Right, OsxUnicodeSpecialKey.NSRightArrowFunctionKey }, |
|||
{ Key.F1, OsxUnicodeSpecialKey.NSF1FunctionKey }, |
|||
{ Key.F2, OsxUnicodeSpecialKey.NSF2FunctionKey }, |
|||
{ Key.F3, OsxUnicodeSpecialKey.NSF3FunctionKey }, |
|||
{ Key.F4, OsxUnicodeSpecialKey.NSF4FunctionKey }, |
|||
{ Key.F5, OsxUnicodeSpecialKey.NSF5FunctionKey }, |
|||
{ Key.F6, OsxUnicodeSpecialKey.NSF6FunctionKey }, |
|||
{ Key.F7, OsxUnicodeSpecialKey.NSF7FunctionKey }, |
|||
{ Key.F8, OsxUnicodeSpecialKey.NSF8FunctionKey }, |
|||
{ Key.F9, OsxUnicodeSpecialKey.NSF9FunctionKey }, |
|||
{ Key.F10, OsxUnicodeSpecialKey.NSF10FunctionKey }, |
|||
{ Key.F11, OsxUnicodeSpecialKey.NSF11FunctionKey }, |
|||
{ Key.F12, OsxUnicodeSpecialKey.NSF12FunctionKey }, |
|||
{ Key.F13, OsxUnicodeSpecialKey.NSF13FunctionKey }, |
|||
{ Key.F14, OsxUnicodeSpecialKey.NSF14FunctionKey }, |
|||
{ Key.F15, OsxUnicodeSpecialKey.NSF15FunctionKey }, |
|||
{ Key.F16, OsxUnicodeSpecialKey.NSF16FunctionKey }, |
|||
{ Key.F17, OsxUnicodeSpecialKey.NSF17FunctionKey }, |
|||
{ Key.F18, OsxUnicodeSpecialKey.NSF18FunctionKey }, |
|||
{ Key.F19, OsxUnicodeSpecialKey.NSF19FunctionKey }, |
|||
{ Key.F20, OsxUnicodeSpecialKey.NSF20FunctionKey }, |
|||
{ Key.F21, OsxUnicodeSpecialKey.NSF21FunctionKey }, |
|||
{ Key.F22, OsxUnicodeSpecialKey.NSF22FunctionKey }, |
|||
{ Key.F23, OsxUnicodeSpecialKey.NSF23FunctionKey }, |
|||
{ Key.F24, OsxUnicodeSpecialKey.NSF24FunctionKey }, |
|||
{ Key.Insert, OsxUnicodeSpecialKey.NSInsertFunctionKey }, |
|||
{ Key.Delete, OsxUnicodeSpecialKey.NSDeleteFunctionKey }, |
|||
{ Key.Home, OsxUnicodeSpecialKey.NSHomeFunctionKey }, |
|||
//{ Key.Begin, OsxUnicodeSpecialKey.NSBeginFunctionKey },
|
|||
{ Key.End, OsxUnicodeSpecialKey.NSEndFunctionKey }, |
|||
{ Key.PageUp, OsxUnicodeSpecialKey.NSPageUpFunctionKey }, |
|||
{ Key.PageDown, OsxUnicodeSpecialKey.NSPageDownFunctionKey }, |
|||
{ Key.PrintScreen, OsxUnicodeSpecialKey.NSPrintScreenFunctionKey }, |
|||
{ Key.Scroll, OsxUnicodeSpecialKey.NSScrollLockFunctionKey }, |
|||
//{ Key.SysReq, OsxUnicodeSpecialKey.NSSysReqFunctionKey },
|
|||
//{ Key.Break, OsxUnicodeSpecialKey.NSBreakFunctionKey },
|
|||
//{ Key.Reset, OsxUnicodeSpecialKey.NSResetFunctionKey },
|
|||
//{ Key.Stop, OsxUnicodeSpecialKey.NSStopFunctionKey },
|
|||
//{ Key.Menu, OsxUnicodeSpecialKey.NSMenuFunctionKey },
|
|||
//{ Key.UserFunction, OsxUnicodeSpecialKey.NSUserFunctionKey },
|
|||
//{ Key.SystemFunction, OsxUnicodeSpecialKey.NSSystemFunctionKey },
|
|||
{ Key.Print, OsxUnicodeSpecialKey.NSPrintFunctionKey }, |
|||
//{ Key.ClearLine, OsxUnicodeSpecialKey.NSClearLineFunctionKey },
|
|||
//{ Key.ClearDisplay, OsxUnicodeSpecialKey.NSClearDisplayFunctionKey },
|
|||
}; |
|||
|
|||
public static string ConvertOSXSpecialKeyCodes(Key key) |
|||
{ |
|||
if (s_osxKeys.ContainsKey(key)) |
|||
{ |
|||
return ((char)s_osxKeys[key]).ToString(); |
|||
} |
|||
else |
|||
{ |
|||
if (key >= Key.D0 && key <= Key.D9) |
|||
{ |
|||
return key.ToString().Replace("D", ""); |
|||
} |
|||
|
|||
return key.ToString().ToLower(); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -1,3 +0,0 @@ |
|||
Compat issues with assembly Avalonia.Styling: |
|||
MembersMustExist : Member 'public System.IObservable<System.Object> Avalonia.Controls.ResourceNodeExtensions.GetResourceObservable(Avalonia.IStyledElement, System.Object, System.Func<System.Object, System.Object>)' does not exist in the implementation but it does exist in the contract. |
|||
Total Issues: 1 |
|||
@ -1,4 +0,0 @@ |
|||
Compat issues with assembly Avalonia.Themes.Fluent: |
|||
CannotRemoveBaseTypeOrInterface : Type 'Avalonia.Themes.Fluent.FluentTheme' does not inherit from base type 'Avalonia.Styling.Styles' in the implementation but it does in the contract. |
|||
MembersMustExist : Member 'public void Avalonia.Themes.Fluent.FluentTheme..ctor()' does not exist in the implementation but it does exist in the contract. |
|||
Total Issues: 2 |
|||
@ -1,5 +0,0 @@ |
|||
Compat issues with assembly Avalonia.Visuals: |
|||
MembersMustExist : Member 'public Avalonia.StyledProperty<System.Collections.Generic.IReadOnlyList<System.Double>> Avalonia.StyledProperty<System.Collections.Generic.IReadOnlyList<System.Double>> Avalonia.Media.DashStyle.DashesProperty' does not exist in the implementation but it does exist in the contract. |
|||
MembersMustExist : Member 'public System.Collections.Generic.IReadOnlyList<System.Double> Avalonia.Media.DashStyle.Dashes.get()' does not exist in the implementation but it does exist in the contract. |
|||
MembersMustExist : Member 'public void Avalonia.Media.DashStyle.Dashes.set(System.Collections.Generic.IReadOnlyList<System.Double>)' does not exist in the implementation but it does exist in the contract. |
|||
Total Issues: 3 |
|||
@ -1,4 +0,0 @@ |
|||
Compat issues with assembly Avalonia.Markup.Xaml: |
|||
MembersMustExist : Member 'public Avalonia.Data.Binding Avalonia.Markup.Xaml.Templates.TreeDataTemplate.ItemsSource.get()' does not exist in the implementation but it does exist in the contract. |
|||
MembersMustExist : Member 'public void Avalonia.Markup.Xaml.Templates.TreeDataTemplate.ItemsSource.set(Avalonia.Data.Binding)' does not exist in the implementation but it does exist in the contract. |
|||
Total Issues: 2 |
|||
@ -0,0 +1,52 @@ |
|||
using System; |
|||
using System.Runtime.ConstrainedExecution; |
|||
using System.Threading; |
|||
using Avalonia.Threading; |
|||
using Avalonia.Utilities; |
|||
using Avalonia.Win32.Interop; |
|||
|
|||
namespace Avalonia.Win32 |
|||
{ |
|||
internal class NonPumpingSyncContext : SynchronizationContext, IDisposable |
|||
{ |
|||
private readonly SynchronizationContext _inner; |
|||
|
|||
private NonPumpingSyncContext(SynchronizationContext inner) |
|||
{ |
|||
_inner = inner; |
|||
SetWaitNotificationRequired(); |
|||
SetSynchronizationContext(this); |
|||
} |
|||
|
|||
public override void Post(SendOrPostCallback d, object state) => _inner.Post(d, state); |
|||
public override void Send(SendOrPostCallback d, object state) => _inner.Send(d, state); |
|||
|
|||
[PrePrepareMethod] |
|||
public override int Wait(IntPtr[] waitHandles, bool waitAll, int millisecondsTimeout) |
|||
{ |
|||
return UnmanagedMethods.WaitForMultipleObjectsEx(waitHandles.Length, waitHandles, waitAll, |
|||
millisecondsTimeout, false); |
|||
} |
|||
|
|||
public void Dispose() => SetSynchronizationContext(_inner); |
|||
|
|||
public static IDisposable Use() |
|||
{ |
|||
var current = Current; |
|||
if (current == null) |
|||
{ |
|||
if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) |
|||
return null; |
|||
} |
|||
if (current is NonPumpingSyncContext) |
|||
return null; |
|||
|
|||
return new NonPumpingSyncContext(current); |
|||
} |
|||
|
|||
internal class HelperImpl : NonPumpingLockHelper.IHelperImpl |
|||
{ |
|||
IDisposable NonPumpingLockHelper.IHelperImpl.Use() => NonPumpingSyncContext.Use(); |
|||
} |
|||
} |
|||
} |
|||
@ -1,15 +0,0 @@ |
|||
using System; |
|||
using Avalonia.Threading; |
|||
using Avalonia.Win32.Interop; |
|||
|
|||
namespace Avalonia.Win32 |
|||
{ |
|||
internal class NonPumpingWaitProvider : AvaloniaSynchronizationContext.INonPumpingPlatformWaitProvider |
|||
{ |
|||
public int Wait(IntPtr[] waitHandles, bool waitAll, int millisecondsTimeout) |
|||
{ |
|||
return UnmanagedMethods.WaitForMultipleObjectsEx(waitHandles.Length, waitHandles, waitAll, |
|||
millisecondsTimeout, false); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue