Exemple #1
0
            public static bool Verify(InstanceDeclaration instance)
            {
                bool        result = true;
                XmlNodeList list   = instance.Node.SelectNodes("ea:Pivot", instance.Document.NamespaceManager);
                Dictionary <uint, string> hashMap = new Dictionary <uint, string>();

                foreach (XmlNode pivot in list)
                {
                    string name = pivot.Attributes["Name"]?.Value;
                    if (string.IsNullOrEmpty(name))
                    {
                        _tracer.TraceError("W3DHierarchy {0} has a pivot without a name.", instance.Node.Attributes["id"].Value);
                        result = false;
                    }
                    uint hash = HashProvider.GetCaseInsensitiveSymbolHash(name);
                    if (hashMap.ContainsKey(hash))
                    {
                        _tracer.TraceError("W3DHierarchy {0} has two pivots ('{1}' and '{2}') sharing a common hash", instance.Node.Attributes["id"].Value, hashMap[hash], name);
                        result = false;
                    }
                    else
                    {
                        hashMap.Add(hash, name);
                    }
                }
                return(result);
            }