Browse Source

Removed a bunch of unused members/classes.

Steven Kirk 9 years ago
parent
commit
a03dad9bab

+ 0 - 2
src/Gtk/Perspex.Cairo/Media/DrawingContext.cs

@@ -215,8 +215,6 @@ namespace Perspex.Cairo.Media
 			}
         }
 
-        private static Random Random = new Random();
-
         /// <summary>
         /// Pushes a clip rectange.
         /// </summary>

+ 0 - 5
src/Gtk/Perspex.Gtk/WindowImpl.cs

@@ -379,10 +379,5 @@ namespace Perspex.Gtk
             Input(e);
             return true;
         }
-
-        private IPlatformHandle GetHandle(Gdk.Window window)
-        {
-            return new PlatformHandle(window.Handle, "GdkWindow");
-        }
     }
 }

+ 0 - 15
src/Markup/Perspex.Markup.Xaml/Data/Binding.cs

@@ -226,21 +226,6 @@ namespace Perspex.Markup.Xaml.Data
             return result;
         }
 
-        private IControl LookupNamedControl(IControl target)
-        {
-            Contract.Requires<ArgumentNullException>(target != null);
-
-            var nameScope = target.FindNameScope();
-
-            if (nameScope == null)
-            {
-                throw new InvalidOperationException(
-                    "Could not find name scope for ElementName binding.");
-            }
-
-            return nameScope.Find<IControl>(ElementName);
-        }
-
         private class PathInfo
         {
             public string Path { get; set; }

+ 0 - 10
src/Perspex.Base/PerspexObject.cs

@@ -678,16 +678,6 @@ namespace Perspex
             }
         }
 
-        /// <summary>
-        /// Gets a description of a property that van be used in observables.
-        /// </summary>
-        /// <param name="property">The property</param>
-        /// <returns>The description.</returns>
-        private string GetDescription(PerspexProperty property)
-        {
-            return $"{GetType().Name}.{property.Name}";
-        }
-
         /// <summary>
         /// Gets a description of an observable that van be used in logs.
         /// </summary>

+ 0 - 11
src/Perspex.Controls/ContextMenu.cs

@@ -119,17 +119,6 @@
             }
         }
 
-        private void PopupOpened(object sender, EventArgs e)
-        {
-            var selectedIndex = SelectedIndex;
-
-            if (selectedIndex != -1)
-            {
-                var container = ItemContainerGenerator.ContainerFromIndex(selectedIndex);
-                container?.Focus();
-            }
-        }
-
         private static void ControlPointerReleased(object sender, PointerReleasedEventArgs e)
         {
             var control = (Control)sender;

+ 0 - 8
src/Perspex.Controls/Grid.cs

@@ -876,14 +876,6 @@ namespace Perspex.Controls
                 Stars = 0;
                 Type = type;
             }
-
-            public void Init(double offeredSize, double min, double max, GridUnitType type)
-            {
-                OfferedSize = offeredSize;
-                Min = min;
-                Max = max;
-                Type = type;
-            }
         }
 
         private struct GridNode

+ 0 - 7
src/Perspex.Controls/MenuItem.cs

@@ -447,13 +447,6 @@ namespace Perspex.Controls
             /// </summary>
             public static readonly DependencyResolver Instance = new DependencyResolver();
 
-            /// <summary>
-            /// Disposes of all managed resources.
-            /// </summary>
-            public void Dispose()
-            {
-            }
-
             /// <summary>
             /// Gets a service of the specified type.
             /// </summary>

+ 0 - 7
src/Perspex.Controls/Mixins/ContentControlMixin.cs

@@ -118,13 +118,6 @@ namespace Perspex.Controls.Mixins
             });
         }
 
-        private static event EventHandler<TemplateAppliedEventArgs> TemplateApplied;
-
-        private static void OnTemplateApplied(object sender, RoutedEventArgs e)
-        {
-            TemplateApplied?.Invoke(sender, (TemplateAppliedEventArgs)e);
-        }
-
         private static void UpdateLogicalChild(
             IControl control,
             IPerspexList<ILogical> logicalChildren,

+ 0 - 8
src/Perspex.Controls/Presenters/ScrollContentPresenter.cs

@@ -256,13 +256,5 @@ namespace Perspex.Controls.Presenters
             Extent = scrollable.Extent;
             Offset = scrollable.Offset;
         }
-
-        private static Vector ValidateOffset(ScrollContentPresenter o, Vector value)
-        {
-            return ScrollViewer.CoerceOffset(
-                o.GetValue(ExtentProperty),
-                o.GetValue(ViewportProperty),
-                value);
-        }
     }
 }

+ 1 - 1
src/Skia/Perspex.Skia/DrawingContextImpl.cs

@@ -180,7 +180,7 @@ namespace Perspex.Skia
         public void PopOpacity() => _settings->Opacity = _opacityStack.Pop();
 
         private Matrix _currentTransform = Matrix.Identity;
