public void TestGetTop()
        {
            // setup
            Workspace.Current.Configuration = new Configuration();
            double margin = Workspace.Current.Configuration.DesktopMargin;

            // expect
            Assert.AreEqual(margin, WindowOperator.GetTop(null));
        }
Ejemplo n.º 2
0
        private void Locate()
        {
            MainWindow window    = MainWindow.Current;
            Direction  direction = this.Direction;

            if (direction == Direction.Left ||
                direction == Direction.Right)
            {
                window.Top = WindowOperator.GetTop(window, this.Position);
            }
            else
            {
                window.Left = WindowOperator.GetLeft(window, this.Position);
            }
        }
Ejemplo n.º 3
0
        protected override double?GetToPropertyValue()
        {
            MainWindow window    = MainWindow.Current;
            Direction  direction = this.Direction;

            if (direction == Direction.Left ||
                direction == Direction.Right)
            {
                return(WindowOperator.GetLeft(window, this.Position));
            }
            else
            {
                return(WindowOperator.GetTop(window, this.Position));
            }
        }
        public void TestGetTopWithPosition()
        {
            // setup
            MainWindow window = new MainWindow();

            MainWindow.Current = window;
            double margin = Workspace.Current.Configuration.DesktopMargin;

            // expect
            Assert.AreEqual(margin, WindowOperator.GetTop(window, Position.LeftTop));
            Assert.AreEqual(margin, WindowOperator.GetTop(window, Position.CenterTop));
            Assert.AreEqual(margin, WindowOperator.GetTop(window, Position.RightTop));
            Assert.AreEqual(window.ScreenHeight / 2, WindowOperator.GetTop(window, Position.LeftMiddle));
            Assert.AreEqual(window.ScreenHeight / 2, WindowOperator.GetTop(window, Position.CenterMiddle));
            Assert.AreEqual(window.ScreenHeight / 2, WindowOperator.GetTop(window, Position.RightMiddle));
            Assert.AreEqual(window.ScreenHeight - margin, WindowOperator.GetTop(window, Position.LeftBottom));
            Assert.AreEqual(window.ScreenHeight - margin, WindowOperator.GetTop(window, Position.CenterBottom));
            Assert.AreEqual(window.ScreenHeight - margin, WindowOperator.GetTop(window, Position.RightBottom));
        }