예제 #1
0
 public void voiceBtnPost_Click(string message)
 {
     if (FBClass.Post(AppSettings.Default.AccessToken, message) == true)
     {
         MessageBox.Show("Posted to your wall");
     }
 }
예제 #2
0
 private void btnPost_Click(object sender, EventArgs e)
 {
     if (FBClass.Post(AppSettings.Default.AccessToken, txtStatus.Text) == true)
     {
         MessageBox.Show("Posted to your wall");
     }
 }
예제 #3
0
        /* public void getFriendList()
         * {
         *   int i = 0;
         *   ListFriend = FBClass.voiceGetFrndList(AppSettings.Default.AccessToken);
         *   while (ListFriend[i] != "###")
         *   {
         *       //String elem = ListFriend[i];
         *       //viewFriendList.Items.Add(new ListViewItem(elem,i));
         *
         *       i++;
         *   }
         *   MessageBox.Show(i.ToString());
         * }*/



        private void btnGetFrndList_Click(object sender, EventArgs e)
        {
            ListFriend = FBClass.voiceGetFrndList(AppSettings.Default.AccessToken);

            viewFriendList.Items.Clear();
            foreach (String elem in ListFriend)
            {
                viewFriendList.Items.Add(new ListViewItem(elem));
            }
        }
예제 #4
0
 private void btnLogin_Click(object sender, EventArgs e)
 {
     if (IsLogin != true)
     {
         frmLogin frm = new frmLogin();
         frm.ShowDialog();
     }
     else
     {
         lblAccountName.Text = FBClass.GetUserName(AppSettings.Default.AccessToken);
         String imgURL = String.Format("http://graph.facebook.com/{0}/picture", FBClass.GetUserID(AppSettings.Default.AccessToken));
         imgAccount.ImageLocation = imgURL;
     }
 }
예제 #5
0
 public void voiceLogin()
 {
     if (IsLogin != true)
     {
         frmLogin frm = new frmLogin();
         frm.ShowDialog();
     }
     else
     {
         //lblAccountName.Text = FBClass.GetUserName(AppSettings.Default.AccessToken);
         String imgURL = String.Format("http://graph.facebook.com/{0}/picture", FBClass.GetUserID(AppSettings.Default.AccessToken));
         imgAccount.ImageLocation = imgURL;
     }
 }
예제 #6
0
        void sre_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
        {
            //MessageBox.Show("Speech recognized: " +e.Result.Text+"...");
            if (e != null)
            {
                int    ranNum = rnd.Next(1, 10);
                string speech = e.Result.Text;
                int    NotifcationCount;


                switch (speech)
                {
                case "Login":
                    fbSynth.Speak("Loging in to facebook...");
                    count++;
                    fbMain.voiceLogin();
                    break;

                case "Options":
                    if (count > 0)
                    {
                        fbSynth.Speak("Notifications , Messages , Post to your wall , Friends list");
                    }
                    else
                    {
                        fbSynth.Speak("First you have to login...");
                    }
                    break;


                case "Post to your wall":
                    if (count > 0)
                    {
                        fbSynth.Speak("Say hi to your friends...");
                        count++;
                    }
                    else
                    {
                        fbSynth.Speak("First you have to login...");
                    }

                    break;

                case "hi friends":
                    if (count > 1)
                    {
                        fbMain.voiceBtnPost_Click("hi friends");
                    }
                    else
                    {
                        fbSynth.Speak("come through proper order...");
                    }
                    break;

                case "hi how are you all":
                    if (count > 1)
                    {
                        fbMain.voiceBtnPost_Click("hi how are you all?");
                    }
                    else
                    {
                        fbSynth.Speak("come through proper order...");
                    }
                    break;

                case "Friend list":
                    fbSynth.Speak("Getting Friends list");
                    int i = 0;
                    ListFriend = FBClass.voiceGetFrndList(AppSettings.Default.AccessToken);
                    while (ListFriend[i] != "###")
                    {
                        i++;
                    }
                    fbSynth.Speak("You have " + i + " Friends");
                    break;

                case "Notifications":
                    fbSynth.Speak("Getting Notification");
                    NotifcationCount = FBClass.CountNotifications(AppSettings.Default.AccessToken);
                    title            = FBClass.GetNotifications(AppSettings.Default.AccessToken);
                    fbSynth.Speak("Currently you have " + ",,,, " + NotifcationCount + ",,,,   " + " Notifications");
                    fbSynth.Speak(" " + title + " ");
                    break;

                case "Messages":
                    CountMsg = FBClass.CountMessages(AppSettings.Default.AccessToken);
                    fbSynth.Speak("You have " + CountMsg + " messages");
                    break;
                }
            }
            else
            {
                fbSynth.Speak("I didnt Understand you");
            }
        }