Exemplo n.º 1
0
Arquivo: MyForm.cs Projeto: gvhung/dp2
        // parameters:
        //      strStyle    风格。如果为 GUI,表示会自动添加 Idle 事件,并在其中执行 Application.DoEvents
        public LibraryChannel GetChannel(string strServerUrl   = ".",
                                         string strUserName    = "******",
                                         GetChannelStyle style = GetChannelStyle.GUI)
        {
            LibraryChannel channel = this.MainForm.GetChannel(strServerUrl, strUserName, style);

            _channelList.Add(channel);
            // TODO: 检查数组是否溢出
            return(channel);
        }
Exemplo n.º 2
0
        public LibraryChannel GetChannel(string strServerUrl,
                                         string strUserName,
                                         GetChannelStyle style = GetChannelStyle.GUI)
        {
            if (EntityRegisterBase.IsDot(strServerUrl) == true)
            {
                strServerUrl = Program.MainForm.LibraryServerUrl;
            }
            if (EntityRegisterBase.IsDot(strUserName) == true)
            {
                strUserName = Program.MainForm.DefaultUserName;
            }

            LibraryChannel channel = this._channelPool.GetChannel(strServerUrl, strUserName);

            if ((style & GetChannelStyle.GUI) != 0)
            {
                channel.Idle += channel_Idle;
            }
            return(channel);
        }
Exemplo n.º 3
0
        public LibraryChannel GetChannel(string strServerUrl,
            string strUserName,
            GetChannelStyle style = GetChannelStyle.GUI)
        {
            if (EntityRegisterBase.IsDot(strServerUrl) == true)
                strServerUrl = this.MainForm.LibraryServerUrl;
            if (EntityRegisterBase.IsDot(strUserName) == true)
                strUserName = this.MainForm.DefaultUserName;

            LibraryChannel channel =  this._channelPool.GetChannel(strServerUrl, strUserName);
            if ((style & GetChannelStyle.GUI) != 0)
                channel.Idle += channel_Idle;
            return channel;
        }
Exemplo n.º 4
0
 // parameters:
 //      strStyle    风格。如果为 GUI,表示会自动添加 Idle 事件,并在其中执行 Application.DoEvents
 public LibraryChannel GetChannel(string strServerUrl = ".",
     string strUserName = "******",
     GetChannelStyle style = GetChannelStyle.GUI)
 {
     LibraryChannel channel = this.MainForm.GetChannel(strServerUrl, strUserName, style);
     _channelList.Add(channel);
     // TODO: 检查数组是否溢出
     return channel;
 }