-        private readonly float[] _fmatrix = new float[6];
+
         public Matrix Transform
         {
             get { return _currentTransform; }

+ 0 - 3
tests/Perspex.Base.UnitTests/PerspexObjectTests_Binding.cs

@@ -262,9 +262,6 @@ namespace Perspex.Base.UnitTests
             public static readonly StyledProperty<string> FooProperty =
                 PerspexProperty.Register<Class1, string>("Foo", "foodefault");
 
-            public static readonly StyledProperty<string> BazProperty =
-                PerspexProperty.Register<Class1, string>("Baz", "bazdefault", true);
-
             public static readonly StyledProperty<double> QuxProperty =
                 PerspexProperty.Register<Class1, double>("Qux", 5.6);
         }

+ 0 - 12
tests/Perspex.Base.UnitTests/PerspexObjectTests_Metadata.cs

@@ -51,24 +51,12 @@ namespace Perspex.Base.UnitTests
         {
             public static readonly StyledProperty<string> FooProperty =
                 PerspexProperty.Register<Class1, string>("Foo");
-
-            public static readonly StyledProperty<string> BazProperty =
-                PerspexProperty.Register<Class1, string>("Baz");
-
-            public static readonly StyledProperty<int> QuxProperty =
-                PerspexProperty.Register<Class1, int>("Qux");
         }
 
         private class Class2 : Class1
         {
             public static readonly StyledProperty<string> BarProperty =
                 PerspexProperty.Register<Class2, string>("Bar");
-
-            public static readonly StyledProperty<double> FlobProperty =
-                PerspexProperty.Register<Class2, double>("Flob");
-
-            public static readonly StyledProperty<double?> FredProperty =
-                PerspexProperty.Register<Class2, double?>("Fred");
         }
 
         private class AttachedOwner

+ 0 - 2
tests/Perspex.Base.UnitTests/StyledPropertyTests.cs

@@ -35,8 +35,6 @@ namespace Perspex.Base.UnitTests
 
         private class Class1 : PerspexObject
         {
-            public static readonly StyledProperty<string> FooProperty =
-                PerspexProperty.Register<Class1, string>("Foo", "default");
         }
 
         private class Class2 : PerspexObject

+ 0 - 10
tests/Perspex.Controls.UnitTests/ListBoxTests_Single.cs

@@ -236,15 +236,5 @@ namespace Perspex.Controls.UnitTests
             // Now the ItemsPresenter should be reigstered, so apply its template.
             target.Presenter.ApplyTemplate();
         }
-
-        private class Item
-        {
-            public Item(string value)
-            {
-                Value = value;
-            }
-
-            public string Value { get; }
-        }
     }
 }

+ 0 - 5
tests/Perspex.Controls.UnitTests/PanelTests.cs

@@ -117,10 +117,5 @@ namespace Perspex.Controls.UnitTests
             Assert.Equal(new Control[0], panel.Children);
             Assert.Equal(new ILogical[0], panel.GetLogicalChildren());
         }
-
-        private class TestReparent : Panel
-        {
-            public new IPerspexList<ILogical> LogicalChildren => base.LogicalChildren;
-        }
     }
 }

+ 0 - 5
tests/Perspex.Controls.UnitTests/Primitives/SelectingItemsControlTests_AutoSelect.cs

@@ -100,10 +100,5 @@ namespace Perspex.Controls.UnitTests.Primitives
                 SelectionModeProperty.OverrideDefaultValue<TestSelector>(SelectionMode.AlwaysSelected);
             }
         }
-
-        private class Item : Control, ISelectable
-        {
-            public bool IsSelected { get; set; }
-        }
     }
 }

+ 0 - 28
tests/Perspex.Controls.UnitTests/Primitives/TemplatedControlTests.cs

@@ -328,23 +328,6 @@ namespace Perspex.Controls.UnitTests.Primitives
             };
         }
 
-        private static IControl ItemsControlTemplate(ItemsControl control)
-        {
-            return new Border
-            {
-                Child = new ScrollViewer
-                {
-                    Template = new FuncControlTemplate<ScrollViewer>(ScrollViewerTemplate),
-                    Content = new ItemsPresenter
-                    {
-                        Name = "PART_ItemsPresenter",
-                        [!ItemsPresenter.ItemsProperty] = control[!ItemsControl.ItemsProperty],
-                        [!ItemsPresenter.ItemsPanelProperty] = control[!ItemsControl.ItemsPanelProperty],
-                    }
-                }
-            };
-        }
-
         private static Control ScrollViewerTemplate(ScrollViewer control)
         {
             var result = new ScrollContentPresenter
@@ -355,16 +338,5 @@ namespace Perspex.Controls.UnitTests.Primitives
 
             return result;
         }
