コード例 #1
0
        public void Equals()
        {
            Int32Rect r1 = new Int32Rect(1, 2, 3, 4);
            Int32Rect r2 = r1;

            Assert.IsTrue(r1.Equals(r1));

            r2.X = 0;
            Assert.IsFalse(r1.Equals(r2));
            r2.X = r1.X;

            r2.Y = 0;
            Assert.IsFalse(r1.Equals(r2));
            r2.Y = r1.Y;

            r2.Width = 0;
            Assert.IsFalse(r1.Equals(r2));
            r2.Width = r1.Width;

            r2.Height = 0;
            Assert.IsFalse(r1.Equals(r2));
            r2.Height = r1.Height;

            Assert.IsFalse(r1.Equals(new object()));
        }
コード例 #2
0
ファイル: D3Overlay.cs プロジェクト: tmasiff/FindersKeepersD3
        public void OnSizeChanged()
        {
            if ((Process == null))
            {
                return;
            }

            if (Config._.FKConfig.General.FKSettings.UseAlternativeOverlay)
            {
                IsOverlayVisible();
            }

            Int32Rect clientRect = PInvokers.GetClientRect(ParentHandle);

            if (!clientRect.Equals(ParentSize))
            {
                Window.Width  = clientRect.Width;
                Window.Height = clientRect.Height;
                Left          = clientRect.X;
                Top           = clientRect.Y;
                ParentSize    = clientRect;
            }

            if (ParentSize == default(Int32Rect))
            {
                ParentSize = clientRect;
                Process Process = PInvokers.CurrentWindow();

                if (Process == null)
                {
                    return;
                }

                ParentHandle = Process.MainWindowHandle;
            }
        }