public ConversationView(string Gamertag, string xuid) { InitializeComponent(); (DataContext as ConversationViewModel).Gamertag = Gamertag; (DataContext as ConversationViewModel).xuid = xuid; (DataContext as ConversationViewModel).Conversation = XboxConnection.GetConversation(xuid); }
public FriendsListView(string Gamertag, string xuid) { InitializeComponent(); (DataContext as FriendsListViewModel).Gamertag = Gamertag; (DataContext as FriendsListViewModel).xuid = xuid; (DataContext as FriendsListViewModel).Friends = new List <Friend>(XboxConnection.GetFriends(xuid)); }
private void InitializeVariables() { Friends = new List <Friend>(XboxConnection.GetFriends().OrderBy(b => b.Gamertag)); SelectedFriends = new List <Friend>(); Message = string.Empty; IndividualMessages = true; }
public void PortExhaustionTest() { // temporarly decrease the verbosity to prevent useless entries from getting logged AssemblyGlobals.Logger.Level = LogLevel.Warn; XboxConnectionOptions options = XboxConnectionOptions.PerformanceMode; for (int i = 0; i < 50; i++) { using (_connection = new XboxConnection(AssemblyGlobals.Logger)) { // register notification session every other connection _connection.Open(AssemblyGlobals.TestXbox.Ip, options ^= XboxConnectionOptions.NotificationSession); // get active xbox connections int connectionCount = IPGlobalProperties.GetIPGlobalProperties() .GetActiveTcpConnections() .Count(connection => Equals(connection.RemoteEndPoint.Address, AssemblyGlobals.TestXbox.Ip)); // fail if we detect they aren't being closed properly if (connectionCount > 10) { Assert.Fail(); } } } }
private void ProfileView(object obj) { XboxProfile Profile = XboxConnection.GetProfile(Friends.ElementAt(SelectedFriendIndex).Gamertag); ProfileViewerView v = new ProfileViewerView(Profile); v.Show(); }
public FriendsListView() { InitializeComponent(); (DataContext as FriendsListViewModel).Gamertag = XboxConnection.GetProfile().Gamertag; (DataContext as FriendsListViewModel).xuid = XboxConnection.GetProfile().ID.ToString(); (DataContext as FriendsListViewModel).Friends = new List <Friend>(XboxConnection.GetFriends()); }
private void MessageSend(object obj) { string MessageText = string.Empty; MessageBoxResult res = InputBoxView.ShowDialog(string.Format("New message to {0}", Friends.ElementAt(SelectedFriendIndex).Gamertag), "Message:", out MessageText, MessageBoxButton.OKCancel); if (res == MessageBoxResult.OK) { XboxConnection.SendMessage(Friends.ElementAt(SelectedFriendIndex).Gamertag, MessageText); } }
private void FriendAdd(object obj) { string Gamertag = string.Empty; MessageBoxResult res = InputBoxView.ShowDialog("Send Friend Request", "Gamertag to Add:", out Gamertag, MessageBoxButton.OKCancel); if (res == MessageBoxResult.OK) { XboxConnection.AddFriend(XboxConnection.XuidFromGamertag(Gamertag)); } }
private void ReplySend(object obj) { string MessageText = string.Empty; MessageBoxResult res = InputBoxView.ShowDialog(string.Format("New message to {0}", Gamertag), "Message:", out MessageText, MessageBoxButton.OKCancel); if (res == MessageBoxResult.OK) { XboxConnection.SendMessage(Gamertag, MessageText); } }
/// <summary> /// Connects to an Xbox with the specified ip address. If already connected, it will reconnect. /// </summary> /// <param name="ip"></param> /// <param name="options"></param> public void Connect(IPAddress ip, XboxConnectionOptions options = XboxConnectionOptions.PerformanceMode) { Disconnect(); CommandSession = new XboxConnection(Logger); CommandSession.Open(ip, options); PreviousConnectionAddress = CommandSession.Ip; PreviousConnectionOptions = CommandSession.Options; NotificationSession = new XboxConnection(Logger); NotificationSession.Open(ip, XboxConnectionOptions.NotificationSession); Initialize(); }
private void DoLaunch(object obj) { Properties.Settings.Default.LastKey = Key; Properties.Settings.Default.Save(); XboxConnection.SetApiKey(Key); MainWindow v = new MainWindow(); v.Show(); Application.Current.MainWindow = v; Application.Current.Windows.OfType <LauncherView>().First().Close(); }
private void MessageSend(object obj) { if (IndividualMessages) { foreach (Friend f in SelectedFriends) { XboxConnection.SendMessage(f.Gamertag, Message); } MessageBox.Show(string.Format("Message sent to {0} friends.", SelectedFriends.Count), "Success", MessageBoxButton.OK, MessageBoxImage.Exclamation); } else { throw new NotImplementedException(); } }
private void ListRefresh(object obj) { Conversation = XboxConnection.GetConversation(xuid); }
private void ListRefresh(object obj) { Conversations = new List <ConversationSummary>(XboxConnection.GetConversations()); }
private void FriendRemove(object obj) { XboxConnection.RemoveFriend(Friends.ElementAt(SelectedFriendIndex).xuid); }
public void Initialize() { _connection = new XboxConnection(AssemblyGlobals.Logger); }
private void FriendUnfavorite(object obj) { XboxConnection.UnfavoriteFriend(Friends.ElementAt(SelectedFriendIndex).xuid); }
public MessengerView() { InitializeComponent(); (DataContext as MessengerViewModel).Conversations = new List <ConversationSummary>(XboxConnection.GetConversations()); }
private void ListRefresh(object obj) { Friends = new List <Friend>(XboxConnection.GetFriends(xuid)); }
private void InitializeVariables() { FriendsList = new List <Friend>(XboxConnection.GetFriends()); }
public ProfileViewerView(string Gamertag) { InitializeComponent(); (DataContext as ProfileViewerViewModel).Profile = XboxConnection.GetProfile(Gamertag); }