[]
Gets an inline style value by the given CSS property name.
public string GetStyleValue(string propertyName)
Type | Name | Description |
---|---|---|
string | propertyName | The CSS property name. |
Type | Description |
---|---|
string | The string value of the given property. |
The example shows how to write a function which returns font size of the selected text.
string GetSelectionFontSize()
{
if (_editor.Mode == EditorMode.Design)
{
string size = _editor.Selection.GetStyleValue("font-size") ?? string.Empty;
return size.EndsWith("pt") ? size.Substring(0, size.Length - 2) : size;
}
else
return string.Empty;
}
Gets an inline style value by the given CSS property name.
public string GetStyleValue(string propertyName, C1StyleType type)
Type | Name | Description |
---|---|---|
string | propertyName | The CSS property name. |
C1StyleType | type | Specifies the type of content to which the inline style will be applied. |
Type | Description |
---|---|
string | The string value of the given property. |