Esempio n. 1
0
        private void AddLink(ref Dictionary <AssetId, AssetLink> dictionary, AssetLink contentLink)
        {
            if (dictionary == null)
            {
                dictionary = new Dictionary <AssetId, AssetLink>();
            }

            var id = contentLink.Element.Id;

            if (dictionary.ContainsKey(id))
            {
                contentLink.Type |= dictionary[id].Type;
            }

            dictionary[id] = contentLink;
        }
Esempio n. 2
0
        private void AddLink(ref Dictionary <AssetId, AssetLink> dictionary, AssetLink contentLink)
        {
            if (dictionary == null)
            {
                dictionary = new Dictionary <AssetId, AssetLink>();
            }

            var id = contentLink.Element.Id;

            if (dictionary.TryGetValue(id, out var existingLink))
            {
                contentLink.Type |= existingLink.Type;
            }

            dictionary[id] = contentLink;
        }
Esempio n. 3
0
 /// <summary>
 /// Adds a link going to the provided element.
 /// </summary>
 /// <param name="contentLink">The link out</param>
 /// <exception cref="ArgumentException">A link to this element already exists</exception>
 public void AddLinkOut(AssetLink contentLink)
 {
     AddLink(ref children, contentLink);
 }
Esempio n. 4
0
 /// <summary>
 /// Adds a link coming from the provided element.
 /// </summary>
 /// <param name="contentLink">The link in</param>
 /// <exception cref="ArgumentException">A link from this element already exists</exception>
 public void AddLinkIn(AssetLink contentLink)
 {
     AddLink(ref parents, contentLink);
 }