public override void ApplyPropertyChange(DocumentNodeChange change) { base.ApplyPropertyChange(change); if (!RichTextBoxRangeElement.ShouldClearPropertyOnTextRuns((SceneNode)this.TextSource, new PropertyReference((ReferenceStep)change.PropertyKey))) { return; } this.ClearTextProperty(change.PropertyKey); }
private bool IsRichTextBoxRange(SceneNodeObjectSet sceneNodeObjectSet) { if (sceneNodeObjectSet.IsMultiSelection || sceneNodeObjectSet.Count != 1) { return(true); } RichTextBoxRangeElement textBoxRangeElement = sceneNodeObjectSet.Objects[0] as RichTextBoxRangeElement; if (textBoxRangeElement == null) { return(false); } return(PlatformTypes.RichTextBox.IsAssignableFrom((ITypeId)textBoxRangeElement.TextEditProxy.TextSource.Type)); }
public override bool IsTextChange(DocumentNodeChange change) { if (base.IsTextChange(change)) { return(true); } if (change.PropertyKey != null) { ReferenceStep singleStep = this.ResolveProperty((IPropertyId)change.PropertyKey) as ReferenceStep; if (singleStep != null) { return(RichTextBoxRangeElement.IsTextProperty((SceneNode)this.TextSource, new PropertyReference(singleStep))); } } return(false); }
internal override object GetTextValueAtPoint(Point point, bool snapToText, PropertyReference propertyReference) { IViewTextPointer positionFromPoint = this.RichTextBox.GetPositionFromPoint(point); PropertyReference propertyReference1 = this.DesignerContext.PropertyManager.FilterProperty((ITypeResolver)this.ProjectContext, positionFromPoint.Parent.GetIType((ITypeResolver)this.ProjectContext), propertyReference); if (propertyReference1 == null) { return(this.GetComputedValue(propertyReference)); } object textPointerValue = RichTextBoxRangeElement.GetTextPointerValue(positionFromPoint, propertyReference1); if (DependencyProperty.UnsetValue == textPointerValue) { return(MixedProperty.Mixed); } return(textPointerValue); }
private void ClearPropertyOnTextRuns(PropertyReference propertyReference) { if (!RichTextBoxRangeElement.ShouldClearPropertyOnTextRuns((SceneNode)this, propertyReference)) { return; } propertyReference = propertyReference.Subreference(0, 0); foreach (SceneNode sceneNode in SceneElementHelper.GetElementTree((SceneElement)this)) { TextElementSceneElement elementSceneElement = sceneNode as TextElementSceneElement; if (elementSceneElement != null) { PropertyReference propertyReference1 = this.DesignerContext.PropertyManager.FilterProperty((SceneNode)elementSceneElement, propertyReference); if (propertyReference1 != null) { elementSceneElement.ClearValue(propertyReference1); } } } }