Esempio n. 1
0
        public override IEnumerable <NamespaceDeclaration> GetNamespacePrefixes()
        {
            ObjectWriterFrame frame = _stack.CurrentFrame;
            HashSet <string>  keys  = new HashSet <string>();

            while (frame.Depth > 0)
            {
                if (frame._namespaces != null)
                {
                    foreach (NamespaceDeclaration namespaceDeclaration in frame.GetNamespacePrefixes())
                    {
                        if (keys.Add(namespaceDeclaration.Prefix))
                        {
                            yield return(namespaceDeclaration);
                        }
                    }
                }
                frame = (ObjectWriterFrame)frame.Previous;
            }
        }
        public override IEnumerable <NamespaceDeclaration> GetNamespacePrefixes()
        {
            ObjectWriterFrame           frame = _stack.CurrentFrame;
            Dictionary <string, string> keys  = new Dictionary <string, string>();

            while (frame.Depth > 0)
            {
                if (frame._namespaces != null)
                {
                    foreach (NamespaceDeclaration namespaceDeclaration in frame.GetNamespacePrefixes())
                    {
                        if (!keys.ContainsKey(namespaceDeclaration.Prefix))
                        {
                            keys.Add(namespaceDeclaration.Prefix, null);
                            yield return(namespaceDeclaration);
                        }
                    }
                }
                frame = (ObjectWriterFrame)frame.Previous;
            }
        }
        public override IEnumerable <NamespaceDeclaration> GetNamespacePrefixes()
        {
            ObjectWriterFrame           currentFrame      = this._stack.CurrentFrame;
            Dictionary <string, string> iteratorVariable1 = new Dictionary <string, string>();

            while (currentFrame.Depth > 0)
            {
                if (currentFrame._namespaces != null)
                {
                    foreach (NamespaceDeclaration iteratorVariable2 in currentFrame.GetNamespacePrefixes())
                    {
                        if (iteratorVariable1.ContainsKey(iteratorVariable2.Prefix))
                        {
                            continue;
                        }
                        iteratorVariable1.Add(iteratorVariable2.Prefix, null);
                        yield return(iteratorVariable2);
                    }
                }
                currentFrame = (ObjectWriterFrame)currentFrame.Previous;
            }
        }