internal RosterElement(Attendance attendance) { InitializeComponent(); Attendance = attendance; ToolTip = "Chat with " + attendance.Party.Firstname; IsCurrent = false; }
private void FadeRosterElement(Attendance attendance) { var listItem = _listBox.ItemContainerGenerator.ContainerFromItem(attendance) as ListBoxItem; if (listItem != null) { //var animation = new DoubleAnimation(1.0, 0.0, new TimeSpan(0, 0, 0, 1, 300)); var animation2 = new DoubleAnimation(65, 0, new TimeSpan(0, 0, 0, 0, 1000)) { FillBehavior = FillBehavior.Stop, BeginTime = new TimeSpan(0, 0, 0, 0, 3000), AccelerationRatio = 0.3, DecelerationRatio = 0.6, }; //animation.Completed += (sender, args) => rosterElement.BeginAnimation(Grid.HeightProperty, animation2); animation2.Completed += (o, args) => { listItem.BeginAnimation(UIElement.OpacityProperty, null); RefreshRoster(); }; Logger.Debug("Fading element"); //listItem.BeginAnimation(UIElement.OpacityProperty, animation); listItem.BeginAnimation(FrameworkElement.HeightProperty, animation2); } }
internal void MarkRoster(Attendance attendance, bool markActive = false) { var element = _listBox.ItemContainerGenerator.ContainerFromItem(attendance) as ListBoxItem; if (element != null && element.IsSelected == false) { element.IsSelected = true; } }
internal Engagement(GwupeClientAppContext appContext, Attendance personAttendance) { this._appContext = appContext; Interactions = new Interactions(this); // This is to pickup logouts/connection disconnections _appContext.LoginManager.LoggedOut += LogoutOccurred; SecondParty = personAttendance; _countdownToDeactivation = new Timer(TimeoutToTunnelClose) { AutoReset = false }; _countdownToDeactivation.Elapsed += (sender, args) => CompleteDeactivation(); //_transportManager = new TransportManager(); // Setup the functions of this engagement Functions = new Dictionary<string, IFunction> { {"Chat", new Functions.Chat.Function(_appContext,this)}, {"FileSend", new Functions.FileSend.Function(_appContext, this)}, {"RemoteDesktop", new Functions.RemoteDesktop.Function(_appContext, this)}, }; Functions.Values.ToList().ForEach(function => { function.Activate += (sender, args) => { Active = true; }; function.Deactivate += (sender, args) => SuggestCountdownToDeactivation(); }); }
protected ClientImpl(Attendance secondParty) { SecondParty = secondParty; }
public void AddAdHocPerson(Party party, String shortCode) { var attendance = new Attendance(party); var presence = Presence.AlwaysOn; presence.Resource = "_blitsme-" + shortCode; presence.ShortCode = shortCode; attendance.PropertyChanged += MarkUnmarkCurrentlyEngaged; attendance.SetPresence(presence); ServicePartyAttendanceList.Add(attendance); ServicePartyAttendanceLookup[attendance.Party.Username] = attendance; }
private void AddPartyToList(Party party, Presence presence) { var attendance = new Attendance(party); attendance.PropertyChanged += MarkUnmarkCurrentlyEngaged; if (presence != null) { attendance.SetPresence(presence); } ServicePartyAttendanceList.Add(attendance); ServicePartyAttendanceLookup[attendance.Party.Username] = attendance; }
internal Client(Attendance secondParty) : base(secondParty) { }
internal ISocket GetP2PConnection(Attendance secondParty, String connectionId) { // At this stage, we only support direct connections return InitP2PConnection(secondParty, connectionId); }
// Called by local application to initialise a p2p connection to a second party private ISocket InitP2PConnection(Attendance secondParty, String connectionId) { var initRq = new InitP2PConnectionRq { shortCode = secondParty.ActiveShortCode, connectionId = connectionId }; TunnelEndpointContainer pendingTunnel; try { var response = GwupeClientAppContext.CurrentAppContext.ConnectionManager.Connection.Request<InitP2PConnectionRq, InitP2PConnectionRs>(initRq); // this will cause the server to initialise a tunnel endpoint and prepare it for connection #if DEBUG Logger.Debug("Got response from p2p connection request"); #endif try { pendingTunnel = GetPendingTunnel(response.uniqueId); // setup my peers endpoints var peer = GetPeerInfoFromResponse(response); peer.FacilitatorRepeatedEndPoint = pendingTunnel.FacilitatorEndPoint; pendingTunnel.TunnelEndpoint.Sync(peer, response.uniqueId, GwupeClientAppContext.CurrentAppContext.SettingsManager.SyncTypes); Logger.Info("Successfully completed outgoing tunnel with " + secondParty.Party.Username + "-" + secondParty.ActiveShortCode + " [" + response.uniqueId + "]"); } catch (Exception e) { Logger.Error("Failed to sync with peer : " + e.Message, e); ThreadPool.QueueUserWorkItem(m => GwupeClientAppContext.CurrentAppContext.SubmitFaultReport( new FaultReport() { Subject = "Sync error", UserReport = "INTERNAL : Failed to sync with peer : " + e.Message })); throw new Exception("Failed to sync with peer : " + e.Message, e); } } catch (Exception e) { Logger.Error("Failed to setup P2P Connection : " + e.Message, e); ThreadPool.QueueUserWorkItem(m => GwupeClientAppContext.CurrentAppContext.SubmitFaultReport( new FaultReport() { Subject = "P2P setup error [" + connectionId + "]", UserReport = "INTERNAL : Failed to setup p2p connection [" + connectionId + "]: " + e.Message })); throw new Exception("Failed to setup P2P Connection : " + e.Message, e); } return pendingTunnel.TunnelEndpoint; }
private void ShowEngagement(Attendance attendance) { if (!Dispatcher.CheckAccess()) { Dispatcher.Invoke(new Action(() => ShowEngagement(attendance))); } else { EngagementWindow egw = _engagementWindows.GetEngagementWindow(attendance); if (egw != null) { attendance.IsCurrentlyEngaged = true; ActiveContent.Content = egw; egw.SetAsMain(this); egw.ShowChat(); } else { Logger.Error("Failed to find an engagement window for " + attendance.Party); } } }
internal void ActivateEngagement(Attendance attendance) { if (attendance != null) { ShowEngagement(attendance); if (!attendance.Engagement.Active) { attendance.Engagement.Active = true; attendance.Engagement.Interactions.StartInteraction(); RefreshRosters(); } } }
internal FileSendClient(Attendance secondParty, FileSendInfo fileInfo) : base(secondParty) { _fileInfo = fileInfo; }