Beispiel #1
0
        private static void AddMap(List <DatabaseTypeMap> mapCollection, XmlNodeList nodes)
        {
            foreach (XmlNode node in nodes)
            {
                string typeName    = node.Attributes["type"].Value;
                string uniTypeName = node.Attributes["unitype"].Value;

                UniType         uniType = UniTypes.SingleOrDefault(t => t.Name.ToLowerInvariant() == uniTypeName.ToLowerInvariant());
                DatabaseTypeMap map     = mapCollection.SingleOrDefault(c => c.TypeName.ToLowerInvariant() == typeName.ToLowerInvariant());

                if (map != null)
                {
                    map.UniType = uniType;
                }
                else
                {
                    mapCollection.Add(new DatabaseTypeMap(typeName, uniType));
                }
            }
        }
Beispiel #2
0
        private static bool CreateMapNode(XmlDocument doc, XmlNode sqlServerMapsNode, bool changesExist, DatabaseTypeMap dbType)
        {
            if (SaveUnmodified || dbType.IsModified)
            {
                changesExist = true;
                XmlNode mapNode = doc.CreateElement("map");

                XmlAttribute att = doc.CreateAttribute("type");
                att.Value = dbType.TypeName;
                mapNode.Attributes.Append(att);

                att       = doc.CreateAttribute("unitype");
                att.Value = dbType.UniType == null ? "" : dbType.UniType.Name;
                mapNode.Attributes.Append(att);

                sqlServerMapsNode.AppendChild(mapNode);
            }
            return(changesExist);
        }
Beispiel #3
0
        private static bool CreateMapNode(XmlDocument doc, XmlNode sqlServerMapsNode, bool changesExist, DatabaseTypeMap dbType)
        {
            if (SaveUnmodified || dbType.IsModified)
            {
                changesExist = true;
                XmlNode mapNode = doc.CreateElement("map");

                XmlAttribute att = doc.CreateAttribute("type");
                att.Value = dbType.TypeName;
                mapNode.Attributes.Append(att);

                att = doc.CreateAttribute("unitype");
                att.Value = dbType.UniType == null ? "" : dbType.UniType.Name;
                mapNode.Attributes.Append(att);

                sqlServerMapsNode.AppendChild(mapNode);
            }
            return changesExist;
        }