Example #1
0
 void AddNode(string str)
 {
     if (this.treeView1.InvokeRequired)
     {
         AddNodeDel del = new AddNodeDel(AddNode);
         this.treeView1.Invoke(del, str);
     }
     else
     {
         this.treeView1.Nodes.Add(new TreeNode(str));
     }
 }
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="zk">ZK地址,多个以“,”分割</param>
 /// <param name="path">CodisProxy实例名</param>
 /// <param name="addNodeDel">增加节点的委托事件</param>
 /// <param name="deleteNodeDel">移除节点的委托事件</param>
 public CodisWatcher(ZooKeeperClient zk, string path, AddNodeDel addNodeDel, DeleteNodeDel deleteNodeDel) : base(zk)
 {
     this.addNodeDel    = addNodeDel;
     this.deleteNodeDel = deleteNodeDel;
     this.path          = path;
 }