System.Drawing.Rectangle.Equals(object)

Here are the examples of the csharp api class System.Drawing.Rectangle.Equals(object) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

39 Examples 7

1. Example

Project: Zero-K-Infrastructure
Source File: FrameBorderRenderer.cs
protected bool Equals(CacheKey other) {
                return Rectangle.Equals(other.Rectangle) && Style == other.Style && OverlayStyle == other.OverlayStyle;
            }

2. Example

Project: Zero-K-Infrastructure
Source File: FrameBorderRenderer.cs
protected bool Equals(CacheKey other) {
                return Rectangle.Equals(other.Rectangle) && Style == other.Style && OverlayStyle == other.OverlayStyle;
            }

3. Example

Project: ClearCanvas
Source File: GeometricShutter.cs
public bool Equals(RectangularShutter other)
		{
			return other != null && other.Rectangle.Equals(Rectangle);
		}

4. Example

Project: RNGReporter
Source File: RoundGlossPainter.cs
protected override void ResizeThis(Rectangle box)
        {
            if (!this.box.Equals(box))
            {
                this.box = box;
                ResetBrushes(box);
            }
        }

5. Example

Project: Krypton
Source File: RenderMementos.cs
public bool UseCachedValues(Rectangle r, Color color1)
        {
            bool ret = rect.Equals(r) && c1.Equals(color1);

            rect = r;
            c1 = color1;

            return ret;
        }

6. Example

Project: Krypton
Source File: RenderMementos.cs
public bool UseCachedValues(Rectangle r, Color color1, Color color2)
        {
            bool ret = rect.Equals(r) && 
                       c1.Equals(color1) && 
                       c2.Equals(color2);

            rect = r;
            c1 = color1;
            c2 = color2;

            return ret;
        }

7. Example

Project: Krypton
Source File: RenderMementos.cs
public bool UseCachedValues(Rectangle r, 
                                    Color color1, Color color2,
                                    VisualOrientation orient)
        {
            bool ret = rect.Equals(r) &&
                       c1.Equals(color1) &&
                       c2.Equals(color2) &&
                       (orient == orientation);

            rect = r;
            c1 = color1;
            c2 = color2;
            orientation = orient;

            return ret;
        }

8. Example

Project: Krypton
Source File: RenderMementos.cs
public bool UseCachedValues(Rectangle r,
                                    Color color1, Color color2,
                                    Color color3, Color color4,
                                    VisualOrientation orient)
        {
            bool ret = rect.Equals(r) &&
                       c1.Equals(color1) &&
                       c2.Equals(color2) &&
                       c3.Equals(color1) &&
                       c4.Equals(color2) &&
                       (orient == orientation);

            rect = r;
            c1 = color1;
            c2 = color2;
            c3 = color3;
            c4 = color4;
            orientation = orient;

            return ret;
        }

9. Example

Project: Krypton
Source File: RenderMementos.cs
public bool UseCachedValues(Rectangle r,
                                    Color c1, 
                                    Color c2,
                                    VisualOrientation orient)
        {
            bool ret = (rect.Equals(r) &&
                        color1.Equals(c1) && 
                        color2.Equals(c2) &&
                        (orientation == orient));

            rect =r ;
            color1 = c1;
            color2 = c2;
            orientation = orient;

            return ret;
        }

10. Example

Project: ContinuousTests
Source File: DefaultErrorListRenderer.cs
public bool Equals(ErrorItemCollection items, ErrorItem item, Rectangle rectangle)
            {               
                ErrorItem first = ((items.Count > 0) ? items[0] : null);

                return (viewport.Equals(rectangle) &&
                        object.ReferenceEquals(item, selection) &&
                        object.ReferenceEquals(first, _firstItem));
            }

11. Example

