コード例 #1
0
        public static KeyValuePair <RegistrationEntryKey, RegistrationCatalogEntry> Promote(string resourceUri, IGraph graph)
        {
            INode  subject = graph.CreateUriNode(new Uri(resourceUri));
            string version = graph.GetTriplesWithSubjectPredicate(subject, graph.CreateUriNode(Schema.Predicates.Version)).First().Object.ToString();

            RegistrationEntryKey registrationEntryKey = new RegistrationEntryKey(RegistrationKey.Promote(resourceUri, graph), version);

            RegistrationCatalogEntry registrationCatalogEntry = IsDelete(subject, graph) ? null : new RegistrationCatalogEntry(resourceUri, graph);

            return(new KeyValuePair <RegistrationEntryKey, RegistrationCatalogEntry>(registrationEntryKey, registrationCatalogEntry));
        }
コード例 #2
0
        public override bool Equals(object obj)
        {
            RegistrationEntryKey rhs = obj as RegistrationEntryKey;

            if (rhs == null)
            {
                return(false);
            }

            return(RegistrationKey.Equals(rhs.RegistrationKey) &&
                   _normalizedVersion == rhs._normalizedVersion);
        }
コード例 #3
0
        public static KeyValuePair<RegistrationEntryKey, RegistrationCatalogEntry> Promote(string resourceUri, IGraph graph, bool isExistingItem)
        {
            INode subject = graph.CreateUriNode(new Uri(resourceUri));
            string version = graph.GetTriplesWithSubjectPredicate(subject, graph.CreateUriNode(Schema.Predicates.Version)).First().Object.ToString();

            RegistrationEntryKey registrationEntryKey = new RegistrationEntryKey(RegistrationKey.Promote(resourceUri, graph), version);

            RegistrationCatalogEntry registrationCatalogEntry = IsDelete(subject, graph) 
                ? null 
                : new RegistrationCatalogEntry(resourceUri, graph, isExistingItem);

            return new KeyValuePair<RegistrationEntryKey, RegistrationCatalogEntry>(registrationEntryKey, registrationCatalogEntry);
        }
コード例 #4
0
        public static KeyValuePair <RegistrationEntryKey, RegistrationCatalogEntry> Promote(
            string resourceUri,
            IGraph graph,
            ShouldIncludeRegistrationPackage shouldInclude,
            bool isExistingItem)
        {
            INode  subject = graph.CreateUriNode(new Uri(resourceUri));
            var    triples = graph.GetTriplesWithSubjectPredicate(subject, graph.CreateUriNode(Schema.Predicates.Version));
            string version = triples.First().Object.ToString();

            var registrationEntryKey = new RegistrationEntryKey(RegistrationKey.Promote(resourceUri, graph), version);

            RegistrationCatalogEntry registrationCatalogEntry = null;

            if (!IsDelete(subject, graph) && shouldInclude(registrationEntryKey, resourceUri, graph))
            {
                registrationCatalogEntry = new RegistrationCatalogEntry(resourceUri, graph, isExistingItem);
            }

            return(new KeyValuePair <RegistrationEntryKey, RegistrationCatalogEntry>(registrationEntryKey, registrationCatalogEntry));
        }