SIL.FieldWorks.Views.ManagedVwWindow.GetClientRectangle C# (CSharp) Method

GetClientRectangle() public method

public GetClientRectangle ( Rect &clientRectangle ) : void
clientRectangle SIL.Utils.Rect
return void
		public void GetClientRectangle(out Rect clientRectangle)
		{
			if ( m_control == null)
				throw new ApplicationException("Window not set");

			clientRectangle.top = m_control.ClientRectangle.Top;
			clientRectangle.left = m_control.ClientRectangle.Left;
			clientRectangle.right = m_control.ClientRectangle.Right;
			clientRectangle.bottom = m_control.ClientRectangle.Bottom;
		}

Usage Example

Ejemplo n.º 1
0
		public void SimpleWindowTest()
		{
			using (var c = new Control())
			{
				var wrappedWindow = new ManagedVwWindow();
				wrappedWindow.Window = (uint)c.Handle;
				Rect temp;
				wrappedWindow.GetClientRectangle(out temp);

				Assert.AreEqual(c.ClientRectangle.Left, temp.left, "Left not the same");
				Assert.AreEqual(c.ClientRectangle.Right, temp.right, "Right not the same");
				Assert.AreEqual(c.ClientRectangle.Top, temp.top, "Top not the same");
				Assert.AreEqual(c.ClientRectangle.Bottom, temp.bottom, "Bottom not the same");
			}
		}
All Usage Examples Of SIL.FieldWorks.Views.ManagedVwWindow::GetClientRectangle
ManagedVwWindow