public Form_login(IRapidPassiveEngine rapidPassiveEngine,Form_main formMain) { this.engine = rapidPassiveEngine; this._main = formMain; InitializeComponent(); }
public UpdateUserInfoForm(IRapidPassiveEngine engine, GlobalUserCache globalUserCache, GGUser user) { InitializeComponent(); this.rapidPassiveEngine = engine; this.currentUser = user; int registerPort = int.Parse(ConfigurationManager.AppSettings["RemotingPort"]); this.ggService = (IRemotingService)Activator.GetObject(typeof(IRemotingService), string.Format("tcp://{0}:{1}/RemotingService", ConfigurationManager.AppSettings["ServerIP"], registerPort));; this.skinLabel_ID.Text = user.UserID; this.skinTextBox_nickName.SkinTxt.Text = user.Name; this.skinTextBox_signature.SkinTxt.Text = user.Signature; if (user.HeadImageIndex >= 0) { this.headImageIndex = user.HeadImageIndex; this.pnlImgTx.BackgroundImage = GlobalResourceManager.GetHeadImage(user); //根据ID获取头像 } else { this.pnlImgTx.BackgroundImage = user.HeadImage; this.selfPhoto = true; } }
public Form_login(IRapidPassiveEngine rapidPassiveEngine, Form_main formMain) { this.engine = rapidPassiveEngine; this._main = formMain; InitializeComponent(); }
public LoginForm(IRapidPassiveEngine engine, ICustomizeHandler handler) { this.rapidPassiveEngine = engine; this.customizeHandler = handler; int registerPort = int.Parse(ConfigurationManager.AppSettings["RemotingPort"]); this.remotingService = (IRemotingService)Activator.GetObject(typeof(IRemotingService), string.Format("tcp://{0}:{1}/RemotingService", ConfigurationManager.AppSettings["ServerIP"], registerPort));; InitializeComponent(); Dictionary <UserStatus, Image> statusImageDictionary = new Dictionary <UserStatus, Image>(); statusImageDictionary.Add(UserStatus.Online, this.imageList_state.Images[0]); statusImageDictionary.Add(UserStatus.Away, this.imageList_state.Images[1]); statusImageDictionary.Add(UserStatus.Busy, this.imageList_state.Images[2]); statusImageDictionary.Add(UserStatus.DontDisturb, this.imageList_state.Images[3]); statusImageDictionary.Add(UserStatus.Hide, this.imageList_state.Images[4]); statusImageDictionary.Add(UserStatus.OffLine, this.imageList_state.Images[5]); GlobalResourceManager.SetStatusImage(statusImageDictionary); this.skinLabel_SoftName.Text = GlobalResourceManager.SoftwareName; this.checkBoxRememberPwd.Checked = SystemSettings.Singleton.RememberPwd; this.checkBoxAutoLogin.Checked = SystemSettings.Singleton.AutoLogin; this.textBoxId.SkinTxt.Text = SystemSettings.Singleton.LastLoginUserID; if (SystemSettings.Singleton.RememberPwd) { this.textBoxPwd.SkinTxt.Text = "11111111"; this.pwdMD5 = SystemSettings.Singleton.LastLoginPwdMD5; this.pwdIsMD5 = true; } }
public Updater(string serverIP, int serverPort) { this.UpdateStarted += new CbGeneric(Updater_UpdateStarted); this.UpdateDisruptted += new CbGeneric <string>(Updater_UpdateDisruptted); this.UpdateCompleted += new CbGeneric(Updater_UpdateCompleted); DirectoryInfo dir = new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory); this.appDirPath = dir.FullName + "\\"; this.rapidPassiveEngine = RapidEngineFactory.CreatePassiveEngine(); this.rapidPassiveEngine.AutoReconnect = true; Random random = new Random(); //初始化引擎并登录,返回登录结果 bool canLogon = false; for (int i = 0; i < 100; i++) { string userid = random.Next(1000000).ToString("00000"); LogonResponse logonResponse = rapidPassiveEngine.Initialize(userid, "", serverIP, serverPort, null); if (logonResponse.LogonResult == LogonResult.Succeed) { canLogon = true; break; } } if (!canLogon) { throw new Exception("连接自动更新服务器失败 !"); } this.rapidPassiveEngine.ConnectionInterrupted += new CbGeneric(rapidPassiveEngine_ConnectionInterrupted); this.rapidPassiveEngine.RelogonCompleted += new CbGeneric <LogonResponse>(rapidPassiveEngine_RelogonCompleted); }
public void Initialize(IRapidPassiveEngine engine) { this.userID = engine.CurrentUserID; this.rapidPassiveEngine = engine; //预订断线事件 this.rapidPassiveEngine.ConnectionInterrupted += new CbGeneric(rapidPassiveEngine_ConnectionInterrupted); //预订重连开始事件 this.rapidPassiveEngine.ConnectionRebuildStart += new CbGeneric(rapidPassiveEngine_ConnectionRebuildStart); //预订重连成功并重新登录事件 this.rapidPassiveEngine.RelogonCompleted += new CbGeneric <LogonResponse>(rapidPassiveEngine_RelogonCompleted); //预订好友上线的事件 this.rapidPassiveEngine.FriendsOutter.FriendConnected += new CbGeneric <string>(FriendOutter_FriendConnected); //预订好友下线的事件 this.rapidPassiveEngine.FriendsOutter.FriendOffline += new CbGeneric <string>(FriendOutter_FriendOffline); //预订自己被踢出掉线的事件 this.rapidPassiveEngine.BasicOutter.BeingKickedOut += new CbGeneric(BasicOutter_BeingKickedOut); //预订自己被挤掉线的事件 this.rapidPassiveEngine.BasicOutter.BeingPushedOut += new CbGeneric(BasicOutter_BeingPushedOut); //预定收到了来自发送方发送文件(夹)的请求的事件 this.rapidPassiveEngine.FileOutter.FileRequestReceived += new CbFileRequestReceived(fileOutter_FileRequestReceived); //预定接收方回复了同意/拒绝接收文件(夹)时的事件 this.rapidPassiveEngine.FileOutter.FileResponseReceived += new CbGeneric <TransferingProject, bool>(fileOutter_FileResponseReceived); //预订接收到广播消息的处理事件 this.rapidPassiveEngine.GroupOutter.BroadcastReceived += new CbGeneric <string, string, int, byte[]>(GroupOutter_BroadcastReceived); this.toolStripLabel_loginfo.Text = string.Format("当前登录:{0}", this.userID); this.toolStripLabel_state.Text = "连接状态:正常"; this.InitializeFriends(); }
public Form_Search(IRapidPassiveEngine rapidPassiveEngine, ChatListSubItem myInfo) { this.myInfo = myInfo; this.rapidPassiveEngine = rapidPassiveEngine; this.ReceiveUserList = new CallbackHandler(diaplayUser);//实例化收到消息时回调方法的委托 InitializeComponent(); }
public GlobalUserCache(IRapidPassiveEngine engine) { this.rapidPassiveEngine = engine; string persistenceFilePath = SystemSettings.SystemSettingsDir + engine.CurrentUserID + ".dat"; this.Initialize(this.rapidPassiveEngine.CurrentUserID, persistenceFilePath, GlobalConsts.CompanyGroupID, GlobalResourceManager.Logger); }
public NoticeForm(IRapidPassiveEngine engine, IGroup supporter) { InitializeComponent(); this.rapidPassiveEngine = engine; this.ggSupporter = supporter; int registerPort = int.Parse(ConfigurationManager.AppSettings["RemotingPort"]); }
public Form_login(IRapidPassiveEngine rapidPassiveEngine,Form_main formMain) { this.engine = rapidPassiveEngine; this._main = formMain; this.settings = SystemSettings.Singleton; InitializeComponent(); //initTxt(); }
public JoinGroupForm(IRapidPassiveEngine engine, IChatSupporter supporter) { InitializeComponent(); this.rapidPassiveEngine = engine; this.ggSupporter = supporter; int registerPort = int.Parse(ConfigurationManager.AppSettings["RemotingPort"]); }
public Form_Chat(IRapidPassiveEngine rapidPassiveEngine, ChatListSubItem item, ChatListSubItem userItem, Form_main main) { main.Receive += new Form_main.ReceiveEventHandler(ChatHandleReceive);//注册收到信息时的事件处理程序ChatHandleReceive this.userItem = userItem; this.item = item; this.rapidPassiveEngine = rapidPassiveEngine; InitializeComponent(); }
public AddFriendForm(IRapidPassiveEngine engine, IChatSupporter supporter, GGUser currentUser, string friendID) { InitializeComponent(); this.Icon = GlobalResourceManager.Icon64; this.rapidPassiveEngine = engine; this.ggSupporter = supporter; this.skinComboBox1.DataSource = currentUser.GetFriendCatalogList(); this.skinComboBox1.SelectedIndex = 0; this.skinTextBox_id.SkinTxt.Text = friendID ?? ""; }
/// <summary> /// Constructor. /// </summary> public Updater() { mRapidPassiveEngine = RapidEngineFactory.CreatePassiveEngine(); mRapidPassiveEngine.AutoReconnect = true; mRapidPassiveEngine.ConnectionInterrupted += new CbGeneric(RapidPassiveEngine_ConnectionInterrupted); mRapidPassiveEngine.RelogonCompleted += new CbGeneric <LogonResponse>(RapidPassiveEngine_RelogonCompleted); Event_UpdateStarted += new CbGeneric(Updater_UpdateStarted); Event_UpdateDisruptted += new CbGeneric <string>(Updater_UpdateDisruptted); Event_UpdateCompleted += new CbGeneric(Updater_UpdateCompleted); }
public Form_Chat(IRapidPassiveEngine rapidPassiveEngine, ChatListSubItem contactInfo, ChatListSubItem myInfo, Form_main main) { //注册收到信息时的事件处理程序ChatHandleReceive main.Receive += new Form_main.ReceiveEventHandler(ChatHandleReceive); //传入变量 this.contactInfo = contactInfo; this.myInfo = myInfo; this.rapidPassiveEngine = rapidPassiveEngine; InitializeComponent(); }
public NoticeRecordForm(IChatRecordPersister remote, IChatRecordPersister local, Parameter <string, string> gr, Parameter <string, string> _my, IUserNameGetter getter, IRapidPassiveEngine engine, IGroup supporter) { InitializeComponent(); this.chatBox_history.Initialize(GlobalResourceManager.EmotionDictionary); this.isGroupChat = true; this.group = gr; this.my = _my; this.userNameGetter = getter; this.Text = "群公告记录 - " + gr.Arg2; this.remotePersister = remote; this.localPersister = local; this.rapidPassiveEngine = engine; this.ggSupporter = supporter; }
public UpdateGroupInfoForm(IRapidPassiveEngine engine, GlobalUserCache cache, GGGroup group) { InitializeComponent(); this.rapidPassiveEngine = engine; this.currentGroup = group; int registerPort = int.Parse(ConfigurationManager.AppSettings["RemotingPort"]); this.ggService = (IRemotingService)Activator.GetObject(typeof(IRemotingService), string.Format("tcp://{0}:{1}/RemotingService", ConfigurationManager.AppSettings["ServerIP"], registerPort));; this.skinLabel_ID.Text = group.ID; this.skinTextBox_nickName.SkinTxt.Text = group.Name; this.skinTextBox_signature.SkinTxt.Text = group.Announce; globalUserCache = cache; }
public GroupChatForm(IRapidPassiveEngine engine, string groupID, GlobalUserCache cache, IChatSupporter supporter) { this.rapidPassiveEngine = engine; this.globalUserCache = cache; this.mine = this.globalUserCache.GetUser(this.rapidPassiveEngine.CurrentUserID); this.ggSupporter = supporter; this.currentGroup = this.globalUserCache.GetGroup(groupID); InitializeComponent(); this.chatBoxSend.Initialize(GlobalResourceManager.EmotionDictionary); this.chatBox_history.Initialize(GlobalResourceManager.EmotionDictionary); this.chatBoxSend.Font = SystemSettings.Singleton.Font; this.chatBoxSend.ForeColor = SystemSettings.Singleton.FontColor; this.Size = SystemSettings.Singleton.ChatFormSize; this.linkLabel_softName.Text = GlobalResourceManager.SoftwareName; this.toolShow.SetToolTip(this.panelFriendHeadImage, this.currentGroup.GroupID); this.Text = string.Format("{0}({1})", this.currentGroup.Name, this.currentGroup.GroupID); this.labelGroupName.Text = this.currentGroup.Name; this.label_announce.Text = this.currentGroup.Announce; this.chatBoxSend.Focus(); this.emotionForm = new EmotionForm(); this.emotionForm.Load += new EventHandler(emotionForm_Load); this.emotionForm.Initialize(GlobalResourceManager.EmotionList); this.emotionForm.EmotionClicked += new CbGeneric <int, Image>(emotionForm_Clicked); this.emotionForm.Visible = false; this.emotionForm.LostFocus += new EventHandler(emotionForm_LostFocus); foreach (string memberID in this.currentGroup.MemberList) { GGUser friend = this.globalUserCache.GetUser(memberID); this.AddUserItem(friend); } if (SystemSettings.Singleton.LoadLastWordsWhenChatFormOpened) { LastWordsRecord record = this.currentGroup.Tag as LastWordsRecord; if (record != null) { string talker = string.Format("{0}({1})", record.SpeakerName, record.SpeakerID); this.AppendChatBoxContent(talker, record.SpeakTime, record.ChatBoxContent, Color.Blue); } } }
public GroupFileForm(IGroupFilePersister remote, Parameter <string, string> gr, Parameter <string, string> _my, IUserNameGetter getter, IRapidPassiveEngine engine, IGroup supporter) { InitializeComponent(); this.listView1.View = View.Details; // ListView listView1 = new ListView(); // Set the view to show details. listView1.View = View.Details; // Allow the user to edit item text. listView1.LabelEdit = true; // Allow the user to rearrange columns. listView1.AllowColumnReorder = true; // Display check boxes. 是否显示复选框 listView1.CheckBoxes = false; // Select the item and subitems when selection is made. 是否选中整行 listView1.FullRowSelect = true; // Display grid lines. 是否显示网格 listView1.GridLines = true; // Sort the items in the list in ascending order. 升序还是降序 listView1.Sorting = SortOrder.Ascending; ImageList imgList = new ImageList(); imgList.ImageSize = new Size(1, 36); //分别是宽和高 listView1.SmallImageList = imgList; //这里设置listView的SmallImageList ,用imgList将其撑大 this.listView1.Columns.Add("编号", 60, HorizontalAlignment.Left); this.listView1.Columns.Add("文件名称", 360, HorizontalAlignment.Left); this.listView1.Columns.Add("大小", 80, HorizontalAlignment.Left); this.listView1.Columns.Add("上传人", 120, HorizontalAlignment.Left); this.listView1.Columns.Add("上传日期", 160, HorizontalAlignment.Left); this.listView1.Visible = true; this.isGroupChat = true; this.group = gr; this.my = _my; this.userNameGetter = getter; this.Text = "群文件 - " + gr.Arg2; this.remotePersister = remote; this.rapidPassiveEngine = engine; this.ggSupporter = supporter; }
static void Main() { try { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); GlobalResourceManager.PreInitialize(); //ESPlus.GlobalUtil.SetMaxLengthOfUserID(20); ESPlus.GlobalUtil.SetMaxLengthOfMessage(1024 * 1024 * 10); //OMCS.GlobalUtil.SetMaxLengthOfUserID(20); MainForm mainForm = new MainForm(); IRapidPassiveEngine passiveEngine = RapidEngineFactory.CreatePassiveEngine(); NDiskPassiveHandler nDiskPassiveHandler = new NDiskPassiveHandler(); //V 2.0 ComplexCustomizeHandler complexHandler = new ComplexCustomizeHandler(nDiskPassiveHandler, mainForm); //V 2.0 LoginForm loginForm = new LoginForm(passiveEngine, complexHandler); if (loginForm.ShowDialog() != DialogResult.OK) { return; } #region 初始化OMCS Program.MultimediaManager = MultimediaManagerFactory.GetSingleton(); Program.MultimediaManager.CameraDeviceIndex = SystemSettings.Singleton.WebcamIndex; Program.MultimediaManager.MicrophoneDeviceIndex = SystemSettings.Singleton.MicrophoneIndex; Size?okSize = OMCS.Tools.Camera.MatchCameraVideoSize(SystemSettings.Singleton.WebcamIndex, GlobalConsts.CommonQualityVideo); Program.MultimediaManager.CameraVideoSize = okSize == null ? new Size(320, 240) : okSize.Value; Program.MultimediaManager.OmcsLogger = GlobalResourceManager.Logger; Program.MultimediaManager.CameraEncodeQuality = 10; Program.MultimediaManager.Initialize(passiveEngine.CurrentUserID, "", ConfigurationManager.AppSettings["ServerIP"], int.Parse(ConfigurationManager.AppSettings["OmcsServerPort"])); #endregion nDiskPassiveHandler.Initialize(passiveEngine.FileOutter, null); mainForm.Initialize(passiveEngine, loginForm.LoginStatus, loginForm.StateImage); Application.Run(mainForm); } catch (Exception ee) { MessageBoxEx.Show(ee.Message); ee = ee; } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); IRapidPassiveEngine rapidPassiveEngine = ESPlus.Rapid.RapidEngineFactory.CreatePassiveEngine(); Form_main mainForm = new Form_main(); Form_login loginForm = new Form_login(rapidPassiveEngine, mainForm); //在LoginForm中初始化客户端引擎RapidPassiveEngine if (loginForm.ShowDialog() != DialogResult.OK) { } else { mainForm.InitMain(rapidPassiveEngine); Application.Run(mainForm); } }
public void InitMain(IRapidPassiveEngine rapidPassiveEngine) { if (this.myInfo == null) { this.myInfo = new ChatListSubItem(); } this.rapidPassiveEngine = rapidPassiveEngine; this.myInfo.ID = Convert.ToUInt32(rapidPassiveEngine.CurrentUserID); //加载分组 ChatListItem gp = new ChatListItem();//new一个分组 gp.Text = "TestList"; ChatListSubItem people = new ChatListSubItem(); if (myInfo.ID == 10010) { lbl_userName.Text = "联通"; people.ID = 10086; //ID people.NicName = "移动"; //昵称 people.DisplayName = "X"; //备注名 people.PersonalMsg = "买买买买买"; } else if (myInfo.ID == 10086) { lbl_userName.Text = "移动"; people.ID = 10010; //ID people.NicName = "联通"; //昵称 people.DisplayName = "X"; //备注名 people.PersonalMsg = "买买买买买"; } gp.SubItems.Add(people); //chatListBox_contacts.GetSubItemsById();//按照ID查找listbox中的用户 chatListBox_contacts.Items.Add(gp);//添加到listBox中 //预订接收到广播消息的处理事件 this.rapidPassiveEngine.GroupOutter.BroadcastReceived += new CbGeneric <string, string, int, byte[]>(GroupOutter_BroadcastReceived); //预订断线事件 this.rapidPassiveEngine.ConnectionInterrupted += new CbGeneric(rapidPassiveEngine_ConnectionInterrupted); }
static void Main() { try { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); IRapidPassiveEngine rapidPassiveEngine = ESPlus.Rapid.RapidEngineFactory.CreatePassiveEngine(); MainForm mainForm = new MainForm(); LoginForm loginForm = new LoginForm(rapidPassiveEngine, mainForm); //在LoginForm中初始化客户端引擎RapidPassiveEngine if (loginForm.ShowDialog() != DialogResult.OK) { return; } mainForm.Initialize(rapidPassiveEngine); Application.Run(mainForm); } catch (Exception ee) { MessageBox.Show(ee.Message); } }
public void Initialize(IRapidPassiveEngine engine, IMultimediaManager mgr) { this.rapidPassiveEngine = engine; this.multimediaManager = mgr; this.multimediaManager.AudioCaptured += new CbGeneric <byte[]>(multimediaManager_AudioCaptured); this.dynamicCameraConnector1.DisplayVideoParameters = true; // 在视频图像上面打印视频的相关信息(视频尺寸、编码质量、帧频)。 this.microphoneConnector1.AudioDataReceived += new CbGeneric <byte[]>(microphoneConnector1_AudioDataReceived); this.microphoneConnector1.Disconnected += new CbGeneric <ConnectorDisconnectedType>(microphoneConnector1_Disconnected); this.cameraConnector1.Disconnected += new CbGeneric <ConnectorDisconnectedType>(cameraConnector1_Disconnected); this.skinCheckBox_camera.Checked = this.multimediaManager.OutputVideo; //如果是ConnectOnlyWhenNeed,则每次都会重新创建multimediaManager this.skinCheckBox_mic.Checked = this.multimediaManager.OutputAudio; //如果是ConnectOnlyWhenNeed,则每次都会重新创建multimediaManager if (!this.isWaitingAnswer) //同意视频,开始连接 { this.OnAgree(); } this.channelQualityDisplayer1.Initialize(this.friendID); this.switchCameraSzieCallbackTimer.DetectSpanInSecs = 1; this.switchCameraSzieCallbackTimer.Start(); }
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); }
public void Initialize(IRapidPassiveEngine engine, IMultimediaManager mgr) { this.rapidPassiveEngine = engine; this.multimediaManager = mgr; this.multimediaManager.CameraEncodeQuality = 6; this.multimediaManager.AudioCaptured += new CbGeneric<byte[]>(multimediaManager_AudioCaptured); this.dynamicCameraConnector1.DisplayVideoParameters = true; // 在视频图像上面打印视频的相关信息(视频尺寸、编码质量、帧频)。 this.microphoneConnector1.AudioDataReceived += new CbGeneric<byte[]>(microphoneConnector1_AudioDataReceived); this.microphoneConnector1.Disconnected += new CbGeneric<ConnectorDisconnectedType>(microphoneConnector1_Disconnected); this.cameraConnector1.Disconnected += new CbGeneric<ConnectorDisconnectedType>(cameraConnector1_Disconnected); this.skinCheckBox_camera.Checked = this.multimediaManager.OutputVideo;//如果是ConnectOnlyWhenNeed,则每次都会重新创建multimediaManager this.skinCheckBox_mic.Checked = this.multimediaManager.OutputAudio; //如果是ConnectOnlyWhenNeed,则每次都会重新创建multimediaManager if (!this.isWaitingAnswer) //同意视频,开始连接 { this.OnAgree(); } this.channelQualityDisplayer1.Initialize(this.friendID); this.switchCameraSzieCallbackTimer.DetectSpanInSecs = 1; this.switchCameraSzieCallbackTimer.Start(); }
public SystemSettingForm(string _userID, string _groupID, IMultimediaManager _multimediaManager, IRapidPassiveEngine engine) { InitializeComponent(); this.multimediaManager = _multimediaManager; this.userID = _userID; this.groupID = _groupID; this.rapidPassiveEngine = engine; IList <CameraInformation> cameras = Camera.GetCameras(); this.comboBox_webcam.DataSource = cameras; if (cameras.Count == 0) { UserConfiguration.Singleton.WebcamIndex = 0; } else { if (cameras.Count >= UserConfiguration.Singleton.WebcamIndex + 1) { this.comboBox_webcam.SelectedIndex = UserConfiguration.Singleton.WebcamIndex; } else { this.comboBox_webcam.SelectedIndex = 0; } } if (UserConfiguration.Singleton.ButtballIsOpen) { this.radioButton_openButtball.Checked = true; //this.radioButton_closeButtball.Checked = false; } else { this.radioButton_closeButtball.Checked = true; //this.radioButton_openButtball.Checked = false; } }
public UpdateUserInfoForm(IRapidPassiveEngine engine,GlobalUserCache globalUserCache, GGUser user) { InitializeComponent(); this.rapidPassiveEngine = engine; this.currentUser = user ; int registerPort = int.Parse(ConfigurationManager.AppSettings["RemotingPort"]); this.ggService = (IRemotingService)Activator.GetObject(typeof(IRemotingService), string.Format("tcp://{0}:{1}/RemotingService", ConfigurationManager.AppSettings["ServerIP"], registerPort)); ; this.skinLabel_ID.Text = user.UserID; this.skinTextBox_nickName.SkinTxt.Text = user.Name; this.skinTextBox_signature.SkinTxt.Text = user.Signature; if (user.HeadImageIndex >= 0) { this.headImageIndex = user.HeadImageIndex; this.pnlImgTx.BackgroundImage = GlobalResourceManager.GetHeadImage(user); //根据ID获取头像 } else { this.pnlImgTx.BackgroundImage = user.HeadImage; this.selfPhoto = true; } }
public LoginForm(IRapidPassiveEngine engine, MainForm _mainForm) { InitializeComponent(); this.rapidPassiveEngine = engine; this.mainForm = _mainForm; }
public void InitMain(IRapidPassiveEngine rapidPassiveEngine) { //显示托盘 tray.Visible = true; //传入通信引擎 this.rapidPassiveEngine = rapidPassiveEngine; //吸附窗口边缘 hide hide1 = new hide(this, timer_Adsorption); //获取个人信息 if (this.myInfo == null) { this.myInfo = new ChatListSubItemExtend(); } this.myInfo.ID = Convert.ToUInt32(rapidPassiveEngine.CurrentUserID); //窗口显示用户ID this.ReceiveMyInfo = new CallbackHandler(diaplayUser);//实例化收到消息时回调方法的委托 this.rapidPassiveEngine.CustomizeOutter.Query(null, Constant.MSG_QUERYUSER, System.Text.Encoding.UTF8.GetBytes(myInfo.ID.ToString()), ReceiveMyInfo, new Object()); //载入好友列表 displayFriend(); //预订接收到广播消息的处理事件 this.rapidPassiveEngine.GroupOutter.BroadcastReceived += new CbGeneric<string, string, int, byte[]>(GroupOutter_BroadcastReceived); //预订断线处理事件 this.rapidPassiveEngine.ConnectionInterrupted += new CbGeneric(rapidPassiveEngine_ConnectionInterrupted); //好友下线处理事件 this.rapidPassiveEngine.FriendsOutter.FriendOffline += new CbGeneric<string>(FriendOffline); //好友上线处理事件 this.rapidPassiveEngine.FriendsOutter.FriendConnected += new CbGeneric<string>(FriendConnected); }
public EMallServerProxy(IRapidPassiveEngine _engine) { this.engine = _engine; }
//, Image headImage, string nickName, ChatListSubItem.UserStatus userStatus, Image stateImage) /// <summary> /// 初始化流程: /// (1)Initialize时,从服务器加载自己的全部信息,从本地缓存文件加载好友列表。 /// (2)MainForm_Load,填充ChatListBox /// (3)MainForm_Shown,调用globalUserCache在后台刷新:若是第一次登录,则分批从服务器加载好友资料。否则,从服务器获取好友最新状态和版本,并刷新本地缓存。 /// (4)globalUserCache.FriendRTDataRefreshCompleted 事件,请求离线消息、离线文件、正式通知好友自己上线 /// </summary> public void Initialize(IRapidPassiveEngine engine, ChatListSubItem.UserStatus userStatus, Image stateImage) { GlobalResourceManager.PostInitialize(engine.CurrentUserID); this.Cursor = Cursors.WaitCursor; this.toolTip1.SetToolTip(this.skinButton_headImage,"帐号:" + engine.CurrentUserID); this.rapidPassiveEngine = engine; this.globalUserCache = new GlobalUserCache(this.rapidPassiveEngine); this.globalUserCache.FriendInfoChanged += new CbGeneric<GGUser>(globalUserCache_FriendInfoChanged); this.globalUserCache.FriendStatusChanged += new CbGeneric<GGUser>(globalUserCache_FriendStatusChanged); this.globalUserCache.GroupChanged += new CbGeneric<GGGroup ,GroupChangedType, string>(globalUserCache_GroupInfoChanged); this.globalUserCache.FriendRTDataRefreshCompleted += new CbGeneric(globalUserCache_FriendRTDataRefreshCompleted); this.globalUserCache.FriendRemoved += new CbGeneric<string>(globalUserCache_FriendRemoved); this.globalUserCache.FriendAdded += new CbGeneric<GGUser>(globalUserCache_FriendAdded); this.globalUserCache.CurrentUser.UserStatus = (UserStatus)((int)userStatus); this.myStatus = this.globalUserCache.CurrentUser.UserStatus; this.labelSignature.Text = this.globalUserCache.CurrentUser.Signature; this.skinButton_headImage.Image = GlobalResourceManager.GetHeadImage(this.globalUserCache.CurrentUser); this.labelName.Text = this.globalUserCache.CurrentUser.Name; skinButton_State.Image = stateImage; skinButton_State.Tag = userStatus; this.skinLabel_softName.Text = GlobalResourceManager.SoftwareName; this.notifyIcon.ChangeText(String.Format("{0}:{1}({2})\n状态:{3}", GlobalResourceManager.SoftwareName, this.globalUserCache.CurrentUser.Name, this.globalUserCache.CurrentUser.UserID, GlobalResourceManager.GetUserStatusName(this.globalUserCache.CurrentUser.UserStatus))); this.MaximumSize = new Size(543, Screen.GetWorkingArea(this).Height); this.Size = SystemSettings.Singleton.MainFormSize; this.Location = SystemSettings.Singleton.MainFormLocation;//new Point(Screen.PrimaryScreen.Bounds.Width - this.Width - 20, 40); this.friendListBox1.Initialize(this.globalUserCache.CurrentUser, this, new UserInformationForm(new Point(this.Location.X-284 ,this.friendListBox1.Location.Y))); this.groupListBox.Initialize(this.globalUserCache.CurrentUser ,GlobalConsts.CompanyGroupID); this.recentListBox1.Initialize(this); if (!SystemSettings.Singleton.ShowLargeIcon) { this.friendListBox1.IconSizeMode = ChatListItemIcon.Small; this.大头像ToolStripMenuItem.Checked = false; this.小头像ToolStripMenuItem.Checked = true; } //文件传送 this.rapidPassiveEngine.FileOutter.FileRequestReceived += new CbFileRequestReceived(fileOutter_FileRequestReceived); this.rapidPassiveEngine.FileOutter.FileResponseReceived += new CbGeneric<TransferingProject, bool>(fileOutter_FileResponseReceived); this.rapidPassiveEngine.ConnectionInterrupted += new CbGeneric(rapidPassiveEngine_ConnectionInterrupted);//预订断线事件 this.rapidPassiveEngine.BasicOutter.BeingPushedOut += new CbGeneric(BasicOutter_BeingPushedOut); this.rapidPassiveEngine.RelogonCompleted += new CbGeneric<LogonResponse>(rapidPassiveEngine_RelogonCompleted);//预订重连成功事件 this.rapidPassiveEngine.MessageReceived += new CbGeneric<string, int, byte[], string>(rapidPassiveEngine_MessageReceived); //群、组 this.rapidPassiveEngine.ContactsOutter.BroadcastReceived += new CbGeneric<string, string, int, byte[]>(ContactsOutter_BroadcastReceived); this.rapidPassiveEngine.ContactsOutter.ContactsOffline += new CbGeneric<string>(ContactsOutter_ContactsOffline); //所有联系人的下线事件 //网盘访问器 V2.0 this.nDiskOutter = new NDiskOutter(this.rapidPassiveEngine.FileOutter, this.rapidPassiveEngine.CustomizeOutter); this.notifyIcon.UnhandleMessageOccured += new CbGeneric<UnhandleMessageType ,string>(notifyIcon_UnhandleMessageOccured); this.notifyIcon.UnhandleMessageGone += new CbGeneric<UnhandleMessageType ,string>(notifyIcon_UnhandleMessageGone); this.notifyIcon.Initialize(this ,this); }
/// <summary> /// 初始化流程: /// (1)Initialize时,从服务器加载自己的全部信息,从本地缓存文件加载好友列表。 /// (2)MainForm_Load,填充ChatListBox /// (3)MainForm_Shown,调用globalUserCache在后台刷新:若是第一次登录,则分批从服务器加载好友资料。否则,从服务器获取好友最新状态和版本,并刷新本地缓存。 /// (4)globalUserCache.FriendRTDataRefreshCompleted 事件,请求离线消息、离线文件、正式通知好友自己上线 /// </summary> public void Initialize(IRapidPassiveEngine engine, ChatListSubItem.UserStatus userStatus, Image stateImage)//, Image headImage, string nickName, ChatListSubItem.UserStatus userStatus, Image stateImage) { GlobalResourceManager.PostInitialize(engine.CurrentUserID); this.Cursor = Cursors.WaitCursor; this.toolTip1.SetToolTip(this.skinButton_headImage, "帐号:" + engine.CurrentUserID); this.rapidPassiveEngine = engine; this.globalUserCache = new GlobalUserCache(this.rapidPassiveEngine); this.globalUserCache.FriendInfoChanged += new CbGeneric <GGUser>(globalUserCache_FriendInfoChanged); this.globalUserCache.FriendStatusChanged += new CbGeneric <GGUser>(globalUserCache_FriendStatusChanged); this.globalUserCache.GroupChanged += new CbGeneric <GGGroup, GroupChangedType, string>(globalUserCache_GroupInfoChanged); this.globalUserCache.FriendRTDataRefreshCompleted += new CbGeneric(globalUserCache_FriendRTDataRefreshCompleted); this.globalUserCache.FriendRemoved += new CbGeneric <string>(globalUserCache_FriendRemoved); this.globalUserCache.FriendAdded += new CbGeneric <GGUser>(globalUserCache_FriendAdded); this.globalUserCache.CurrentUser.UserStatus = (UserStatus)((int)userStatus); this.myStatus = this.globalUserCache.CurrentUser.UserStatus; this.labelSignature.Text = this.globalUserCache.CurrentUser.Signature; this.skinButton_headImage.Image = GlobalResourceManager.GetHeadImage(this.globalUserCache.CurrentUser); this.labelName.Text = this.globalUserCache.CurrentUser.Name; skinButton_State.Image = stateImage; skinButton_State.Tag = userStatus; this.skinLabel_softName.Text = GlobalResourceManager.SoftwareName; this.notifyIcon.ChangeText(String.Format("{0}:{1}({2})\n状态:{3}", GlobalResourceManager.SoftwareName, this.globalUserCache.CurrentUser.Name, this.globalUserCache.CurrentUser.UserID, GlobalResourceManager.GetUserStatusName(this.globalUserCache.CurrentUser.UserStatus))); this.MaximumSize = new Size(543, Screen.GetWorkingArea(this).Height); this.Size = SystemSettings.Singleton.MainFormSize; this.Location = SystemSettings.Singleton.MainFormLocation;//new Point(Screen.PrimaryScreen.Bounds.Width - this.Width - 20, 40); this.friendListBox1.Initialize(this.globalUserCache.CurrentUser, this, new UserInformationForm(new Point(this.Location.X - 284, this.friendListBox1.Location.Y))); this.groupListBox.Initialize(this.globalUserCache.CurrentUser, GlobalConsts.CompanyGroupID); this.recentListBox1.Initialize(this); if (!SystemSettings.Singleton.ShowLargeIcon) { this.friendListBox1.IconSizeMode = ChatListItemIcon.Small; this.大头像ToolStripMenuItem.Checked = false; this.小头像ToolStripMenuItem.Checked = true; } //文件传送 this.rapidPassiveEngine.FileOutter.FileRequestReceived += new CbFileRequestReceived(fileOutter_FileRequestReceived); this.rapidPassiveEngine.FileOutter.FileResponseReceived += new CbGeneric <TransferingProject, bool>(fileOutter_FileResponseReceived); this.rapidPassiveEngine.ConnectionInterrupted += new CbGeneric(rapidPassiveEngine_ConnectionInterrupted); //预订断线事件 this.rapidPassiveEngine.BasicOutter.BeingPushedOut += new CbGeneric(BasicOutter_BeingPushedOut); this.rapidPassiveEngine.RelogonCompleted += new CbGeneric <LogonResponse>(rapidPassiveEngine_RelogonCompleted); //预订重连成功事件 this.rapidPassiveEngine.MessageReceived += new CbGeneric <string, int, byte[], string>(rapidPassiveEngine_MessageReceived); //群、组 this.rapidPassiveEngine.ContactsOutter.BroadcastReceived += new CbGeneric <string, string, int, byte[], string>(ContactsOutter_BroadcastReceived); this.rapidPassiveEngine.ContactsOutter.ContactsOffline += new CbGeneric <string>(ContactsOutter_ContactsOffline); //所有联系人的下线事件 //网盘访问器 V2.0 this.nDiskOutter = new NDiskOutter(this.rapidPassiveEngine.FileOutter, this.rapidPassiveEngine.CustomizeOutter); this.notifyIcon.UnhandleMessageOccured += new CbGeneric <UnhandleMessageType, string>(notifyIcon_UnhandleMessageOccured); this.notifyIcon.UnhandleMessageGone += new CbGeneric <UnhandleMessageType, string>(notifyIcon_UnhandleMessageGone); this.notifyIcon.Initialize(this, this); }
public CreateGroupForm(IRapidPassiveEngine engine) { InitializeComponent(); this.rapidPassiveEngine = engine; }
public ServerProxy(IRapidPassiveEngine _engine) : base(_engine) { }
public ChangePasswordForm(IRapidPassiveEngine engine) { InitializeComponent(); this.rapidPassiveEngine = engine; }
public SelectGroupForm(string memberID, IRapidPassiveEngine _rapidPassiveEngine) { InitializeComponent(); this.currentUserID = memberID; this.rapidPassiveEngine = _rapidPassiveEngine; }
public SystemNotifySendForm(IRapidPassiveEngine engine) { InitializeComponent(); this.rapidPassiveEngine = engine; this.Icon = GlobalResourceManager.Icon64; }
public AddFriendForm(IRapidPassiveEngine engine, IChatSupporter supporter, GGUser currentUser) : this(engine, supporter, currentUser, "") { }
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) ; }
public void InitMain(IRapidPassiveEngine rapidPassiveEngine) { if (this.myInfo == null) { this.myInfo = new ChatListSubItem(); } this.rapidPassiveEngine = rapidPassiveEngine; this.myInfo.ID = Convert.ToUInt32(rapidPassiveEngine.CurrentUserID); //加载分组 ChatListItem gp = new ChatListItem();//new一个分组 gp.Text = "TestList"; ChatListSubItem people = new ChatListSubItem(); if (myInfo.ID == 10010) { lbl_userName.Text = "联通"; people.ID = 10086;//ID people.NicName = "移动";//昵称 people.DisplayName = "X";//备注名 people.PersonalMsg = "买买买买买"; } else if (myInfo.ID == 10086) { lbl_userName.Text = "移动"; people.ID = 10010;//ID people.NicName = "联通";//昵称 people.DisplayName = "X";//备注名 people.PersonalMsg = "买买买买买"; } gp.SubItems.Add(people); //chatListBox_contacts.GetSubItemsById();//按照ID查找listbox中的用户 chatListBox_contacts.Items.Add(gp);//添加到listBox中 //预订接收到广播消息的处理事件 this.rapidPassiveEngine.GroupOutter.BroadcastReceived += new CbGeneric<string, string, int, byte[]>(GroupOutter_BroadcastReceived); //预订断线事件 this.rapidPassiveEngine.ConnectionInterrupted += new CbGeneric(rapidPassiveEngine_ConnectionInterrupted); }
public Form_SystemMsg(IRapidPassiveEngine rapidPassiveEngine, ChatListSubItem myInfo) { this.myInfo = myInfo; this.rapidPassiveEngine = rapidPassiveEngine; InitializeComponent(); }