internal EngagementWindow(GwupeClientAppContext appContext, DispatchingCollection<ObservableCollection<Notification>, Notification> notificationList, Engagement engagement) { InitializeComponent(); _appContext = appContext; Engagement = engagement; engagement.PropertyChanged += EngagementOnPropertyChanged; try { ((Components.Functions.RemoteDesktop.Function)Engagement.GetFunction("RemoteDesktop")).Server.ServerConnectionOpened += EngagementOnRDPConnectionAccepted; ((Components.Functions.RemoteDesktop.Function)Engagement.GetFunction("RemoteDesktop")).Server.ServerConnectionClosed += EngagementOnRDPConnectionClosed; } catch (Exception e) { Logger.Error("Failed to link into function RemoteDesktop : " + e.Message, e); } _notificationView = new CollectionViewSource { Source = notificationList }; _notificationView.Filter += NotificationFilter; _notificationView.View.Refresh(); notificationList.CollectionChanged += NotificationListOnCollectionChanged; //SetTunnelIndicator(Engagement.IncomingTunnel, IncomingTunnelIndicator); //SetTunnelIndicator(Engagement.OutgoingTunnel, OutgoingTunnelIndicator); ShowChat(); _ewDataContext = new EngagementWindowDataContext(_appContext, engagement); DataContext = _ewDataContext; }
private const double InteractionTimeout = 240; // 4 hour interaction timeout #endif internal Interaction(Engagement engagement, String id = null) { _engagement = engagement; _id = String.IsNullOrEmpty(id) ? Util.getSingleton().generateString(6) : id; Logger.Debug("Starting Interaction " + _id); LastActivity = DateTime.Now; _expired = false; }
internal Interaction(Engagement engagement, String id = null) { _engagement = engagement; _id = String.IsNullOrEmpty(id) ? Util.getSingleton().generateString(6) : id; Logger.Debug("Starting Interaction " + _id); LastActivity = DateTime.Now; _expired = false; }
public EngagementWindowDataContext(GwupeClientAppContext appContext, Engagement engagement) { _appContext = appContext; Engagement = engagement; SecondParty = Engagement.SecondParty; }
// Gets an engagement, creates it if its not there public Engagement GetNewEngagement(String username, String shortCode = null) { lock (_engagementLookupLock) { if (_engagementLookup.ContainsKey(username.ToLower())) { return _engagementLookup[username.ToLower()]; } Attendance servicePersonAttendance = _appContext.RosterManager.GetServicePersonAttendance(username.ToLower()); if (servicePersonAttendance == null && shortCode != null) { // add them temporarily _appContext.RosterManager.AddAdHocPerson(username, shortCode); servicePersonAttendance = _appContext.RosterManager.GetServicePersonAttendance(username.ToLower()); } if (servicePersonAttendance == null) { throw new Exception("Unable to find service person [" + username + "]"); } var newEngagement = new Engagement(_appContext, servicePersonAttendance); newEngagement.Functions.Values.ToList().ForEach(value => value.NewActivity += (sender, args) => OnActivity(args)); Engagements.Add(newEngagement); _engagementLookup[username.ToLower()] = newEngagement; servicePersonAttendance.Engagement = newEngagement; return _engagementLookup[username.ToLower()]; } }
private void ResetUnreadIfVisible(Engagement engagement) { var currentEngagement = ActiveContent.Content as EngagementWindow; if (currentEngagement != null && engagement.IsUnread && currentEngagement.Engagement == engagement && currentEngagement.EngagementVisibleContent == EngagementVisibleContent.Chat) { engagement.IsUnread = false; } }
internal EngagementActivity(Engagement engagement, String function, String activity) { Engagement = engagement; Activity = activity; Function = function; }
internal Interactions(Engagement engagement) { _engagement = engagement; _interactions = new List <Interaction>(); //_interactionLookup = new Dictionary<string, Interaction>(); }
//public DispatchingCollection<ObservableCollection<ChatElement>, ChatElement> Exchange { get; private set; } public ChatWindowDataContext(GwupeClientAppContext appContext, Engagement engagement) { this._appContext = appContext; //this._chatWindow = chatWindow; Self = engagement.SecondParty.Party; // this.Exchange = // new DispatchingCollection<ObservableCollection<ChatElement>, ChatElement>( // _chatWindow._chat.Conversation.Exchange, chatWindow.Dispatcher); }
internal Interactions(Engagement engagement) { _engagement = engagement; _interactions = new List<Interaction>(); //_interactionLookup = new Dictionary<string, Interaction>(); }