コード例 #1
0
        /// <summary>
        /// The SASL mechanisms valid for this stream.
        /// </summary>
        /// <returns></returns>
        public Mechanism[] GetMechanisms()
        {
            XmlNodeList nl = GetElementsByTagName("mechanism", URI.SASL);

            Mechanism[] items = new Mechanism[nl.Count];
            int         i     = 0;

            foreach (XmlNode n in nl)
            {
                items[i] = (Mechanism)n;
                i++;
            }
            return(items);
        }
コード例 #2
0
        /// <summary>
        /// The SASL mechanisms valid for this stream.
        /// </summary>
        /// <returns></returns>
        public Mechanism[] GetMechanisms()
        {
            XmlNodeList nl = GetElementsByTagName("mechanism", URI.SASL);
            Dictionary <string, Mechanism> items = new Dictionary <string, Mechanism>();

            foreach (XmlNode n in nl)
            {
                string name = ((Mechanism)n).MechanismName;

                if (!items.ContainsKey(name))
                {
                    items.Add(name, (Mechanism)n);
                }
            }
            Mechanism[] array = new Mechanism[items.Count];

            items.Values.CopyTo(array, 0);
            return(array);
        }
コード例 #3
0
ファイル: SASL.cs プロジェクト: rankida/HangoutPhone
 /// <summary>
 /// The SASL mechanisms valid for this stream.
 /// </summary>
 /// <returns></returns>
 public Mechanism[] GetMechanisms()
 {
     XmlNodeList nl = GetElementsByTagName("mechanism", URI.SASL);
     Mechanism[] items = new Mechanism[nl.Count];
     int i=0;
     foreach (XmlNode n in nl)
     {
         items[i] = (Mechanism) n;
         i++;
     }
     return items;
 }