private static void ReadDefinitions(DefinitionsDictionary definitions, XElement parent, string parentPath)
        {
            int pos;
            string path;
            string parseletValue;
            string parselet;
            string valueType;

            foreach (XElement _child in parent.Elements("Element"))
            {
                path = (parentPath == String.Empty) ? _child.Attribute("Tag").Value : String.Concat(parentPath, ".", _child.Attribute("Tag").Value);
                parseletValue = _child.Attribute("Parselet").Value;
                pos = parseletValue.IndexOf('.');
                if (pos >= 0)
                {
                    parselet = parseletValue.Substring(0, pos);
                    valueType = parseletValue.Substring(pos + 1);
                }
                else
                {
                    parselet = parseletValue;
                    valueType = String.Empty;
                }
                definitions.Add(path, new D900CdrElementDefinition(path, _child.Attribute("Name").Value, parselet, valueType));
                ReadDefinitions(definitions, _child, path);
            }
        }
Exemplo n.º 2
0
        private static void ReadDefinitions(DefinitionsDictionary definitions, XPathNavigator parent, string parentPath)
        {
            int    pos;
            string path;
            string parseletValue;
            string parselet;
            string valueType;

            foreach (XPathNavigator _child in parent.SelectChildren("Element", String.Empty))
            {
                path          = String.IsNullOrEmpty(parentPath) ? _child.GetAttribute("Tag", String.Empty) : String.Concat(parentPath, ".", _child.GetAttribute("Tag", String.Empty));
                parseletValue = _child.GetAttribute("Parselet", String.Empty);
                pos           = parseletValue.IndexOf('.');
                if (pos >= 0)
                {
                    parselet  = parseletValue.Substring(0, pos);
                    valueType = parseletValue.Substring(pos + 1);
                }
                else
                {
                    parselet  = parseletValue;
                    valueType = String.Empty;
                }
                definitions.Add(path, new CdrElementDefinition(path, _child.GetAttribute("Name", String.Empty), parselet, valueType));
                ReadDefinitions(definitions, _child, path);
            }
        }
Exemplo n.º 3
0
        private static void ReadDefinitions(DefinitionsDictionary definitions, XElement parent, string parentPath)
        {
            int    pos;
            string path;
            string parseletValue;
            string parselet;
            string valueType;

            foreach (XElement _child in parent.Elements("Element"))
            {
                path          = (parentPath == String.Empty) ? _child.Attribute("Tag").Value : String.Concat(parentPath, ".", _child.Attribute("Tag").Value);
                parseletValue = _child.Attribute("Parselet").Value;
                pos           = parseletValue.IndexOf('.');
                if (pos >= 0)
                {
                    parselet  = parseletValue.Substring(0, pos);
                    valueType = parseletValue.Substring(pos + 1);
                }
                else
                {
                    parselet  = parseletValue;
                    valueType = String.Empty;
                }
                definitions.Add(path, new CdrElementDefinition(path, _child.Attribute("Name").Value, parselet, valueType));
                ReadDefinitions(definitions, _child, path);
            }
        }
 public D900CdrDefinitionSchema(string schemaName)
 {
     _schemaName = schemaName;
     _definitions = new Dictionary<string, ID900CdrElementDefinition>();
 }
        private static void ReadDefinitions(DefinitionsDictionary definitions, XPathNavigator parent, string parentPath)
        {
            int pos;
            string path;
            string parseletValue;
            string parselet;
            string valueType;

            foreach (XPathNavigator _child in parent.SelectChildren("Element", String.Empty))
            {
                path = String.IsNullOrEmpty(parentPath) ? _child.GetAttribute("Tag", String.Empty) : String.Concat(parentPath, ".", _child.GetAttribute("Tag", String.Empty));
                parseletValue = _child.GetAttribute("Parselet", String.Empty);
                pos = parseletValue.IndexOf('.');
                if (pos >= 0)
                {
                    parselet = parseletValue.Substring(0, pos);
                    valueType = parseletValue.Substring(pos + 1);
                }
                else
                {
                    parselet = parseletValue;
                    valueType = String.Empty;
                }
                definitions.Add(path, new D900CdrElementDefinition(path, _child.GetAttribute("Name", String.Empty), parselet, valueType));
                ReadDefinitions(definitions, _child, path);
            }
        }
Exemplo n.º 6
0
 public CdrDefinitionSchema(string schemaName)
 {
     _schemaName  = schemaName;
     _definitions = new Dictionary <string, ICdrElementDefinition>();
 }