From 99624a7595fab5f77641c1dbba581d1e083e75ff Mon Sep 17 00:00:00 2001 From: Eric Rozell Date: Tue, 1 Nov 2016 13:33:16 -0400 Subject: [PATCH] chore(ReactWindows): Cleanup dead code (#852) Removing IRootView and MeasureAssertions which are no longer in use. Fixes #847 --- .../UIManager/RootViewHelperTests.cs | 9 --------- .../ReactNative.Shared.projitems | 2 -- .../ReactNative.Shared/UIManager/IRootView.cs | 20 ------------------- .../UIManager/MeasureAssertions.cs | 20 ------------------- .../UIManager/RootViewHelperTests.cs | 7 ------- 5 files changed, 58 deletions(-) delete mode 100644 ReactWindows/ReactNative.Shared/UIManager/IRootView.cs delete mode 100644 ReactWindows/ReactNative.Shared/UIManager/MeasureAssertions.cs diff --git a/ReactWindows/ReactNative.Net46.Tests/UIManager/RootViewHelperTests.cs b/ReactWindows/ReactNative.Net46.Tests/UIManager/RootViewHelperTests.cs index 35b4168b2ff..bfb10f3c699 100644 --- a/ReactWindows/ReactNative.Net46.Tests/UIManager/RootViewHelperTests.cs +++ b/ReactWindows/ReactNative.Net46.Tests/UIManager/RootViewHelperTests.cs @@ -1,7 +1,5 @@ using NUnit.Framework; using ReactNative.UIManager; -using System.Windows; -using System.Windows.Controls; namespace ReactNative.Tests.UIManager { @@ -13,12 +11,5 @@ public void RootViewHelper_Null() { Assert.IsNull(RootViewHelper.GetRootView(null)); } - - class TestRootView : Panel, IRootView - { - public void OnChildStartedNativeGesture(RoutedEventArgs ev) - { - } - } } } diff --git a/ReactWindows/ReactNative.Shared/ReactNative.Shared.projitems b/ReactWindows/ReactNative.Shared/ReactNative.Shared.projitems index 2bcc8272bc9..9b7ca636b45 100644 --- a/ReactWindows/ReactNative.Shared/ReactNative.Shared.projitems +++ b/ReactWindows/ReactNative.Shared/ReactNative.Shared.projitems @@ -148,7 +148,6 @@ - @@ -163,7 +162,6 @@ - diff --git a/ReactWindows/ReactNative.Shared/UIManager/IRootView.cs b/ReactWindows/ReactNative.Shared/UIManager/IRootView.cs deleted file mode 100644 index 348b8c07ad1..00000000000 --- a/ReactWindows/ReactNative.Shared/UIManager/IRootView.cs +++ /dev/null @@ -1,20 +0,0 @@ -#if WINDOWS_UWP -using Windows.UI.Xaml; -#else -using System.Windows; -#endif - -namespace ReactNative.UIManager -{ - /// - /// Interface for the root native view of a React Native application. - /// - public interface IRootView - { - /// - /// Called when a child starts a native gesture. - /// - /// The event. - void OnChildStartedNativeGesture(RoutedEventArgs e); - } -} diff --git a/ReactWindows/ReactNative.Shared/UIManager/MeasureAssertions.cs b/ReactWindows/ReactNative.Shared/UIManager/MeasureAssertions.cs deleted file mode 100644 index 509f62126b3..00000000000 --- a/ReactWindows/ReactNative.Shared/UIManager/MeasureAssertions.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; - -namespace ReactNative.UIManager -{ - static class MeasureAssertions - { - public static void AssertExplicitMeasurement(double width, double height) - { - if (IsUnspecified(width) || IsUnspecified(height)) - { - throw new InvalidOperationException("A React view must have an explicit width and height."); - } - } - - private static bool IsUnspecified(double value) - { - return double.IsInfinity(value) || double.IsNaN(value); - } - } -} diff --git a/ReactWindows/ReactNative.Tests/UIManager/RootViewHelperTests.cs b/ReactWindows/ReactNative.Tests/UIManager/RootViewHelperTests.cs index 0a06609d87d..aa6977a839e 100644 --- a/ReactWindows/ReactNative.Tests/UIManager/RootViewHelperTests.cs +++ b/ReactWindows/ReactNative.Tests/UIManager/RootViewHelperTests.cs @@ -13,12 +13,5 @@ public void RootViewHelper_Null() { Assert.IsNull(RootViewHelper.GetRootView(null)); } - - class TestRootView : Panel, IRootView - { - public void OnChildStartedNativeGesture(RoutedEventArgs ev) - { - } - } } }