-
-        private class ApplyTemplateTracker : Control
-        {
-            public List<Tuple<IVisual, ILogical>> Invocations { get; } = new List<Tuple<IVisual, ILogical>>();
-
-            public override void ApplyTemplate()
-            {
-                base.ApplyTemplate();
-                Invocations.Add(Tuple.Create(this.GetVisualParent(), this.GetLogicalParent()));
-            }
-        }
     }
 }

+ 0 - 12
tests/Perspex.Controls.UnitTests/ScrollViewerTests.cs

@@ -84,17 +84,5 @@ namespace Perspex.Controls.UnitTests
                 },
             };
         }
-
-        private Control CreateNestedTemplate(ContentControl control)
-        {
-            return new ScrollViewer
-            {
-                Template = new FuncControlTemplate<ScrollViewer>(CreateTemplate),
-                Content = new ContentPresenter
-                {
-                    Name = "PART_ContentPresenter",
-                }
-            };
-        }
     }
 }

+ 0 - 25
tests/Perspex.Controls.UnitTests/TopLevelTests.cs

@@ -281,31 +281,6 @@ namespace Perspex.Controls.UnitTests
                 });
         }
 
-        private void RegisterServices()
-        {
-            var fixture = new Fixture().Customize(new AutoMoqCustomization());
-            var l = PerspexLocator.CurrentMutable;
-
-            var formattedText = fixture.Create<IFormattedTextImpl>();
-            var globalStyles = new Mock<IGlobalStyles>();
-            var layoutManager = fixture.Create<ILayoutManager>();
-            var renderInterface = fixture.Create<IPlatformRenderInterface>();
-            var renderManager = fixture.Create<IRenderQueueManager>();
-            var windowImpl = new Mock<IWindowImpl>();
-            var theme = new Styles();
-
-            globalStyles.Setup(x => x.Styles).Returns(theme);
-
-            PerspexLocator.CurrentMutable
-                .Bind<IInputManager>().ToConstant(new Mock<IInputManager>().Object)
-                .Bind<IFocusManager>().ToConstant(new Mock<IFocusManager>().Object)
-                .Bind<IGlobalStyles>().ToConstant(globalStyles.Object)
-                .Bind<ILayoutManager>().ToConstant(layoutManager)
-                .Bind<IPlatformRenderInterface>().ToConstant(renderInterface)
-                .Bind<IRenderQueueManager>().ToConstant(renderManager)
-                .Bind<IStyler>().ToConstant(new Styler());
-        }
-
         private class TestTopLevel : TopLevel
         {
             public TestTopLevel(ITopLevelImpl impl)

+ 0 - 5
tests/Perspex.Markup.UnitTests/Data/ExpressionSubjectTests.cs

@@ -176,11 +176,6 @@ namespace Perspex.Markup.UnitTests.Data
             public string StringValue { get; set; }
 
             public double DoubleValue { get; set; }
-
-            public void RaisePropertyChanged(string propertyName)
-            {
-                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
-            }
         }
     }
 }

+ 0 - 5
tests/Perspex.Markup.Xaml.UnitTests/Data/BindingTests_TemplatedParent.cs

@@ -55,11 +55,6 @@ namespace Perspex.Markup.Xaml.UnitTests.Data
                 BindingPriority.TemplatedParent));
         }
 
-        private Mock<IPerspexObject> CreateTarget(ITemplatedControl templatedParent)
-        {
-            return CreateTarget(templatedParent: templatedParent);
-        }
-
         private Mock<IControl> CreateTarget(
             ITemplatedControl templatedParent = null,
             string text = null)

+ 0 - 12
tests/Perspex.Styling.UnitTests/ActivatedSubjectTests.cs

@@ -53,18 +53,6 @@ namespace Perspex.Styling.UnitTests
             Assert.NotNull(source.Error);
         }
 
-        private class Class1 : PerspexObject
-        {
-            public static readonly StyledProperty<string> FooProperty =
-                PerspexProperty.Register<Class1, string>("Foo", "foodefault");
-
-            public string Foo
-            {
-                get { return GetValue(FooProperty); }
-                set { SetValue(FooProperty, value); }
-            }
-        }
-
         private class TestSubject : ISubject<object>
         {
             private IObserver<object> _observer;

+ 0 - 13
tests/Perspex.Styling.UnitTests/StyleActivatorTests.cs

@@ -165,18 +165,5 @@ namespace Perspex.Styling.UnitTests
 
             Assert.True(completed);
         }
-
-        private Recorded<Notification<bool>>[] OnNextValues(params bool[] values)
-        {
-            var result = new List<Recorded<Notification<bool>>>();
-            var time = 1;
-
-            foreach (var value in values)
-            {
-                result.Add(new Recorded<Notification<bool>>(time, Notification.CreateOnNext<bool>(value)));
-            }
-
-            return result.ToArray();
-        }
     }
 }