Ejemplo n.º 1
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            FileStream    stream        = new FileStream("details.xml", FileMode.Open);
            XmlSerializer serialization = new XmlSerializer(typeof(UserDetails));

            details = serialization.Deserialize(stream) as UserDetails;
            if (service == null)
            {
                service = new AudioReflector.AudioReflectClient();
            }

            if (service.checkCredantials(details.Username, details.Password, 0))
            {
                UserTextBox.Text = details.Username;
                if (details.ToList != null && details.ToList.Count > 0)
                {
                    ToTextBox.Text = details.ToList[0];
                }
                PasswordTextBox.Text   = details.Password;
                RecordButton.Enabled   = true;
                SendButton.Enabled     = true;
                MessageTextBox.Enabled = true;
            }
        }
Ejemplo n.º 2
0
        private void CheckButton_Click(object sender, EventArgs e)
        {
            details.Username = UserTextBox.Text;
            string to = ToTextBox.Text;

            details.Password = PasswordTextBox.Text;
            if (string.IsNullOrEmpty(to))
            {
                toList.Add("audiotest2");
            }
            else
            {
                toList.Add(to);
            }
            details.ToList = toList;
            if (service == null)
            {
                service = new AudioReflector.AudioReflectClient();
            }

            if (service.checkCredantials(details.Username, details.Password, 0))
            {
                FileStream    stream        = new FileStream("details.xml", FileMode.Create);
                XmlSerializer serialization = new XmlSerializer(typeof(UserDetails));
                serialization.Serialize(stream, details);

                RecordButton.Enabled = true;
            }
            else
            {
                RecordButton.Enabled   = false;
                SendButton.Enabled     = false;
                MessageTextBox.Enabled = false;
            }
        }
Ejemplo n.º 3
0
        private void SendButton_Click(object sender, EventArgs e)
        {
            if (service == null)
            {
                service = new AudioReflector.AudioReflectClient();
            }

            string text = MessageTextBox.Text;
            int    _id  = service.createNewStream(details.Username, details.Password, details.ToList.ToArray(), 3);

            service.putAudio(details.Username, details.Password, 1, _id, text, 255, false, 3, false);
            service.endAudio(details.Username, details.Password, _id);
        }
Ejemplo n.º 4
0
 public ReceiveThread(AudioForm parent, string username, string password)
 {
     this.parent   = parent;
     service       = new AudioReflector.AudioReflectClient();
     receiveThread = new Thread(new ThreadStart(run));
 }