コード例 #1
0
 public ChangePassword(ProfileInfo details, SocketClient client)
 {
     InitializeComponent();
     this.currentPassword = details.password;
     myClient = client;
     userDetails = details;
 }
コード例 #2
0
 private void openLoginScreen()
 {
     myClient.CloseSocket(true);
     myClient = new SocketClient("127.0.0.1", 20000, false, ((char)2).ToString(), ((char)3).ToString());
     startupScreen = new LoginScreen(myClient, this);
     startupScreen.Show();
     startupScreen.FormClosed += new FormClosedEventHandler(userLoggedIn);
 }
コード例 #3
0
 public RequestReplyWindow(SocketClient client, long myUID, long friendsUID, string friendName)
 {
     InitializeComponent();
     this.myUID = myUID;
     friendUID = friendsUID;
     this.friendName = friendName;
     myClient = client;
     label.Text = friendName + " wants to be your friend. You can accept or decline the request by pressing the buttons below";
 }
コード例 #4
0
 public ChatWindow(SocketClient client, long myUID, long friendsUID, string friendName)
 {
     InitializeComponent();
     this.myUID = myUID;
     friendUID = friendsUID;
     this.friendName = friendName;
     myClient = client;
     label1.Text = friendName;
     synthesizer = new SpeechSynthesizer();
 }
コード例 #5
0
        public void CreateSocket()
        {
             SocketHandler.SocketServer mySockets = new SocketHandler.SocketServer(0, 1000);
             SocketHandler.SocketClient clientSocket = null;
             mySockets.Init();
             mySockets.Start(new System.Net.IPEndPoint(System.Net.IPAddress.Parse("127.0.0.1"), 20000));
             clientSocket = new SocketHandler.SocketClient("127.0.0.1", 20000, false, ((char)2).ToString(), ((char)3).ToString());

             System.Threading.Thread.Sleep(1000);
             Assert.AreEqual(true, clientSocket.Connected);
        }
コード例 #6
0
        public CreateGroupForm(List<messageSpecs.FriendStatusMessage> _friendsList, SocketClient myClient, long UserID)
        {
            InitializeComponent();

            var Online = messageSpecs.FriendStatusMessage.LoggedOnStatus.Online;
            var Offline = messageSpecs.FriendStatusMessage.LoggedOnStatus.Offline;

            this.friendsList = _friendsList.Where(item => (item.UserStatus == Online) || (item.UserStatus == Offline)).ToList();
            this._myClient = myClient;
            this.UserID = UserID;
            ListBoxLoad();
        }
コード例 #7
0
        public LoginScreen(SocketClient client, HomePage mainScreen)
        {
            InitializeComponent();
            myClient = client;
            this.mainScreen = mainScreen;
            tmrMessages.Tick += new EventHandler(clientStatusCheck);
            tmrMessages.Start();

            if (!string.IsNullOrEmpty(Properties.Settings.Default.UserName))
            {
                textBoxUserName.Text = Properties.Settings.Default.UserName;
                textBoxPassword.Text = Properties.Settings.Default.Password;
            }
        }
コード例 #8
0
 public AddContacts(SocketClient client, ProfileInfo profileInfo)
 {
     myClient = client;
     userInfo = profileInfo;
     InitializeComponent();
 }
コード例 #9
0
        public void CreateUser()
        {
            SocketHandler.SocketServer mySockets = new SocketHandler.SocketServer(0, 1000);
            SocketHandler.SocketClient clientSocket = null;
            mySockets.Init();
            mySockets.Start(new System.Net.IPEndPoint(System.Net.IPAddress.Parse("127.0.0.1"), 20000));
            clientSocket = new SocketHandler.SocketClient("127.0.0.1", 20000, false, ((char)2).ToString(), ((char)3).ToString());

            messageSpecs.UserCreationMessage myCreationMessage = new messageSpecs.UserCreationMessage();
            myCreationMessage.EmailAddress = "*****@*****.**";
            myCreationMessage.UserName = "******";
            myCreationMessage.FirstName = "Cody";
            myCreationMessage.LastName = "Eidsness";
            clientSocket.Send(myCreationMessage.getMessageString());

            for(int i = 1;i<=5;i++)
            {
                System.Threading.Thread.Sleep(1000);
                while (clientSocket.messageQueue.Count > 0)
                {
                    if (clientSocket.messageQueue.Dequeue().Substring(0, 5) == UserCreationMessage.CreateUserMessageType)
                    {
                        return;
                    }
                }
            }
            Assert.Fail("Never got login message back");
        }
コード例 #10
0
        public void AddContact()
        {
            SocketHandler.SocketServer mySockets = new SocketHandler.SocketServer(0, 1000);
            SocketHandler.SocketClient clientSocket = null;
            mySockets.Init();
            mySockets.Start(new System.Net.IPEndPoint(System.Net.IPAddress.Parse("127.0.0.1"), 20000));
            clientSocket = new SocketHandler.SocketClient("127.0.0.1", 20000, false, ((char)2).ToString(), ((char)3).ToString());

            messageSpecs.AddContactMessage x = new messageSpecs.AddContactMessage();
            x.sender = "10006";
            x.receiver = "2";
            clientSocket.Send(x.getMessageString());

            for (int i = 1; i <= 5; i++)
            {
                System.Threading.Thread.Sleep(1000);
                while (clientSocket.messageQueue.Count > 0)
                {
                    if (clientSocket.messageQueue.Dequeue().Substring(0, 5) == AddContactMessage.AddContactMessageType)
                        return;
                }
            }
            Assert.Fail("Never got login message back");
        }
コード例 #11
0
 public ProfileDetails(SocketClient client)
 {
     InitializeComponent();
     myClient = client;
 }
コード例 #12
0
 public ChangeUserSettings(ProfileInfo details, SocketClient client)
 {
     InitializeComponent();
     myClient = client;
     userDetails = details;
 }