[Foundation] Move NSAttributedStringDocumentAttributes.HyphenationFator to shared code.
This property has also been added on macOS (where it didn't exist before), since both documentation and headers reveal it's available there.
This commit is contained in:
Родитель
01f770c24d
Коммит
a34b630304
|
@ -41,21 +41,6 @@ namespace Foundation {
|
||||||
|
|
||||||
public partial class NSAttributedStringDocumentAttributes : DictionaryContainer {
|
public partial class NSAttributedStringDocumentAttributes : DictionaryContainer {
|
||||||
#if !MONOMAC && !COREBUILD
|
#if !MONOMAC && !COREBUILD
|
||||||
public float? HyphenationFactor {
|
|
||||||
get {
|
|
||||||
return GetFloatValue (NSAttributedStringDocumentAttributeKey.NSHyphenationFactorDocumentAttribute);
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
if (value is null)
|
|
||||||
RemoveValue (NSAttributedStringDocumentAttributeKey.NSHyphenationFactorDocumentAttribute);
|
|
||||||
else {
|
|
||||||
if (value < 0 || value > 1.0f)
|
|
||||||
throw new ArgumentException ("value must be between 0 and 1");
|
|
||||||
SetNumberValue (NSAttributedStringDocumentAttributeKey.NSHyphenationFactorDocumentAttribute, value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public float? DefaultTabInterval {
|
public float? DefaultTabInterval {
|
||||||
get {
|
get {
|
||||||
return GetFloatValue (NSAttributedStringDocumentAttributeKey.NSDefaultTabIntervalDocumentAttribute);
|
return GetFloatValue (NSAttributedStringDocumentAttributeKey.NSDefaultTabIntervalDocumentAttribute);
|
||||||
|
|
|
@ -42,6 +42,18 @@ namespace Foundation {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public float? HyphenationFactor {
|
||||||
|
get {
|
||||||
|
return GetFloatValue (NSAttributedStringDocumentAttributeKey.NSHyphenationFactorDocumentAttribute);
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
if (value < 0 || value > 1.0f)
|
||||||
|
throw new ArgumentOutOfRangeException (nameof (value), value, "Value must be between 0 and 1");
|
||||||
|
|
||||||
|
SetNumberValue (NSAttributedStringDocumentAttributeKey.NSHyphenationFactorDocumentAttribute, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public NSStringEncoding? StringEncoding {
|
public NSStringEncoding? StringEncoding {
|
||||||
get {
|
get {
|
||||||
return (NSStringEncoding?) (long?) GetNIntValue (NSAttributedStringDocumentAttributeKey.NSCharacterEncodingDocumentAttribute);
|
return (NSStringEncoding?) (long?) GetNIntValue (NSAttributedStringDocumentAttributeKey.NSCharacterEncodingDocumentAttribute);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче