private void PickUpAllHandler(object sender, MouseButtonEventArgs e) { try { MessageBoxItem[] stackPanels = new MessageBoxItem[this.lbMessageBox.Items.Count]; this.lbMessageBox.Items.CopyTo(stackPanels, 0); MessageBoxItem[] array = stackPanels; for (int i = 0; i < array.Length; i++) { MessageBoxItem mbi = array[i]; mbi.PickUpMessage(); } array = stackPanels; for (int i = 0; i < array.Length; i++) { MessageBoxItem mbi = array[i]; BaseTab baseTab = this.FindChatTab(mbi.MessageType, mbi.Id, mbi.Projectid); if (baseTab != null) { baseTab.SetFlashingStyle(); } } INWindow inWindow = this.dataService.INWindow as INWindow; BaseTab selectedTab = inWindow.ContentTab.SelectedItem as BaseTab; if (selectedTab != null) { selectedTab.SetDefaultStyle(); } this.ActiveInWindow(); } catch (System.Exception ex) { this.logger.Error(ex.ToString()); } }
private CloseableTabItem FindChatTab() { INWindow inWindow = this.dataService.INWindow as INWindow; CloseableTabItem result; if (inWindow != null) { ItemCollection ic = inWindow.ContentTab.Items; foreach (TabItem item in (System.Collections.IEnumerable)ic) { if (item != null) { CloseableTabItem cti = item as CloseableTabItem; if (cti != null) { TabItemHeaderControl tabHeader = cti.Header as TabItemHeaderControl; } PersonalChatTabControl pctc = item.Content as PersonalChatTabControl; if (pctc != null && this.staff != null && pctc.StaffId == this.staff.Uid) { result = cti; return(result); } } } } result = null; return(result); }
private void EnterINWindow() { if (this.dataService.LoginWindow != null) { this.dataService.LoginWindow.Close(); this.dataService.RemoveWindow(DataService.WindowType.Login); } this.dataService.INWindow = new INWindow(); if (this.dataService.INWindow != null) { INWindow inWindow = this.dataService.INWindow as INWindow; if (inWindow != null) { inWindow.Show(); LogonWindow logonWindow2 = this.dataService.LoginWindow as LogonWindow; if (logonWindow2 != null) { logonWindow2.LogonPanel.StopAnimation(); } inWindow.InitData(); this.sessionService.IsEnable = true; SystemWindow sysWindow = this.dataService.SystemWindow as SystemWindow; sysWindow.optionItem.Enabled = this.sessionService.IsEnable; sysWindow.aboutItem.Enabled = this.sessionService.IsEnable; sysWindow.logoutItem.Enabled = this.sessionService.IsEnable; } } }
private void SetCustomMembers(TreeNodeCustomStaff s, CustomGroup c) { INWindow inWindow = this.dataService.INWindow as INWindow; if (inWindow.Employee.FirstTreeView.Items.Count > 0) { foreach (TreeViewItem item in (System.Collections.IEnumerable)inWindow.Employee.FirstTreeView.Items) { CustomGroupTreeViewItem cust = item as CustomGroupTreeViewItem; if (cust != null && cust.Tag != null) { if (c.GroupID == cust.Tag.ToString()) { foreach (TreeNodeCustomStaff i in (System.Collections.IEnumerable)cust.Items) { if (i.Staff.Uid != s.Staff.Uid) { i.IsBigHead = false; i.ShowSmallHead(); } } } else { foreach (TreeNodeCustomStaff i in (System.Collections.IEnumerable)cust.Items) { i.IsBigHead = false; i.ShowSmallHead(); } } } } } }
public void EntMessageRecordEvent(MessageRecordResponse records) { try { if (records.messageRecords != null && records.messageRecords.Count > 0) { if (records.entMessageRecordType == 4) { this.EntStaffMessageRecordMessageCenter(records.messageRecords); } else { if (records.entMessageRecordType == 3) { this.EntStaffMessageRecordChatPanel(records.messageRecords); } } } else { if (records.messageRecords.Count == 0) { if (records.entMessageRecordType == 4) { WindowModel.Instance.MsgRecordPage.ClearPage(); } else { if (records.entMessageRecordType == 3) { INWindow inWindow = this.dataService.INWindow as INWindow; if (inWindow != null) { EntStaffTab pctc = inWindow.ContentTab.SelectedItem as EntStaffTab; EntGroupTab gctc = inWindow.ContentTab.SelectedItem as EntGroupTab; RosterTab rost = inWindow.ContentTab.SelectedItem as RosterTab; if (pctc != null) { pctc.TabContent.ChatComponent.MsgRecordComp.setShowPage(); } if (gctc != null) { gctc.TabContent.ChatComponent.MsgRecordComp.setShowPage(); } if (rost != null) { rost.TabContent.ChatComponent.MsgRecordComp.setShowPage(); } } } } } } } catch (System.Exception e) { System.Console.WriteLine(e.ToString()); } }
private void btnClose_Click(object sender, RoutedEventArgs e) { if (this.CloseTabTip()) { INWindow inWin = this.dataService.INWindow as INWindow; inWin.ContentTab.Items.Remove(this); this.dataService.RemoveCooperationStaffChatTab(this.staff.Uid, this.staff.UnitedProjectid); } }
protected void SetFocus2DesktopButton() { INWindow inWindow = this.dataService.INWindow as INWindow; if (inWindow != null) { inWindow.btnApproval.Focus(); } }
private void CountChatPanelWidth(int value) { INWindow inWindow = this.dataService.INWindow as INWindow; if (inWindow != null) { this.sessionService.ChatViewMsgBoxWidth = inWindow.Width - (double)value; } }
private void SelectedTab() { INWindow inWindow = this.dataService.INWindow as INWindow; if (this.baseTab != null && inWindow != null) { inWindow.ContentTab.SelectedItem = this.baseTab; this.baseTab.SetDefaultStyle(); } }
public MessageBoxItem(MessageActorType type, long id, string name, string count, ImageSource imageSource) { this.InitializeComponent(); this.messageType = type; this.id = id; this.imgFace.Source = imageSource; this.tbkName.Text = name; this.tbkCount.Text = "(" + count + ")"; this.inWindow = (this.dataService.INWindow as INWindow); }
private BaseTab FindChatTab(MessageActorType type, long id, string projectid) { INWindow inWindow = this.dataService.INWindow as INWindow; BaseTab result; if (inWindow != null) { ItemCollection ic = inWindow.ContentTab.Items; foreach (TabItem item in (System.Collections.IEnumerable)ic) { if (item != null) { BaseTab cti = item as BaseTab; if (MessageActorType.EntGroup == type) { GroupChatTabControl gctc = item.Content as GroupChatTabControl; if (gctc != null && gctc.GroupId == id) { result = cti; return(result); } } if (MessageActorType.EntStaff == type) { PersonalChatTabControl pctc = item.Content as PersonalChatTabControl; if (pctc != null && pctc.StaffId == id) { result = cti; return(result); } } if (MessageActorType.Roster == type) { FriendsChatTabControl fctc = item.Content as FriendsChatTabControl; if (fctc != null && fctc.RosterId == id) { result = cti; return(result); } } if (MessageActorType.CooperationStaff == type) { CoopStaffChatTabControl coopStaffChatTabControl = item.Content as CoopStaffChatTabControl; if (coopStaffChatTabControl != null && coopStaffChatTabControl.Uid == id && coopStaffChatTabControl.Projectid == projectid) { result = cti; return(result); } } } } } result = null; return(result); }
private void CutScreenHidenWindowProcessor() { if (this.sessionService.IsCutScreenHidenWindow) { INWindow inWindow = this.dataService.INWindow as INWindow; if (inWindow != null) { inWindow.WindowState = WindowState.Minimized; } } }
private void CutScreenEndShowWindow() { if (this.sessionService.IsCutScreenHidenWindow) { INWindow inWindow = this.dataService.INWindow as INWindow; if (inWindow != null) { inWindow.WindowState = WindowState.Normal; } } }
public void InitServer() { try { this.inWindow = (this.dataService.INWindow as INWindow); this.DepartmentListEventHandle(this.dataService.GetDepartmentList()); this.listsatff = this.dataService.GetStaffList(); } catch (System.Exception) { } }
private void btnClose_Click(object sender, RoutedEventArgs e) { try { INWindow inWin = this.dataService.INWindow as INWindow; inWin.ContentTab.Items.Remove(this); this.dataService.RemoveRosterChatTab(this.roster.Uid); } catch (System.Exception ex) { this.logger.Error(ex.ToString()); } }
public SelfProfilePage GetSelfProfilePage() { INWindow inWindow = this.dataService.INWindow as INWindow; SelfProfilePage result; if (inWindow != null) { result = inWindow.workDesktopControl.SelPage; } else { result = null; } return(result); }
public AddressComponent getAddress() { INWindow inWindow = this.dataService.INWindow as INWindow; AddressComponent result; if (inWindow != null) { AddressComponent address = new AddressComponent(); result = address; } else { result = null; } return(result); }
public void CooperationStaffMessageRecordEvent(CooperationMessageRecordResponse response) { try { if (response != null || response.cooperationMessageRecord.Count != 0) { this.DisplayCooperationMessageRecordToChatPanel(response.cooperationMessageRecord, response.total); } else { if (response.cooperationMessageRecord.Count == 0) { if (response.messageRecordType == 3) { INWindow inWindow = this.dataService.INWindow as INWindow; if (inWindow != null) { EntStaffTab pctc = inWindow.ContentTab.SelectedItem as EntStaffTab; EntGroupTab gctc = inWindow.ContentTab.SelectedItem as EntGroupTab; RosterTab rost = inWindow.ContentTab.SelectedItem as RosterTab; CoopStaffTab coopStaffTab = inWindow.ContentTab.SelectedItem as CoopStaffTab; if (pctc != null) { pctc.TabContent.ChatComponent.MsgRecordComp.setShowPage(); } if (gctc != null) { gctc.TabContent.ChatComponent.MsgRecordComp.setShowPage(); } if (rost != null) { rost.TabContent.ChatComponent.MsgRecordComp.setShowPage(); } if (coopStaffTab != null) { coopStaffTab.TabContent.ChatComponent.MsgRecordComp.setShowPage(); } } } } } } catch (System.Exception e) { System.Console.WriteLine(e.ToString()); } }
private void ArgeeAndRoster(RosterAddResponse response) { if (response != null) { MessageBox.Show(response.user.name + "同意您添加为好友!"); Roster roster = new Roster(); roster.Uid = response.user.uid; roster.Jid = response.user.jid; roster.Name = response.user.name; roster.Nickname = response.user.nickname; roster.Status = (UserStatus)System.Enum.Parse(typeof(UserStatus), response.user.status.ToString()); roster.Signature = response.user.signature; this.dataService.AddRoster(roster); INWindow inWindow = this.dataService.INWindow as INWindow; inWindow.FriendsList.AddRoster(roster); } }
public CustomGroupTreeViewItem() { this.InitializeComponent(); this.customGroupManagerViewModel = CustomGroupManagerWindowViewModel.GetInstance(); this.tBlock.ContextMenu = this.GetContextMenu(); this.tBlock.Text = "新建分组"; this.sessionService = ServiceUtil.Instance.SessionService; this.dataService = ServiceUtil.Instance.DataService; this.inWindow = (this.dataService.INWindow as INWindow); this.tb.LostFocus += new RoutedEventHandler(this.LostFocus_HandleEvent); this.tb.KeyUp += delegate(object s, KeyEventArgs ee) { if (ee.Key == Key.Return) { this.TextBoxLostFocus(); } }; this.tb.SelectAll(); base.MouseRightButtonDown += new MouseButtonEventHandler(this.CustomGroupTreeViewItem_MouseRightButtonDown); base.Loaded += new RoutedEventHandler(this.CustomGroupTreeViewItem_Loaded); }
public void btnAgree_Click(object sender, RoutedEventArgs e) { int askType = 1; if (this.radioButton1.IsChecked == true) { askType = 2; } if (this.radioButton2.IsChecked == true) { askType = 1; } if (this.radioButton3.IsChecked == true) { askType = 3; } User user = new User(); user.jid = this.sessionService.Jid; user.uid = this.sessionService.Uid; user.name = this.sessionService.Name; user.nickname = this.sessionService.NickName; user.signature = this.sessionService.Signature; user.status = (int)this.sessionService.Status; user.username = this.sessionService.UserName; this.viewModel.AddRosterRequestAsk(this.sessionService.Uid, this.uid, this.user.jid, this.tbMessage.Text, askType, 0L, 0L, user); INWindow inWindow = this.dataService.INWindow as INWindow; if (inWindow != null) { Roster roster = new Roster(); roster.Jid = this.user.jid; roster.Uid = this.user.uid; roster.Name = this.user.name; roster.Nickname = this.user.nickname; inWindow.FriendsList.AddRoster(roster); this.dataService.AddRoster(roster); } base.Close(); }
private void SureHandler(object sender, RoutedEventArgs e) { Settings.Default.ExitRemind = this.chkExitRemind.IsChecked.Value; Settings.Default.SystemSetup_Base_ExitHide = this.rboHide.IsChecked.Value; Settings.Default.Save(); if (Settings.Default.SystemSetup_Base_ExitHide) { base.DialogResult = new bool?(false); ServiceUtil.Instance.DataService.INWindow.WindowState = WindowState.Minimized; } else { INWindow inWindow = base.Owner as INWindow; if (inWindow != null) { inWindow.IsTaskClose = false; } base.DialogResult = new bool?(true); Application.Current.Shutdown(1000); } base.Close(); }
private void ActiveInWindow() { INWindow inWindow = this.dataService.INWindow as INWindow; if (inWindow != null) { inWindow.Activate(); if (inWindow.WindowState == WindowState.Maximized) { inWindow.WindowState = WindowState.Maximized; } else { inWindow.WindowState = WindowState.Normal; if (inWindow.Top <= 0.0 || inWindow.Left <= 0.0 || inWindow.Left + inWindow.Width >= SystemParameters.WorkArea.Width) { inWindow.Left = (SystemParameters.WorkArea.Width - inWindow.Width) / 2.0; inWindow.Top = (SystemParameters.WorkArea.Height - inWindow.Height) / 2.0; } } this.SelectedTab(); } }
private void ShowOtherStaffSmallHead() { try { INWindow inWindow = this.dataService.INWindow as INWindow; if (inWindow != null) { System.Collections.Generic.ICollection <SelfDepartmentStaffNode> nodes = inWindow.Employee.SelfDepartmentItem.StaffNode.Values; foreach (SelfDepartmentStaffNode node in nodes) { if (node != null && node.staff.Uid != this.staff.Uid && node.IsBigHead) { node.IsBigHead = false; node.ShowSmallHead(); } } } } catch (System.Exception ex) { this.logger.Error(ex.ToString()); } }
private void btnSave_Click(object sender, RoutedEventArgs e) { Staff staff = this.GetSaveStaff(); if (staff != null) { if (ValidationUtil.IsValid(this)) { if (this.inViewModel.ChangeStatus(staff)) { INWindow inWindow = this.dataService.INWindow as INWindow; if (inWindow != null) { inWindow.userHead.ImageSource = staff.HeaderImage; inWindow.tbkName.Text = staff.Name; inWindow.lblSignature.Text = staff.Signature; } if (!this.inViewModel.ProfileUpdate(staff)) { Alert.Show("个人资料更新失败", "提示", MessageBoxButton.OK, MessageBoxImage.Asterisk); } else { Alert.Show("个人信息保存成功", "提示", MessageBoxButton.OK, MessageBoxImage.Asterisk); } } else { Alert.Show("个人状态更新失败包括,用户名,头象,状态,个人签名", "提示", MessageBoxButton.OK, MessageBoxImage.Asterisk); } } } else { Alert.Show("个人档案资料为空,保存失败", "提示", MessageBoxButton.OK, MessageBoxImage.Asterisk); } }
private void UserControl_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { if (e.LeftButton == MouseButtonState.Pressed && this.staff.Uid != this.sessionService.Uid) { INWindow window = this.dataService.INWindow as INWindow; if (window != null) { window.tbxSearch.Text = this.staff.Name; } EntStaffTab item = this.dataService.GetStaffChatTab(this.staff.Uid) as EntStaffTab; if (item != null) { ((INWindow)this.dataService.INWindow).ContentTab.SelectedItem = item; } else { item = new EntStaffTab(this.staff); item.SetDefaultStyle(); ((INWindow)this.dataService.INWindow).ContentTab.Items.Add(item); this.dataService.AddStaffChatTab(this.staff.Uid, item); ((INWindow)this.dataService.INWindow).ContentTab.SelectedItem = item; } } }
public Setting(EMailModal modal) { this.Modal = modal; this.iNWindow = (ServiceUtil.Instance.DataService.INWindow as INWindow); }
private void EntGroupMessageRecordEvent(GroupMessageRecordResponse response) { try { if (response.GroupMessageRecord != null) { System.Collections.Generic.List <GroupMessageRecord> records = response.GroupMessageRecord; Message[] messages = new Message[response.GroupMessageRecord.Count]; MessageStyle ms = null; for (int i = 0; i < messages.Length; i++) { ms = this.GroupMessageRecordProcessor(records, ms, i); messages[i] = new Message(); messages[i].FromJid = records[i].from_uid + "@null/null"; messages[i].CreateTime = records[i].createTime; messages[i].ToJid = records[i].gid.ToString(); messages[i].MessageBlocks = this.utilService.MessageDecode(records[i].message); messages[i].Style = ms; messages[i].RecordId = records[i].id; messages[i].IsMark = records[i].isMark; messages[i].FileName = records[i].fileName; messages[i].Icon = records[i].icon; messages[i].Url = records[i].url; messages[i].Style = ms; } if (records.Count != 0 && response.groupMessageRecordType == 4) { if (WindowModel.Instance.IsOpenMessageCenterWindow()) { EntGroup group = this.dataService.GetEntGroup(long.Parse(messages[0].ToJid)); WindowModel.Instance.MsgRecordPage.MessageCenterRecordGroup(messages, group, records[0].total); System.GC.Collect(); } } else { if (records.Count != 0 && response.groupMessageRecordType == 3) { EntGroupTab item = this.dataService.GetEntGroupChatTab(records[0].gid) as EntGroupTab; if (item != null) { GroupChatTabControl tab = item.TabContent; if (tab != null) { tab.ChatComponent.AddGroupMessageRecords(messages, records[0].total); System.GC.Collect(); } } } else { if (records.Count == 0) { if (response.GroupMessageRecord.Count == 0 && response.groupMessageRecordType == 4) { WindowModel.Instance.MsgRecordPage.ClearPage(); } else { if (response.GroupMessageRecord.Count == 0 && response.groupMessageRecordType == 3) { INWindow inWindow = this.dataService.INWindow as INWindow; if (inWindow != null) { EntGroupTab gctc = inWindow.ContentTab.SelectedItem as EntGroupTab; if (gctc != null) { gctc.TabContent.ChatComponent.MsgRecordComp.setShowPage(); } } } } } } } } } catch (System.Exception e) { this.logger.Error(e.ToString()); } }