/// <summary> /// Enable the TextEffect on the target. If the texteffect is /// already enabled, this will be a no-op. /// </summary> public void Enable() { TextEffectCollection textEffects = DynamicPropertyReader.GetTextEffects(_element); if (textEffects == null) { textEffects = new TextEffectCollection(); // use it as reference to avoid creating a copy (Freezable pattern) _element.SetValue(TextElement.TextEffectsProperty, textEffects); } // check whether this instance is already enabled for (int i = 0; i < textEffects.Count; i++) { if (textEffects[i] == _effect) { return; // no-op } } // use this as reference. textEffects.Add(_effect); }
/// <summary> Disables the <see cref="T:System.Windows.Media.TextEffect" /> on the effect target. </summary> // Token: 0x06003927 RID: 14631 RVA: 0x00103270 File Offset: 0x00101470 public void Disable() { TextEffectCollection textEffects = DynamicPropertyReader.GetTextEffects(this._element); if (textEffects != null) { for (int i = 0; i < textEffects.Count; i++) { if (textEffects[i] == this._effect) { textEffects.RemoveAt(i); return; } } } }
/// <summary> /// Disable TextEffect on the target. If the texteffect is /// already disabled, this will be a no-op. /// </summary> public void Disable() { TextEffectCollection textEffects = DynamicPropertyReader.GetTextEffects(_element); if (textEffects != null) { for (int i = 0; i < textEffects.Count; i++) { if (textEffects[i] == _effect) { // remove the exact instance of the effect from the collection textEffects.RemoveAt(i); return; } } } }
/// <summary>Enables the <see cref="T:System.Windows.Media.TextEffect" /> on the target text. </summary> // Token: 0x06003926 RID: 14630 RVA: 0x00103210 File Offset: 0x00101410 public void Enable() { TextEffectCollection textEffectCollection = DynamicPropertyReader.GetTextEffects(this._element); if (textEffectCollection == null) { textEffectCollection = new TextEffectCollection(); this._element.SetValue(TextElement.TextEffectsProperty, textEffectCollection); } for (int i = 0; i < textEffectCollection.Count; i++) { if (textEffectCollection[i] == this._effect) { return; } } textEffectCollection.Add(this._effect); }