コード例 #1
0
        static void GetNameClassRepresentatives(
            RdpNameClass n, Hashtable names)
        {
            if (n is RdpAnyName)
            {
                names [illegalQName] = illegalQName;
                return;
            }
            RdpAnyNameExcept exc = n as RdpAnyNameExcept;

            if (exc != null)
            {
                GetNameClassRepresentatives(exc.ExceptNameClass, names);
                names [illegalQName] = illegalQName;
                return;
            }
            RdpNsName ns = n as RdpNsName;

            if (ns != null)
            {
                QName nn = new QName(String.Empty, ns.NamespaceURI);
                names [nn] = nn;
                return;
            }
            RdpNsNameExcept nse = n as RdpNsNameExcept;

            if (nse != null)
            {
                GetNameClassRepresentatives(nse.ExceptNameClass, names);
                QName nn = new QName(String.Empty, nse.NamespaceURI);
                names [nn] = nn;
                return;
            }
            RdpName name = n as RdpName;

            if (name != null)
            {
                QName qname = new QName(name.LocalName, name.NamespaceURI);
                names [qname] = qname;
                return;
            }
            else
            {
                RdpNameClassChoice c = (RdpNameClassChoice)n;
                GetNameClassRepresentatives(c.LValue, names);
                GetNameClassRepresentatives(c.RValue, names);
                return;
            }
        }
コード例 #2
0
        static void GetNameClassRepresentatives(
            RdpNameClass n, IList <QName> names)
        {
            if (n is RdpAnyName)
            {
                if (!names.Contains(illegalQName))
                {
                    names.Add(illegalQName);
                }
                return;
            }
            RdpAnyNameExcept exc = n as RdpAnyNameExcept;

            if (exc != null)
            {
                GetNameClassRepresentatives(exc.ExceptNameClass, names);
                if (!names.Contains(illegalQName))
                {
                    names.Add(illegalQName);
                }
                return;
            }
            RdpNsName ns = n as RdpNsName;

            if (ns != null)
            {
                QName nn = new QName(String.Empty, ns.NamespaceURI);
                if (!names.Contains(nn))
                {
                    names.Add(nn);
                }
                return;
            }
            RdpNsNameExcept nse = n as RdpNsNameExcept;

            if (nse != null)
            {
                GetNameClassRepresentatives(nse.ExceptNameClass, names);
                QName nn = new QName(String.Empty, nse.NamespaceURI);
                if (!names.Contains(nn))
                {
                    names.Add(nn);
                }
                return;
            }
            RdpName name = n as RdpName;

            if (name != null)
            {
                QName qname = new QName(name.LocalName, name.NamespaceURI);
                if (!names.Contains(qname))
                {
                    names.Add(qname);
                }
                return;
            }
            else
            {
                RdpNameClassChoice c = (RdpNameClassChoice)n;
                GetNameClassRepresentatives(c.LValue, names);
                GetNameClassRepresentatives(c.RValue, names);
                return;
            }
        }