Ejemplo n.º 1
0
        /// <summary>
        /// 构造方法,初始化模块和服务
        /// </summary>
        ///// <param name="username">账号(二维码登录留空)</param>
        ///// <param name="password">密码(二维码登录留空)</param>
        /// <param name="notifyListener">监听器</param>
        /// <param name="actorDispatcher">线程执行器</param>
        /// <param name="logger">日志记录器</param>
        public WebQQClient(QQNotifyListener notifyListener    = null,
                           IQQActorDispatcher actorDispatcher = null, IQQLogger logger = null)
        {
            _modules  = new Dictionary <QQModuleType, IQQModule>();
            _services = new Dictionary <QQServiceType, IQQService>();

            _modules.Add(QQModuleType.LOGIN, new LoginModule());
            _modules.Add(QQModuleType.PROC, new ProcModule());
            _modules.Add(QQModuleType.USER, new UserModule());
            _modules.Add(QQModuleType.BUDDY, new BuddyModule());
            _modules.Add(QQModuleType.CATEGORY, new CategoryModule());
            _modules.Add(QQModuleType.GROUP, new GroupModule());
            _modules.Add(QQModuleType.CHAT, new ChatModule());
            _modules.Add(QQModuleType.DISCUZ, new DiscuzModule());
            _modules.Add(QQModuleType.EMAIL, new EmailModule());
            _services.Add(QQServiceType.HTTP, new HttpService());

            Account = new QQAccount
            {
                Username = string.Empty,
                Password = string.Empty
            };
            Session          = new QQSession();
            Store            = new QQStore();
            NotifyListener   = notifyListener;
            _actorDispatcher = actorDispatcher ?? new SimpleActorDispatcher();
            Logger           = logger ?? new EmptyQQLogger();
            Logger.Context   = this;
            Init();
        }
Ejemplo n.º 2
0
        /**
         * 构造方法,初始化模块和服务
         * 账号/密码    监听器     线程执行器
         *
         * @param username a {@link java.lang.String} object.
         * @param password a {@link java.lang.String} object.
         * @param notifyListener a {@link iqq.im.QQNotifyListener} object.
         * @param actorDispatcher a {@link iqq.im.actor.ThreadActorDispatcher} object.
         */
        public WebQQClient(
            QQNotifyListener notifyListener, ThreadActorDispatcher actorDispatcher)
        {
            this.modules = new Dictionary <AbstractModule.Type, AbstractModule>();

            this.modules.Add(AbstractModule.Type.LOGIN, new LoginModule());
            this.modules.Add(AbstractModule.Type.PROC, new ProcModule());
            this.modules.Add(AbstractModule.Type.USER, new UserModule());
            this.modules.Add(AbstractModule.Type.BUDDY, new BuddyModule());
            this.modules.Add(AbstractModule.Type.CATEGORY, new CategoryModule());
            this.modules.Add(AbstractModule.Type.GROUP, new GroupModule());
            this.modules.Add(AbstractModule.Type.CHAT, new ChatModule());
            //this.modules.Add(AbstractModule.Type.DISCUZ, new DiscuzModule());
            //this.modules.Add(AbstractModule.Type.EMAIL, new EmailModule());

            //this.modules.Add(AbstractModule.Type.QM_LOGIN, new QmLoginModule());
            //this.modules.Add(AbstractModule.Type.QM_PROC, new QmProcModule());
            //this.modules.Add(AbstractModule.Type.QM_MGR, new QmMgrModule());

            //this.modules.Add(AbstractModule.Type.WB_LOGIN, new WbLoginModule());
            //this.modules.Add(AbstractModule.Type.WB_PROC, new WbProcModule());

            this.service = new ApacheHttpService();

            this.session         = new QQSession();
            this.store           = new QQStore();
            this.notifyListener  = notifyListener;
            this.actorDispatcher = actorDispatcher;

            this.init();
        }
Ejemplo n.º 3
0
        private void AfterInitialize()
        {
            _notifyListener = GetListener();

            var rightButtonCms = new ContextMenuStrip();
            var tsmiRemove     = new ToolStripMenuItem()
            {
                Text = "移除"
            };

            tsmiRemove.Click += (sender, e) =>
            {
                var tsmi = sender as ToolStripMenuItem;
                var cms  = tsmi?.Owner as ContextMenuStrip;
                if (cms != null)
                {
                    var lv = cms.SourceControl as ListView;
                    if (lv == lvQQList)
                    {
                        RemoveSelectedQQFromList();
                    }
                }
            };
            rightButtonCms.Items.Add(tsmiRemove);
            lvQQList.ContextMenuStrip = rightButtonCms;
        }
Ejemplo n.º 4
0
        private void AfterInitialize()
        {
            _notifyListener = GetListener();

            var rightButtonCms = new ContextMenuStrip();
            var tsmiRemove = new ToolStripMenuItem() { Text = "移除" };
            tsmiRemove.Click += (sender, e) =>
            {
                var tsmi = sender as ToolStripMenuItem;
                var cms = tsmi?.Owner as ContextMenuStrip;
                if (cms != null)
                {
                    var lv = cms.SourceControl as ListView;
                    if (lv == lvQQList)
                    {
                        RemoveSelectedQQFromList();
                    }
                }
            };
            rightButtonCms.Items.Add(tsmiRemove);
            lvQQList.ContextMenuStrip = rightButtonCms;
        }