예제 #1
0
        private string[] SplitResourceKey(ResourceListItem resource, bool isLegacyResource)
        {
            if (!isLegacyResource)
            {
                return(resource.Key.Split(new[] { "." }, StringSplitOptions.RemoveEmptyEntries));
            }

            var key = resource.Key.Remove(0, 1);

            return(key.Split(new[] { "/" }, StringSplitOptions.RemoveEmptyEntries));
        }
        private void UpdateResourceVisibility(ResourceListItem resource, string[] defragmented, ref List <ResourceTreeItem> result)
        {
            for (var ix = defragmented.Length; ix > 0; ix--)
            {
                var path = string.Join(".", defragmented.Take(ix));
                var item = result.FirstOrDefault(r => r.Path == path);

                if (item != null && !resource.IsHidden)
                {
                    item.IsHidden = resource.IsHidden;
                }
            }
        }
예제 #3
0
        private void UpdateResourceVisibility(ResourceListItem resource, string[] defragmented, bool isLegacyModeEnabled, ref List <ResourceTreeItem> result)
        {
            var separator = isLegacyModeEnabled ? "/" : ".";

            for (var ix = defragmented.Length; ix > 0; ix--)
            {
                var path = string.Join(separator, defragmented.Take(ix));
                var item = result.FirstOrDefault(r => r.Path == path);
                if (item != null && !resource.IsHidden)
                {
                    item.IsHidden = resource.IsHidden;
                }
            }
        }