/// <inheritdoc />
        public override bool Matches(IBindingMetadata metadata)
        {
            _ = metadata ?? throw new ArgumentNullException(nameof(metadata));

            return(metadata.Has(nameof(ContentSource)) &&
                   metadata.Get <ContentSource>(nameof(ContentSource)) == this.Source);
        }
        private static bool IsApprovedPackage(IBindingMetadata m, IDictionary <string, IList <ApprovedBundleInfo> > approvedPackages)
        {
            var packageId = m.Get <string>("baristaPackageId");

            if (!approvedPackages.ContainsKey(packageId))
            {
                return(false);
            }

            var bundleInfo = approvedPackages[packageId];

            var bundleTypeFullName = m.Get <string>("bundleTypeFullName");
            var assemblyPath       = m.Get <string>("assemblyPath");
            var assemblyFullName   = m.Get <string>("assemblyFullName");
            var assemblyHash       = m.Get <string>("assemblyHash");

            return
                (bundleInfo.Any(
                     bi => string.Equals(bundleTypeFullName, bi.FullTypeName, StringComparison.OrdinalIgnoreCase) &&
                     string.Equals(assemblyPath, bi.AssemblyPath, StringComparison.OrdinalIgnoreCase) &&
                     string.Equals(assemblyFullName, bi.AssemblyFullName, StringComparison.OrdinalIgnoreCase) &&
                     string.Equals(assemblyHash, bi.AssemblyHash, StringComparison.OrdinalIgnoreCase)));
        }
 public override bool Matches(IBindingMetadata metadata)
 {
     return(metadata.Has("IsSomething") && !metadata.Get <bool> ("IsSomething"));
 }
Beispiel #4
0
 public override bool Matches(IBindingMetadata metadata)
 {
     return(metadata.Has("CanSwim") && !metadata.Get <bool>("CanSwim"));
 }
 public override bool Matches(IBindingMetadata metadata)
 {
     return metadata.Has("CanSwim") && metadata.Get<bool>("CanSwim");
 }
		public override bool Matches (IBindingMetadata metadata)
		{
			return metadata.Has ("IsSomething") && metadata.Get<bool> ("IsSomething");
		}
Beispiel #7
0
 public override bool Matches(IBindingMetadata metadata)
 {
     return(metadata.Has(_name) && metadata.Get <bool>(_name));
 }