mirror of
https://github.com/greenshot/greenshot
synced 2025-07-16 10:03:44 -07:00
This commit breaks compiling for a short (!) period, need to sync my work to a different system
This commit is contained in:
parent
1751880581
commit
684a7615d7
38 changed files with 1845 additions and 1324 deletions
48
GreenshotPlugin/Core/CaptureElement.cs
Normal file
48
GreenshotPlugin/Core/CaptureElement.cs
Normal file
|
@ -0,0 +1,48 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using GreenshotPlugin.Interfaces;
|
||||
|
||||
namespace GreenshotPlugin.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// A class representing an element in the capture
|
||||
/// </summary>
|
||||
public class CaptureElement : ICaptureElement {
|
||||
public CaptureElement(Rectangle bounds) {
|
||||
Bounds = bounds;
|
||||
}
|
||||
public CaptureElement(string name) {
|
||||
Name = name;
|
||||
}
|
||||
public CaptureElement(string name, Rectangle bounds) {
|
||||
Name = name;
|
||||
Bounds = bounds;
|
||||
}
|
||||
|
||||
public List<ICaptureElement> Children { get; set; } = new List<ICaptureElement>();
|
||||
|
||||
public string Name {
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public Rectangle Bounds {
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
// CaptureElements are regarded equal if their bounds are equal. this should be sufficient.
|
||||
public override bool Equals(object obj) {
|
||||
if (obj == null || GetType() != obj.GetType())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return obj is CaptureElement other && Bounds.Equals(other.Bounds);
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
// TODO: Fix this, this is not right...
|
||||
return Bounds.GetHashCode();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue