mirror of
https://github.com/greenshot/greenshot
synced 2025-07-16 10:03:44 -07:00
Added Rectangle and fixed write problem
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@847 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
a73c3cfb15
commit
fe4ee0b62b
1 changed files with 11 additions and 1 deletions
|
@ -253,6 +253,13 @@ namespace Greenshot.Core {
|
|||
int width = int.Parse(sizeValues[0].Trim());
|
||||
int height = int.Parse(sizeValues[1].Trim());
|
||||
return new Size(width, height);
|
||||
} else if (fieldType == typeof(Rectangle)) {
|
||||
string[] rectValues = valueString.Split(new Char[] {','});
|
||||
int x = int.Parse(rectValues[0].Trim());
|
||||
int y = int.Parse(rectValues[1].Trim());
|
||||
int width = int.Parse(rectValues[2].Trim());
|
||||
int height = int.Parse(rectValues[3].Trim());
|
||||
return new Rectangle(x, y, width, height);
|
||||
} else if (fieldType.IsEnum) {
|
||||
try {
|
||||
return Enum.Parse(fieldType, valueString);
|
||||
|
@ -274,6 +281,9 @@ namespace Greenshot.Core {
|
|||
} else if (fieldType == typeof(Size)) {
|
||||
Size size = (Size)valueObject;
|
||||
return String.Format("{0},{1}", size.Width, size.Height);
|
||||
} else if (fieldType == typeof(Rectangle)) {
|
||||
Rectangle rectangle = (Rectangle)valueObject;
|
||||
return String.Format("{0},{1},{2},{3}", rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
|
||||
}
|
||||
return valueObject.ToString();
|
||||
}
|
||||
|
@ -401,7 +411,7 @@ namespace Greenshot.Core {
|
|||
}
|
||||
writer.WriteLine();
|
||||
} else {
|
||||
writer.WriteLine("{0}={1}", iniPropertyAttribute.Name, value);
|
||||
writer.WriteLine("{0}={1}", iniPropertyAttribute.Name, ConvertValueToString(value));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue