protected void DeactivateLeftContent(IList <IStatusBarContent> contentSet) { foreach (var content in contentSet) { if (content is IDisposable disposable) { disposable.Dispose(); } LeftContentCollection.Remove(content); } }
public void DeactivateContent(IStatusBarContent content) { var leftContent = LeftContentCollection.Where(p => p == content).ToList(); if (leftContent.Any()) { DeactivateLeftContent(leftContent); } var rightContent = RightContentCollection.Where(p => p == content).ToList(); if (rightContent.Any()) { DeactivateRightContent(rightContent); } }
public void DeactivateContent(string instanceId) { var leftContent = LeftContentCollection .Where(p => !string.IsNullOrEmpty(p.ContentId) && p.ContentId.Equals(instanceId, StringComparison.OrdinalIgnoreCase)) .ToList(); if (leftContent.Any()) { LeftContentCollection.RemoveRange(leftContent); } var rightContent = RightContentCollection .Where(p => !string.IsNullOrEmpty(p.ContentId) && p.ContentId.Equals(instanceId, StringComparison.OrdinalIgnoreCase)) .ToList(); if (rightContent.Any()) { RightContentCollection.RemoveRange(rightContent); } }
public IStatusBarContent ActivateContent(IStatusBarContent content, StatusBarContentLocation location) { DeactivateContent(content); switch (location) { case StatusBarContentLocation.Left: LeftContentCollection.AddSorted(content, DisplayOrderComparer.Default); break; case StatusBarContentLocation.Right: RightContentCollection.AddSorted(content, DisplayOrderComparer.Default); break; default: throw new ArgumentOutOfRangeException(nameof(location), location, null); } return(content); }