ToDictionary() публичный Метод

public ToDictionary ( ) : IDictionary
Результат IDictionary
Пример #1
0
        public void RoundTripHT(NodeInfo ni)
        {
            NodeInfo ni_other = NodeInfo.CreateInstance(ni.ToDictionary());

            Assert.AreEqual(ni, ni_other, "Hashtable roundtrip");
            Assert.AreEqual(ni.GetHashCode(), ni_other.GetHashCode(), "Hashtable GetHashCode roundtrip");
        }
Пример #2
0
        public IDictionary ToDictionary()
        {
            IDictionary ht = new ListDictionary();

            if (_local_ni != null)
            {
                ht["local"] = _local_ni.ToDictionary();
            }
            if (_remote_ni != null)
            {
                ht["remote"] = _remote_ni.ToDictionary();
            }
            if (_token != null)
            {
                ht["token"] = _token.ToString();
            }
            if (_attributes != null)
            {
                foreach (DictionaryEntry de in _attributes)
                {
                    ht[de.Key] = de.Value;
                }
            }
            return(ht);
        }
Пример #3
0
        public IDictionary ToDictionary()
        {
            ListDictionary ht = new ListDictionary();

            ht["type"]   = _ct;
            ht["target"] = _target_ni.ToDictionary();
            ht["token"]  = _token;
            ArrayList neighs = new ArrayList(Neighbors.Length);

            foreach (NodeInfo ni in Neighbors)
            {
                neighs.Add(ni.ToDictionary());
            }
            ht["neighbors"] = neighs;
            return(ht);
        }
Пример #4
0
        public IDictionary ToDictionary()
        {
            IDictionary ht = new ListDictionary();

            if (Local != null)
            {
                ht["local"] = Local.ToDictionary();
            }
            if (Remote != null)
            {
                ht["remote"] = Remote.ToDictionary();
            }
            ht["token"] = Token;
            ht["realm"] = Realm;
            ht["type"]  = ConTypeString;
            return(ht);
        }
Пример #5
0
 public void RoundTripHT(NodeInfo ni) {
   NodeInfo ni_other = NodeInfo.CreateInstance( ni.ToDictionary() );
   Assert.AreEqual(ni, ni_other, "Hashtable roundtrip");
   Assert.AreEqual(ni.GetHashCode(), ni_other.GetHashCode(), "Hashtable GetHashCode roundtrip");
 }