Inheritance: INotifyPropertyChanged
示例#1
0
 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;
 }
示例#2
0
        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;
        }
示例#3
0
 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;
 }
示例#4
0
 public EngagementWindowDataContext(GwupeClientAppContext appContext, Engagement engagement)
 {
     _appContext = appContext;
     Engagement = engagement;
     SecondParty = Engagement.SecondParty;
 }
示例#5
0
        // 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()];
            }
        }
示例#6
0
 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;
     }
 }
示例#7
0
 internal EngagementActivity(Engagement engagement, String function, String activity)
 {
     Engagement = engagement;
     Activity = activity;
     Function = function;
 }
示例#8
0
 internal Interactions(Engagement engagement)
 {
     _engagement   = engagement;
     _interactions = new List <Interaction>();
     //_interactionLookup = new Dictionary<string, Interaction>();
 }
示例#9
0
 internal EngagementActivity(Engagement engagement, String function, String activity)
 {
     Engagement = engagement;
     Activity   = activity;
     Function   = function;
 }
示例#10
0
 //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);
 }
示例#11
0
 internal Interactions(Engagement engagement)
 {
     _engagement = engagement;
     _interactions = new List<Interaction>();
     //_interactionLookup = new Dictionary<string, Interaction>();
 }