Esempio n. 1
0
        private void LinkDerivedClasses()
        {
            foreach (Guid classID in _baseClassReferences.Keys)
            {
                SecurableClassDefinition securableClass = _classes[classID];
                Guid baseClassID = _baseClassReferences[classID];

                if (!_classes.ContainsKey(baseClassID))
                {
                    throw new ImportException(string.Format("The base class '{0}' referenced by the class '{1}' could not be found.", baseClassID, classID));
                }

                SecurableClassDefinition baseClass = _classes[_baseClassReferences[classID]];
                securableClass.BaseClass = baseClass;
            }
        }
Esempio n. 2
0
        private void CreateReferences(
            SecurableClassDefinition securableClassDefinition,
            XmlNode securableClassDefinitionNode,
            XmlNamespaceManager namespaceManager,
            string xpath,
            Dictionary <Guid, List <Guid> > referenceRegistry)
        {
            List <Guid> references     = new List <Guid>();
            XmlNodeList referenceNodes = securableClassDefinitionNode.SelectNodes(xpath, namespaceManager);

            foreach (XmlNode referenceNode in referenceNodes)
            {
                references.Add(new Guid(referenceNode.InnerText));
            }

            referenceRegistry.Add(securableClassDefinition.MetadataItemID, references);
        }
Esempio n. 3
0
        private SecurableClassDefinition CreateSecurableClassDefinition(XmlNamespaceManager namespaceManager, XmlNode securableClassDefinitionNode)
        {
            SecurableClassDefinition securableClassDefinition = SecurableClassDefinition.NewObject();

            securableClassDefinition.Name           = securableClassDefinitionNode.Attributes["name"].Value;
            securableClassDefinition.MetadataItemID = new Guid(securableClassDefinitionNode.Attributes["id"].Value);
            securableClassDefinition.Index          = _securableClassDefinitionCount;
            _securableClassDefinitionCount++;

            if (securableClassDefinitionNode.Attributes["base"] != null)
            {
                Guid baseClassID = new Guid(securableClassDefinitionNode.Attributes["base"].Value);
                _baseClassReferences.Add(securableClassDefinition.MetadataItemID, baseClassID);
            }

            CreateReferences(
                securableClassDefinition, securableClassDefinitionNode, namespaceManager, "md:stateProperties/md:statePropertyRef", _statePropertyReferences);
            CreateReferences(
                securableClassDefinition, securableClassDefinitionNode, namespaceManager, "md:accessTypes/md:accessTypeRef", _accessTypeReferences);

            return(securableClassDefinition);
        }
Esempio n. 4
0
 public static ObjectList <AccessTypeReference> GetAccessTypeReferencesForQuery(this SecurableClassDefinition securableClassDefinition)
 {
     throw new NotSupportedException("GetAccessTypeReferences() is only supported for building LiNQ query expressions.");
 }