コード例 #1
0
        public bool Disconnect(object dtu)
        {
            FileDtuConnection fc = this.GetConnection(dtu as DtuNode) as FileDtuConnection;

            if (this.OnConnectStatusChanged != null)
            {
                this.OnConnectStatusChanged(fc, WorkingStatus.NA, WorkingStatus.IDLE);
            }
            return(true);
        }
コード例 #2
0
        public IDtuConnection GetConnection(DtuNode node)
        {
            FileDtuConnection fc    = null;
            string            dtuId = node.DtuCode;

            if (!this._connectPool.ContainsKey(dtuId))
            {
                fc = new FileDtuConnection(node);
                this._connectPool[dtuId] = fc;
            }
            else
            {
                fc = this._connectPool[dtuId];
            }
            return(fc);
        }