mirror of
https://github.com/greenshot/greenshot
synced 2025-07-16 10:03:44 -07:00
Code quality changes
This commit is contained in:
parent
f07ed83722
commit
610f45d082
189 changed files with 4609 additions and 5203 deletions
|
@ -84,9 +84,11 @@ namespace Greenshot.Drawing {
|
|||
protected override void OnDeserialized(StreamingContext context)
|
||||
{
|
||||
Init();
|
||||
_stringFormat = new StringFormat();
|
||||
_stringFormat.Alignment = StringAlignment.Center;
|
||||
_stringFormat.LineAlignment = StringAlignment.Center;
|
||||
_stringFormat = new StringFormat
|
||||
{
|
||||
Alignment = StringAlignment.Center,
|
||||
LineAlignment = StringAlignment.Center
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -98,20 +100,14 @@ namespace Greenshot.Drawing {
|
|||
{
|
||||
return;
|
||||
}
|
||||
if (Parent != null) {
|
||||
((Surface)Parent).RemoveStepLabel(this);
|
||||
}
|
||||
((Surface) Parent)?.RemoveStepLabel(this);
|
||||
base.SwitchParent(newParent);
|
||||
if (newParent != null) {
|
||||
((Surface)Parent)?.AddStepLabel(this);
|
||||
}
|
||||
}
|
||||
|
||||
public override Size DefaultSize {
|
||||
get {
|
||||
return new Size(30, 30);
|
||||
}
|
||||
}
|
||||
public override Size DefaultSize => new Size(30, 30);
|
||||
|
||||
public override bool InitContent() {
|
||||
_defaultEditMode = EditStatus.IDLE;
|
||||
|
@ -148,14 +144,13 @@ namespace Greenshot.Drawing {
|
|||
if (!disposing) {
|
||||
return;
|
||||
}
|
||||
if (Parent != null)
|
||||
((Surface) Parent)?.RemoveStepLabel(this);
|
||||
if (_stringFormat == null)
|
||||
{
|
||||
((Surface)Parent).RemoveStepLabel(this);
|
||||
}
|
||||
if (_stringFormat != null) {
|
||||
_stringFormat.Dispose();
|
||||
_stringFormat = null;
|
||||
return;
|
||||
}
|
||||
_stringFormat.Dispose();
|
||||
_stringFormat = null;
|
||||
}
|
||||
|
||||
public override bool HandleMouseMove(int x, int y) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue