bool HasDecorations(swd.TextRange range, sw.TextDecorationCollection decorations) { swd.TextRange realRange; var existingDecorations = range.GetRealPropertyValue(swd.Inline.TextDecorationsProperty, out realRange) as sw.TextDecorationCollection; return(existingDecorations != null && decorations.All(r => existingDecorations.Contains(r))); }
bool HasDecorations(swd.TextRange range, sw.TextDecorationCollection decorations, bool useRealPropertyValue = true) { swd.TextRange realRange; sw.TextDecorationCollection existingDecorations; if (useRealPropertyValue) { existingDecorations = range.GetRealPropertyValue(swd.Inline.TextDecorationsProperty, out realRange) as sw.TextDecorationCollection; } else { existingDecorations = range.GetPropertyValue(swd.Inline.TextDecorationsProperty) as sw.TextDecorationCollection; } return(existingDecorations != null && decorations.All(r => existingDecorations.Contains(r))); }
bool HasDecorations(swd.TextRange range, sw.TextDecorationCollection decorations) { var existingDecorations = GetPropertyValue(range, swd.Inline.TextDecorationsProperty) as sw.TextDecorationCollection; return(existingDecorations != null && decorations.All(r => existingDecorations.Contains(r))); }