Project: ContinuousTests
Source File: DefaultErrorListRenderer.cs
public bool Equals(ErrorItemCollection items, ErrorItem item, Rectangle rectangle)
            {               
                ErrorItem first = ((items.Count > 0) ? items[0] : null);

                return (viewport.Equals(rectangle) &&
                        object.ReferenceEquals(item, selection) &&
                        object.ReferenceEquals(first, _firstItem));
            }

12. Example

Project: ContinuousTests
Source File: DefaultErrorListRenderer.cs
public bool Equals(ErrorItemCollection items, ErrorItem item, Rectangle rectangle)
            {               
                ErrorItem first = ((items.Count > 0) ? items[0] : null);

                return (viewport.Equals(rectangle) &&
                        object.ReferenceEquals(item, selection) &&
                        object.ReferenceEquals(first, _firstItem));
            }

13. Example

Project: Aurora
Source File: Effects.cs
public bool Equals(BitmapRectangle p)
        {
            if (ReferenceEquals(null, p)) return false;
            if (ReferenceEquals(this, p)) return true;

            return Rectangle.Equals(p.Rectangle);
        }

14. Example

Project: OpenLiveWriter
Source File: ElementControlBehavior.cs
private void SetElementRectangle(Rectangle rect)
        {
            if (!rect.Equals(elementRect))
            {
                elementRect = rect;
                if (ElementSizeChanged != null)
                    ElementSizeChanged(this, EventArgs.Empty);
            }
        }

15. Example

Project: ShareX
Source File: WindowCapture.cs
public override bool Equals(object obj)
        {
            bool ret = false;
            if (obj != null && GetType() == obj.GetType())
            {
                CaptureElement other = obj as CaptureElement;
                if (other != null && Bounds.Equals(other.Bounds))
                {
                    ret = true;
                }
            }
            return ret;
        }

16. Example

Project: AutoTest.Net
Source File: DefaultErrorListRenderer.cs
public bool Equals(ErrorItemCollection items, ErrorItem item, Rectangle rectangle)
            {               
                ErrorItem first = ((items.Count > 0) ? items[0] : null);

                return (viewport.Equals(rectangle) &&
                        object.ReferenceEquals(item, selection) &&
                        object.ReferenceEquals(first, _firstItem));
            }

17. Example

Project: AutoTest.Net
Source File: DefaultErrorListRenderer.cs
public bool Equals(ErrorItemCollection items, ErrorItem item, Rectangle rectangle)
            {               
                ErrorItem first = ((items.Count > 0) ? items[0] : null);

                return (viewport.Equals(rectangle) &&
                        object.ReferenceEquals(item, selection) &&
                        object.ReferenceEquals(first, _firstItem));
            }

18. Example

Project: AutoTest.Net
Source File: DefaultErrorListRenderer.cs
public bool Equals(ErrorItemCollection items, ErrorItem item, Rectangle rectangle)
            {               
                ErrorItem first = ((items.Count > 0) ? items[0] : null);

                return (viewport.Equals(rectangle) &&
                        object.ReferenceEquals(item, selection) &&
                        object.ReferenceEquals(first, _firstItem));
            }

19. Example

Project: ClearCanvas
Source File: GeometricShutterCache.cs
public bool Equals(Key other)
			{
				if (other.Shutters.Count != Shutters.Count)
					return false;

				for (int i = 0; i < Shutters.Count; ++i)
				{
					//could do these in any order,really, but that complicates things.
					if (!Shutters[i].Equals(other.Shutters[i]))
						return false;
				}

				return other.ImageRectangle.Equals(ImageRectangle) && other.FillColor.Equals(FillColor);
			}

20. Example

