/// <summary> /// Sets the owner and must only be called once /// </summary> /// <param name="textView">Text view</param> /// <param name="owner">Owner</param> public static void SetOwner(ITextView textView, ICustomLineNumberMarginOwner owner) { if (textView == null) throw new ArgumentNullException(nameof(textView)); if (owner == null) throw new ArgumentNullException(nameof(owner)); GetMargin(textView).SetOwner(owner); }
void ICustomLineNumberMargin.SetOwner(ICustomLineNumberMarginOwner owner) { if (owner == null) throw new ArgumentNullException(nameof(owner)); if (this.owner != null) throw new InvalidOperationException(); this.owner = owner; if (Visibility == Visibility.Visible) owner.OnVisible(); RefreshMargin(); }
/// <summary> /// Sets the owner and must only be called once /// </summary> /// <param name="textView">Text view</param> /// <param name="owner">Owner</param> public static void SetOwner(ITextView textView, ICustomLineNumberMarginOwner owner) { if (textView is null) { throw new ArgumentNullException(nameof(textView)); } if (owner is null) { throw new ArgumentNullException(nameof(owner)); } GetMargin(textView).SetOwner(owner); }
void ICustomLineNumberMargin.SetOwner(ICustomLineNumberMarginOwner owner) { if (owner == null) { throw new ArgumentNullException(nameof(owner)); } if (this.owner != null) { throw new InvalidOperationException(); } this.owner = owner; if (Visibility == Visibility.Visible) { owner.OnVisible(); } RefreshMargin(); }