Brunet.Connections.ConnectToMessage.ToDictionary C# (CSharp) Метод

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

public ToDictionary ( ) : IDictionary
Результат IDictionary
    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;
    }
    

Usage Example

Пример #1
0
        override public void Start()
        {
            ProtocolLog.WriteIf(ProtocolLog.LinkDebug,
                                String.Format("{0}: Starting Connector: {1}, {2}",
                                              _local_node.Address, _sender, State));
            AbortCheck ac = _abort.Value;

            if (ac != null)
            {
                if (ac(this))
                {
                    //We are no longer needed:
                    QueueCloseHandler(null, null);
                    return;
                }
            }

            RpcManager rpc = _local_node.Rpc;

            Channel results = new Channel();

            results.EnqueueEvent += this.EnqueueHandler;
            results.CloseEvent   += this.QueueCloseHandler;
            try {
                rpc.Invoke(_sender, results, "sys:ctm.ConnectTo", _ctm.ToDictionary());
            }
            catch {
                //Looks like the _sender had some problem:
                QueueCloseHandler(null, null);
            }
        }
All Usage Examples Of Brunet.Connections.ConnectToMessage::ToDictionary