Project: Borderless-Gaming
Source File: MainWindow.cs
protected override void WndProc(ref Message m)
        {
            if (m.Msg == Native.WM_HOTKEY)
/n ..... /n //View Source file for more details /n }

21. Example

Project: RNGReporter
Source File: RoundGlossPainter.cs
protected override void PaintThisGloss(Rectangle box, Graphics g)
        {
            if (!this.bo/n ..... /n //View Source file for more details /n }

22. Example

Project: ShareX
Source File: WindowCapture.cs
public override bool Equals(object obj)
        {
            bool ret = false;
            if (obj != null && GetType().Equals(obj.GetType()))
            {
                CaptureElement other = obj as CaptureElement;
                if (Bounds.Equals(other.Bounds))
                {
                    ret = true;
                }
            }
            return ret;
        }

23. Example

Project: PokerMuck
Source File: WindowsListener.cs
private void ListenLoop(){
            while(listening){
                // Copy current foreground /n ..... /n //View Source file for more details /n }

24. Example

Project: Urbanization
Source File: AreaRenderHelper.cs
public IEnumerable<ZoneRenderInfo> GetToBeRenderedAreas()
        {
            var currentViewportRectangle = new Rectangle
            {
                Size = _viewportPanel.Size,
                Location = new Point(
                    x: -_viewportPanel.AutoScrollPosition.X,
                    y: -_viewportPanel.AutoScrollPosition.Y
                )
            };

            if (!_lastViewportRectangle.Equals(currentViewportRectangle) || _zoomStateChanged || _toBeRenderedZoneInfosCache.Count == 0)
            {
                _zoomStateChanged = false;
                _lastViewportRectangle = currentViewportRectangle;

                _toBeRenderedZoneInfosCache.Clear();

                foreach (var x in _zoneRenderInfos.Where(rect => IsVisibleInViewPort(rect.Value.GetRectangle())))
                {
                    _toBeRenderedZoneInfosCache.Add(x.Value);
                }
            }

            return _toBeRenderedZoneInfosCache;
        }

25. Example

Project: WPFTabTip
Source File: TabTip.cs
[SuppressMessage("ReSharper", "ConvertIfStatementToReturnStatement")]
        internal static Rectangle GetWouldBeTabTipRectangle()
        {
            RECT rect;

            if (!GetWindowRect(new HandleRef(null, GetTabTipWindowHandle()), out rect))
            {
                if (previousTabTipRectangle.Equals(new Rectangle())) //in case TabTip was closed and previousTabTipRectangle was not set
                    Task.Delay(TimeSpan.FromSeconds(1)).ContinueWith(TryGetTabTipRectangleTo?ache);

                return previousTabTipRectangle;
            }

            Rectangle wouldBeTabTipRectangle = new Rectangle(x: rect.Left, y: rect.Top, width: rect.Right - rect.Left + 1, height: rect.Bottom - rect.Top + 1);
            previousTabTipRectangle = wouldBeTabTipRectangle;

            return wouldBeTabTipRectangle;
        }

26. Example

Project: LaserGRBL
Source File: WaitingProgressBar.cs
protected override void DrawProgres(System.Drawing.Graphics g)
		{

			try {
				if (this.BouncingMo/n ..... /n //View Source file for more details /n }

27. Example

Project: PokerMuck
Source File: VisualRecognitionMap.cs
public void SameSizeCheck(ArrayList actions, int delta)
        {
            Trace.WriteLine("Check/n ..... /n //View Source file for more details /n }

28. Example

Project: ShareX
Source File: Surface.cs
public void ApplyBitmapEffect(IEffect effect)
        {
            BackgroundForm backgroundForm = new BackgroundForm("Effect", "Please wait");
            backgroundForm.Show();
            Application.DoEvents();
            try
            {
                Rectangle imageRectangle = new Rectangle(Point.Empty, Image.Size);
                Matrix matrix = new Matrix();
                Image newImage = ImageHelper.ApplyEffect(Image, effect, matrix);
                if (newImage != null)
                {
                    // Make sure the elements move according to the offset the effect made the bitmap move
                    _elements.Transform(matrix);
                    // Make undoable
                    MakeUndoable(new SurfaceBackgroundChangeMemento(this, matrix), false);
                    SetImage(newImage, false);
                    Invalidate();
                    if (_surfaceSizeChanged != null && !imageRectangle.Equals(new Rectangle(Point.Empty, newImage.Size)))
                    {
                        _surfaceSizeChanged(this, null);
                    }
                }
                else
                {
                    // clean up matrix, as it hasn't been used in the undo stack.
                    matrix.Dispose();
                }
            }
            finally
            {
                // Always close the background form
                backgroundForm.CloseDialog();
            }
        }

29. Example

Project: ShareX
Source File: Surface.cs
private void SurfacePaint(object sender, PaintEventArgs e)
        {
            Graphics targetGrap/n ..... /n //View Source file for more details /n }

30. Example

Project: ShareX
Source File: Surface.cs
public void ApplyBitmapEffect(IEffect effect)
        {
            BackgroundForm backgroundForm = new BackgroundForm("Effect", "Please wait");
            backgroundForm.Show();
            Application.DoEvents();
            try
            {
                Rectangle imageRectangle = new Rectangle(Point.Empty, Image.Size);
                Matrix matrix = new Matrix();
                Image newImage = ImageHelper.ApplyEffect(Image, effect, matrix);
                if (newImage != null)
                {
                    // Make sure the elements move according to the offset the effect made the bitmap move
                    _elements.Transform(matrix);
                    // Make undoable
                    MakeUndoable(new SurfaceBackgroundChangeMemento(this, matrix), false);
                    SetImage(newImage, false);
                    Invalidate();
                    if (_surfaceSizeChanged != null && !imageRectangle.Equals(new Rectangle(Point.Empty, newImage.Size)))
                    {
                        _surfaceSizeChanged(this, null);
                    }
                }
                else
                {
                    // clean up matrix, as it hasn't been used in the undo stack.
                    matrix.Dispose();
                }
            }
            finally
            {
                // Always close the background form
                backgroundForm.CloseDialog();
            }
        }

31. Example

Project: ShareX
Source File: Surface.cs
private void SurfacePaint(object sender, PaintEventArgs e)
        {
            Graphics targetGrap/n ..... /n //View Source file for more details /n }

32. Example

Project: ShareX
Source File: Surface.cs
public bool ApplyCrop(Rectangle cropRectangle)
        {
            if (IsCropPossible(ref cropRect/n ..... /n //View Source file for more details /n }

33. Example

Project: ShareX
Source File: Surface.cs
public bool ApplyCrop(Rectangle cropRectangle)
        {
            if (IsCropPossible(ref cropRect/n ..... /n //View Source file for more details /n }

34. Example

Project: PokerMuck
Source File: VisualRecognitionManager.cs
void timedScreenshotTaker_ScreenshotTaken(Bitmap screenshot)
        {
            UpdateCardMatchDi/n ..... /n //View Source file for more details /n }

35. Example

Project: PokerMuck
Source File: VisualRecognitionMap.cs
private void AnaliseMap(Bitmap mapImage)
        {
            mapData.Clear();
            ColorFil/n ..... /n //View Source file for more details /n }

36. Example

Project: OpenLiveWriter
Source File: ImageCropControl.cs
protected override Rectangle DoResize(Point newLoc)
            {
                bool up = AnchorSt/n ..... /n //View Source file for more details /n }

37. Example

Project: EDDiscovery
Source File: TabControlCustom.cs
protected override void OnPaint(PaintEventArgs e)
        {
            if (!e.ClipRectangle.Equals(/n ..... /n //View Source file for more details /n }

38. Example

Project: ShareX
Source File: ImageHelper.cs
public static Bitmap CloneArea(Image sourceImage, Rectangle sourceRect, PixelFormat targetFormat)
  /n ..... /n //View Source file for more details /n }

39. Example

Project: ShareX
Source File: ImageHelper.cs
public static Bitmap CloneArea(Image sourceImage, Rectangle sourceRect, PixelFormat targetFormat)
  /n ..... /n //View Source file for more details /n }