Example #1
0
 public void OnServerChanged(object sender, dp2ServerChangedEventArgs e)
 {
     if (this.ServerChanged != null)
     {
         this.ServerChanged(sender, e);
     }
 }
Example #2
0
        // 创建一个新的Server对象
        // return:
        //		-1	出错
        //		0	加入了
        //		1	发现重复,没有加入
        public int NewServer(
            string strName,
            string strUrl,
            int nInsertPos)
        {
            dp2Server server = null;

            // 暂时不去重

            server      = new dp2Server();
            server.Url  = strUrl;
            server.Name = strName;

            if (nInsertPos == -1)
            {
                this.Add(server);
            }
            else
            {
                this.Insert(nInsertPos, server);
            }

            m_bChanged = true;

            dp2ServerChangedEventArgs e = new dp2ServerChangedEventArgs();

            e.Url = strUrl;
            e.ServerChangeAction = dp2ServerChangeAction.Add;
            OnServerChanged(this, e);

            return(0);
        }
Example #3
0
        // 将另一对象的数组内容灌入本对象
        public void Import(dp2ServerCollection servers)
        {
            this.Clear();
            this.AddRange(servers);
            this.m_bChanged = true;

            // 新增加的动作
            dp2ServerChangedEventArgs e = new dp2ServerChangedEventArgs();

            e.Url = "";
            e.ServerChangeAction = dp2ServerChangeAction.Import;
            OnServerChanged(this, e);
        }
Example #4
0
        public void OnServerChanged(object sender, dp2ServerChangedEventArgs e)
        {
            if (this.ServerChanged != null)
            {
                this.ServerChanged(sender, e);
            }

        }
Example #5
0
        // 创建一个新的Server对象
        // return:
        //		-1	出错
        //		0	加入了
        //		1	发现重复,没有加入
        public int NewServer(
            string strName,
            string strUrl,
            int nInsertPos)
        {
            dp2Server server = null;
            // 暂时不去重

            server = new dp2Server();
            server.Url = strUrl;
            server.Name = strName;

            if (nInsertPos == -1)
                this.Add(server);
            else
                this.Insert(nInsertPos, server);

            m_bChanged = true;

            dp2ServerChangedEventArgs e = new dp2ServerChangedEventArgs();
            e.Url = strUrl;
            e.ServerChangeAction = dp2ServerChangeAction.Add;
            OnServerChanged(this, e);

            return 0;
        }
Example #6
0
        // 将另一对象的数组内容灌入本对象
        public void Import(dp2ServerCollection servers)
        {
            this.Clear();
            this.AddRange(servers);
            this.m_bChanged = true;

            // 新增加的动作
            dp2ServerChangedEventArgs e = new dp2ServerChangedEventArgs();
            e.Url = "";
            e.ServerChangeAction = dp2ServerChangeAction.Import;
            OnServerChanged(this, e);

        }