Small fixes which make it easier to check if an IniValue is fixed, also changed the Component.Enabled in the settingsForm for some more properties. In normal English, if I have defined a property in the "greenshot-fixed.ini" the matching setting can not be changed!

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2260 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-11-09 13:46:20 +00:00
commit 0b1a0c3d55
5 changed files with 38 additions and 19 deletions

View file

@ -47,12 +47,29 @@ namespace Greenshot.IniFile {
this.attributes = iniPropertyAttribute;
}
/// <summary>
/// Return true when the value is fixed
/// </summary>
public bool IsFixed {
get {
if (attributes != null) {
return attributes.FixedValue;
}
return false;
}
set {
if (attributes != null) {
attributes.FixedValue = value;
}
}
}
public MemberInfo MemberInfo {
get {
if (propertyInfo == null) {
return fieldInfo;
} else {
return propertyInfo;
return propertyInfo;
}
}
}
@ -104,7 +121,7 @@ namespace Greenshot.IniFile {
if (propertyInfo == null) {
valueType = fieldInfo.FieldType;
} else {
valueType = propertyInfo.PropertyType;
valueType = propertyInfo.PropertyType;
}
if (valueType.IsGenericType && valueType.GetGenericTypeDefinition().Equals(typeof(Nullable<>))) {
// We are dealing with a generic type that is nullable