public NDiskForm(string ownerID, string nickName, IFileOutter fileOutter, INDiskOutter diskOutter) { InitializeComponent(); this.TopMost = false; this.ShowInTaskbar = true; this.nDiskBrowser1.Initialize(ownerID, fileOutter, diskOutter); this.Text = ownerID == null ? "我的网盘" : string.Format("远程磁盘 - {0}", nickName); }
public NDiskForm(string ownerID,string nickName, IFileOutter fileOutter , INDiskOutter diskOutter) { InitializeComponent(); this.TopMost = false; this.ShowInTaskbar = true; this.nDiskBrowser1.Initialize(ownerID, fileOutter, diskOutter); this.Text = ownerID == null ? "我的网盘" : string.Format("远程磁盘 - {0}", nickName); }
/// <summary> /// 初始化。 /// </summary> /// <param name="_ownerID">如果为null,表示访问服务器上的某个目录(网盘)。否则,表示访问在线的目标用户的硬盘。</param> public void Initialize(string _ownerID, IFileOutter _fileOutter, INDiskOutter outter) { this.ownerID = _ownerID ?? NetServer.SystemUserID; this.currentDirPath = null; this.cutOrCopyAction = null; this.fileOutter = _fileOutter; this.fileDirectoryOutter = outter; this.fileTransferingViewer1.Initialize(this.fileOutter, this.FilterTransferingProject); this.LoadDirectory(null, true); }
public void Initialize(string _ownerID, IFileOutter _fileOutter, INDiskOutter outter) { this.ownerID = _ownerID ?? NetServer.SystemUserID; this.currentDirPath = null; this.cutOrCopyAction = null; this.fileOutter = _fileOutter; this.fileDirectoryOutter = outter; this.fileTransferingViewer1.Initialize(this.fileOutter, delegate(TransferingProject pro) { return(pro.Comment != null && this.ownerID == pro.DestUserID); }); this.LoadDirectory(null, true); }
/// <summary> /// 调用该方法可恢复到未做任何连接的初始状态。 /// </summary> public void Reset() { this.ownerID = null; this.currentDirPath = null; this.cutOrCopyAction = null; this.fileOutter = null; this.fileDirectoryOutter = null; this.listView_fileDirectory.Clear(); this.toolStripButton_state.Image = this.imageList2.Images[0]; this.toolStripLabel_msg.Text = "就绪"; this.toolStripTextBox1.Text = ""; }
/// <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); }
//, 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); }
public void Initialize(string _ownerID, IFileOutter _fileOutter, INDiskOutter outter) { this.ownerID = _ownerID ?? NetServer.SystemUserID; this.currentDirPath = null; this.cutOrCopyAction = null; this.fileOutter = _fileOutter; this.fileDirectoryOutter = outter; this.fileTransferingViewer1.Initialize(this.fileOutter, delegate(TransferingProject pro) { return pro.Comment != null && this.ownerID == pro.DestUserID; }); this.LoadDirectory(null, true); }