Beispiel #1
0
        public OverlayLinkModel(OverlayLinkModel link, IdeCollection <IdeBaseItem> source) : base(source)  //copy
        {
            var _linkDefinition = new LinkDefinition()
            {
                Block            = link._wrapper.Link.Block,
                NestedProperties = new List <Property>()
            };

            _wrapper = new LinkDefinition.LinkWrapper()
            {
                Link = _linkDefinition
            };
        }
Beispiel #2
0
 public void AddLink(OverlayLinkModel link, int index)
 {
     // if the next item is the OverlayLinkContainer
     if (index < Items.Count && Items[index] is OverlayLinkContainer nextContainer)
     {
         nextContainer.AddLink(0, link);
     }
     // if the previous item is the OverlayLinkContainer
     else if (index > 0 && Items[index - 1] is OverlayLinkContainer previousContainer)
     {
         previousContainer.AddLink(previousContainer.Items.Count, link);
     }
     // if there isn't any adjacent OverlayLinkContainers
     else
     {
         var newContainer = new OverlayLinkContainer(Items);
         newContainer.Items.CollectionChanged += (a, b) =>
         {
             OnContainerChanged?.Invoke(this, b);
         };
         Items.Insert(index, newContainer);
         newContainer.AddLink(0, link);
     }
 }
Beispiel #3
0
 public void AddLink(int index, OverlayLinkModel link)
 {
     Items.Insert(index, new OverlayLinkModel(link, Items));
 }