Example #1
0
        public void Initialize(string _userID, string groupID, IDynamicGroupOutter _groupOutter)
        {
            this.userID      = _userID;
            this.groupID     = groupID;
            this.groupOutter = _groupOutter;

            #region Emotion
            List <string> tempList        = ESBasic.Helpers.FileHelper.GetOffspringFiles(AppDomain.CurrentDomain.BaseDirectory + "Emotion\\");
            List <string> emotionFileList = new List <string>();
            foreach (string file in tempList)
            {
                string name = file.ToLower();
                if (name.EndsWith(".bmp") || name.EndsWith(".jpg") || name.EndsWith(".jpeg") || name.EndsWith(".png") || name.EndsWith(".gif"))
                {
                    emotionFileList.Add(name);
                }
            }
            emotionFileList.Sort(new Comparison <string>(CompareEmotionName));
            List <Image> emotionList = new List <Image>();
            for (int i = 0; i < emotionFileList.Count; i++)
            {
                emotionList.Add(Image.FromFile(AppDomain.CurrentDomain.BaseDirectory + "Emotion\\" + emotionFileList[i]));
            }
            #endregion

            this.emotionDictionary = new Dictionary <uint, Image>();
            for (uint i = 0; i < emotionList.Count; i++)
            {
                this.emotionDictionary.Add(i, emotionList[(int)i]);
            }

            this.chatBox_his.Initialize(this.emotionDictionary);
            this.chatBox_send.Initialize(this.emotionDictionary);

            this.emotionForm       = new EmotionForm();
            this.emotionForm.Load += new EventHandler(emotionForm_Load);
            this.emotionForm.Initialize(emotionList);
            this.emotionForm.EmotionClicked += new CbGeneric <int, Image>(emotionForm_Clicked);
            this.emotionForm.Visible         = false;
            this.emotionForm.LostFocus      += new EventHandler(emotionForm_LostFocus);
        }
Example #2
0
        public void Initialize(IRapidPassiveEngine _rapidPassiveEngine, IMultimediaManager _multimediaManager, IDynamicGroupOutter dynaGroupOutter, string userID, string owner, bool creater)
        {
            this.Cursor = Cursors.WaitCursor;

            this.rapidPassiveEngine = _rapidPassiveEngine;
            this.multimediaManager  = _multimediaManager;
            this.groupOutter        = dynaGroupOutter;
            this.currentUserID      = userID;
            this.ownerID            = owner;
            this.groupID            = owner;
            this.isCreater          = creater;

            MultimediaManagerHelper.WaitUtilAvailable(this.multimediaManager, 30);
            this.hasInitialized = true;

            this.Text += " - 房主:" + this.ownerID;
            this.toolStripLabel_User.Text = "当前登录:" + this.currentUserID;

            this.textChatControl1.Initialize(this.currentUserID, this.groupID, this.groupOutter);

            this.whiteBoardConnector1.AutoReconnect = false;
            this.whiteBoardConnector1.ConnectEnded += new ESBasic.CbGeneric <OMCS.Passive.ConnectResult>(whiteBoardConnector1_ConnectEnded);

            this.rapidPassiveEngine.BasicOutter.BeingPushedOut += new CbGeneric(BasicOutter_BeingPushedOut);
            this.rapidPassiveEngine.ConnectionInterrupted      += new CbGeneric(TcpPassiveEngine_ConnectionInterrupted);
            this.multimediaManager.ConnectionInterrupted       += new CbGeneric <IPEndPoint>(multimediaManager_ConnectionInterrupted);

            this.groupOutter.BroadcastReceived += new CbGeneric <string, string, int, byte[]>(GroupOutter_BroadcastReceived);
            this.groupOutter.SomeoneQuitGroup  += new CbGeneric <string, string>(GroupOutter_SomeoneQuitGroup);
            this.groupOutter.SomeoneJoinGroup  += new CbGeneric <string, string>(GroupOutter_SomeoneJoinGroup);
            this.groupOutter.GroupmateOffline  += new CbGeneric <string>(groupOutter_GroupmateOffline);
            this.groupOutter.JoinGroup(ownerID);

            this.multiVideoChatContainer1.Initialize(this.multimediaManager, this.ownerID);

            this.whiteBoardConnector1.BeginConnect(this.ownerID);
            this.Cursor = Cursors.Default;
            this.timer  = new System.Threading.Timer(new System.Threading.TimerCallback(this.TimerAction), null, 1000, 1000);
        }
Example #3
0
        public void Initialize(IRapidPassiveEngine _rapidPassiveEngine, IMultimediaManager _multimediaManager, IDynamicGroupOutter dynaGroupOutter, string userID, string owner, bool creater)
        {
            this.Cursor = Cursors.WaitCursor;

            this.rapidPassiveEngine = _rapidPassiveEngine;
            this.multimediaManager = _multimediaManager;
            this.groupOutter = dynaGroupOutter;
            this.currentUserID = userID;
            this.ownerID = owner;
            this.groupID = owner;
            this.isCreater = creater;

            MultimediaManagerHelper.WaitUtilAvailable(this.multimediaManager, 30);
            this.hasInitialized = true;

            this.Text += " - 房主:" + this.ownerID;
            this.toolStripLabel_User.Text = "当前登录:" + this.currentUserID;

            this.textChatControl1.Initialize(this.currentUserID, this.groupID, this.groupOutter);

            this.whiteBoardConnector1.AutoReconnect = false;
            this.whiteBoardConnector1.ConnectEnded += new ESBasic.CbGeneric<OMCS.Passive.ConnectResult>(whiteBoardConnector1_ConnectEnded);

            this.rapidPassiveEngine.BasicOutter.BeingPushedOut += new CbGeneric(BasicOutter_BeingPushedOut);
            this.rapidPassiveEngine.ConnectionInterrupted += new CbGeneric(TcpPassiveEngine_ConnectionInterrupted);
            this.multimediaManager.ConnectionInterrupted += new CbGeneric<IPEndPoint>(multimediaManager_ConnectionInterrupted);

            this.groupOutter.BroadcastReceived += new CbGeneric<string, string, int, byte[]>(GroupOutter_BroadcastReceived);
            this.groupOutter.SomeoneQuitGroup += new CbGeneric<string, string>(GroupOutter_SomeoneQuitGroup);
            this.groupOutter.SomeoneJoinGroup += new CbGeneric<string, string>(GroupOutter_SomeoneJoinGroup);
            this.groupOutter.GroupmateOffline += new CbGeneric<string>(groupOutter_GroupmateOffline);
            this.groupOutter.JoinGroup(ownerID);

            this.multiVideoChatContainer1.Initialize(this.multimediaManager, this.ownerID);

            this.whiteBoardConnector1.BeginConnect(this.ownerID);
            this.Cursor = Cursors.Default;
            this.timer = new System.Threading.Timer(new System.Threading.TimerCallback(this.TimerAction) ,null,1000,1000) ;
        }