From 273ad09e3110b5315d1c3bcbaecbd362bda5c1a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=8A=B9=EA=B7=BC/Common=20Platform=20Lab=28SR?= =?UTF-8?q?=29/Staff=20Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Tue, 20 Jul 2021 20:08:15 +0900 Subject: [PATCH] Fix build error (#60) --- src/Compatibility/Core/src/Compatibility-net6.csproj | 2 +- src/Core/src/Animations/NativeTicker.Tizen.cs | 4 ++-- src/Core/src/Handlers/Entry/EntryHandler.Tizen.cs | 2 +- src/Core/src/Platform/Tizen/CoreUIAppContext.cs | 2 +- src/Core/src/Platform/Tizen/ModalStack.cs | 2 +- .../src/Platform/Tizen/TransformationExtensions.cs | 5 +++-- src/Core/src/Platform/Tizen/WrapperView.cs | 4 ++-- src/Essentials/src/Essentials-net6.csproj | 3 +-- .../src/TextToSpeech/TextToSpeech.tizen.cs | 12 +++++------- 9 files changed, 17 insertions(+), 19 deletions(-) diff --git a/src/Compatibility/Core/src/Compatibility-net6.csproj b/src/Compatibility/Core/src/Compatibility-net6.csproj index 20ee3fa4b162..940e7585baa0 100644 --- a/src/Compatibility/Core/src/Compatibility-net6.csproj +++ b/src/Compatibility/Core/src/Compatibility-net6.csproj @@ -66,7 +66,7 @@ - + diff --git a/src/Core/src/Animations/NativeTicker.Tizen.cs b/src/Core/src/Animations/NativeTicker.Tizen.cs index 6d7fc0495fae..2cba99d1f71c 100644 --- a/src/Core/src/Animations/NativeTicker.Tizen.cs +++ b/src/Core/src/Animations/NativeTicker.Tizen.cs @@ -19,7 +19,7 @@ public NativeTicker() } _context = SynchronizationContext.Current; - _timer = new Timer((object o) => HandleElapsed(o), this, Timeout.Infinite, Timeout.Infinite); + _timer = new Timer((object? o) => HandleElapsed(o), this, Timeout.Infinite, Timeout.Infinite); } public override void Start() @@ -34,7 +34,7 @@ public override void Stop() _isRunning = false; } - void HandleElapsed(object state) + void HandleElapsed(object? state) { _context?.Post((o) => Fire?.Invoke(), null); } diff --git a/src/Core/src/Handlers/Entry/EntryHandler.Tizen.cs b/src/Core/src/Handlers/Entry/EntryHandler.Tizen.cs index f68e75a643a8..639fe0c5e405 100644 --- a/src/Core/src/Handlers/Entry/EntryHandler.Tizen.cs +++ b/src/Core/src/Handlers/Entry/EntryHandler.Tizen.cs @@ -187,7 +187,7 @@ void OnCursorChanged(object? sender, EventArgs e) VirtualView.CursorPosition = position; } - void OnSelectionCleared(object sender, EventArgs e) + void OnSelectionCleared(object? sender, EventArgs e) { if (VirtualView == null || NativeView == null) return; diff --git a/src/Core/src/Platform/Tizen/CoreUIAppContext.cs b/src/Core/src/Platform/Tizen/CoreUIAppContext.cs index f6eca62286bf..323c302b34dd 100644 --- a/src/Core/src/Platform/Tizen/CoreUIAppContext.cs +++ b/src/Core/src/Platform/Tizen/CoreUIAppContext.cs @@ -177,7 +177,7 @@ void InitializeMainWindow() MainWindow.BackButtonPressed += OnBackButtonPressed; } - void OnBackButtonPressed(object sender, EventArgs e) + void OnBackButtonPressed(object? sender, EventArgs e) { if (!(_handleBackButtonPressed?.Invoke() ?? false)) { diff --git a/src/Core/src/Platform/Tizen/ModalStack.cs b/src/Core/src/Platform/Tizen/ModalStack.cs index 1b9ee3b6b317..0192c2a1548d 100644 --- a/src/Core/src/Platform/Tizen/ModalStack.cs +++ b/src/Core/src/Platform/Tizen/ModalStack.cs @@ -77,7 +77,7 @@ void UpdateTopView() { _lastTop?.Hide(); _lastTop = InternalStack.LastOrDefault(); - _lastTop.Show(); + _lastTop?.Show(); (_lastTop as Widget)?.SetFocus(true); } } diff --git a/src/Core/src/Platform/Tizen/TransformationExtensions.cs b/src/Core/src/Platform/Tizen/TransformationExtensions.cs index 44838c754d1b..35395d62e860 100644 --- a/src/Core/src/Platform/Tizen/TransformationExtensions.cs +++ b/src/Core/src/Platform/Tizen/TransformationExtensions.cs @@ -129,8 +129,9 @@ public static void Perspective3D(this EvasMap map, int px, int py, int z0, int f { var mapType = typeof(EvasMap); var propInfo = mapType.GetProperty("Handle", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); - var handle = (IntPtr)propInfo.GetValue(map); - evas_map_util_3d_perspective(handle, px, py, z0, foc); + IntPtr? handle = (IntPtr?)propInfo?.GetValue(map); + if (handle != null) + evas_map_util_3d_perspective(handle.Value, px, py, z0, foc); } [DllImport("libevas.so.1")] diff --git a/src/Core/src/Platform/Tizen/WrapperView.cs b/src/Core/src/Platform/Tizen/WrapperView.cs index 11696ae4b1ee..6ff39a0dde3d 100644 --- a/src/Core/src/Platform/Tizen/WrapperView.cs +++ b/src/Core/src/Platform/Tizen/WrapperView.cs @@ -52,7 +52,7 @@ partial void ClipChanged() _clipperView.Value.Invalidate(); } - void OnClipPaint(object sender, SKPaintSurfaceEventArgs e) + void OnClipPaint(object? sender, SKPaintSurfaceEventArgs e) { var canvas = e.Surface.Canvas; canvas.Clear(); @@ -83,7 +83,7 @@ void OnClipPaint(object sender, SKPaintSurfaceEventArgs e) } } - void OnLayout(object sender, Tizen.UIExtensions.Common.LayoutEventArgs e) + void OnLayout(object? sender, Tizen.UIExtensions.Common.LayoutEventArgs e) { if (Content != null) { diff --git a/src/Essentials/src/Essentials-net6.csproj b/src/Essentials/src/Essentials-net6.csproj index 4008105fcaba..64a9e1e35b0b 100644 --- a/src/Essentials/src/Essentials-net6.csproj +++ b/src/Essentials/src/Essentials-net6.csproj @@ -53,8 +53,7 @@ --> - - + diff --git a/src/Essentials/src/TextToSpeech/TextToSpeech.tizen.cs b/src/Essentials/src/TextToSpeech/TextToSpeech.tizen.cs index 46a353db5dea..373cfdd42336 100644 --- a/src/Essentials/src/TextToSpeech/TextToSpeech.tizen.cs +++ b/src/Essentials/src/TextToSpeech/TextToSpeech.tizen.cs @@ -20,14 +20,12 @@ internal static async Task PlatformSpeakAsync(string text, SpeechOptions options await tcsUtterances.Task; tcsUtterances = new TaskCompletionSource(); - if (cancelToken != null) + + cancelToken.Register(() => { - cancelToken.Register(() => - { - tts?.Stop(); - tcsUtterances?.TrySetResult(true); - }); - } + tts?.Stop(); + tcsUtterances?.TrySetResult(true); + }); var language = "en_US"; var voiceType = Voice.Auto;