示例#1
0
        internal void AddReference(ContentItemViewModelReference contentItem, PackageViewModel package)
        {
            List <PackageReference> packages;

            if (!_references.TryGetValue(contentItem.ContentItem, out packages))
            {
                packages = new List <PackageReference>();
                _references.Add(contentItem.ContentItem, packages);
            }

            packages.Add(new PackageReference {
                IsExplicit = contentItem.IsExplicit, Package = package
            });

            // Notify
            if (ReferenceAdded != null)
            {
                ReferenceAdded(this, new ReferenceArgs()
                {
                    ContentItem = contentItem, Package = package
                });
            }
        }
示例#2
0
 private void RegisterPackage(PackageViewModel item)
 {
     _packagesPerId.Add(item.Id, item);
     item.Items.CollectionChanged += PackageItems_CollectionChanged;
     item.PropertyChanged         += Package_PropertyChanged;
 }
示例#3
0
        internal bool HasExplicitReferencesToPackage(ContentItemViewModel contentItem, PackageViewModel package)
        {
            List <PackageReference> packages = null;

            _references.TryGetValue(contentItem, out packages);

            return(packages != null &&
                   packages.Any(p => p.IsExplicit == true && p.Package == package));
        }
示例#4
0
 public LayoutContentItemViewModel(ContentItemBase contentItemBase, PackageViewModel package)
     : base(contentItemBase)
 {
     _package = package;
 }