コード例 #1
0
        protected void DeactivateLeftContent(IList <IStatusBarContent> contentSet)
        {
            foreach (var content in contentSet)
            {
                if (content is IDisposable disposable)
                {
                    disposable.Dispose();
                }

                LeftContentCollection.Remove(content);
            }
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
        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);
        }