Example #1
0
 private void ShowFriendship(string id)
 {
     ShowFriendshipArgs args = new ShowFriendshipArgs();
     args.tw = tw;
     using (InputTabName inputName = new InputTabName())
     {
         inputName.FormTitle = "Show Friendships";
         inputName.FormDescription = Properties.Resources.FRMessage1;
         inputName.TabName = id;
         if (inputName.ShowDialog() == DialogResult.OK &&
             !string.IsNullOrEmpty(inputName.TabName.Trim()))
         {
             string ret = "";
             args.ids.Add(new ShowFriendshipArgs.FriendshipInfo(inputName.TabName.Trim()));
             using (FormInfo _info = new FormInfo(this, Properties.Resources.ShowFriendshipText1,
                                                  ShowFriendship_DoWork,
                                                  null,
                                                  args))
             {
                 _info.ShowDialog();
                 ret = (string)_info.Result;
             }
             string result = "";
             if (string.IsNullOrEmpty(ret))
             {
                 if (args.ids[0].isFollowing)
                 {
                     result = Properties.Resources.GetFriendshipInfo1 + System.Environment.NewLine;
                 }
                 else
                 {
                     result = Properties.Resources.GetFriendshipInfo2 + System.Environment.NewLine;
                 }
                 if (args.ids[0].isFollowed)
                 {
                     result += Properties.Resources.GetFriendshipInfo3;
                 }
                 else
                 {
                     result += Properties.Resources.GetFriendshipInfo4;
                 }
                 result = args.ids[0].id + Properties.Resources.GetFriendshipInfo5 + System.Environment.NewLine + result;
             }
             else
             {
                 result = ret;
             }
             MessageBox.Show(result);
         }
     }
 }
Example #2
0
        private void ShowFriendship(string[] ids)
        {
            foreach (string id in ids)
            {
                string ret = "";
                ShowFriendshipArgs args = new ShowFriendshipArgs();
                args.tw = tw;
                args.ids.Add(new ShowFriendshipArgs.FriendshipInfo(id.Trim()));
                using (FormInfo _info = new FormInfo(this, Properties.Resources.ShowFriendshipText1,
                                                     ShowFriendship_DoWork,
                                                     null,
                                                     args))
                {
                    _info.ShowDialog();
                    ret = (string)_info.Result;
                }
                string result = "";
                ShowFriendshipArgs.FriendshipInfo fInfo = args.ids[0];
                string ff = "";
                if (string.IsNullOrEmpty(ret))
                {
                    ff = "  ";
                    if (fInfo.isFollowing)
                    {
                        ff += Properties.Resources.GetFriendshipInfo1;
                    }
                    else
                    {
                        ff += Properties.Resources.GetFriendshipInfo2;
                    }

                    ff += System.Environment.NewLine + "  ";
                    if (fInfo.isFollowed)
                    {
                        ff += Properties.Resources.GetFriendshipInfo3;
                    }
                    else
                    {
                        ff += Properties.Resources.GetFriendshipInfo4;
                    }
                    result += fInfo.id + Properties.Resources.GetFriendshipInfo5 + System.Environment.NewLine + ff;
                    if (fInfo.isFollowing)
                    {
                        if (MessageBox.Show(
                            Properties.Resources.GetFriendshipInfo7 + System.Environment.NewLine + result, Properties.Resources.GetFriendshipInfo8,
                            MessageBoxButtons.YesNo,
                            MessageBoxIcon.Question,
                            MessageBoxDefaultButton.Button2) == DialogResult.Yes)
                        {
                            RemoveCommand(fInfo.id, true);
                        }
                    }
                    else
                    {
                        MessageBox.Show(result);
                    }
                }
                else
                {
                    MessageBox.Show(ret);
                }
            }
        }
Example #3
0
        private void ShowFriendshipCore(string id)
        {
            if (string.IsNullOrEmpty(id))
            {
                return;
            }

            id = id.Trim();
            if (id.ToLower() == _tw.Username.ToLower())
            {
                return;
            }

            var args = new ShowFriendshipArgs { Tw = _tw };
            args.Ids.Add(new ShowFriendshipArgs.FriendshipInfo(id));
            string ret;
            using (var formInfo = new FormInfo(this, R.ShowFriendshipText1, ShowFriendship_DoWork, null, args))
            {
                formInfo.ShowDialog();
                ret = (string)formInfo.Result;
            }

            if (!string.IsNullOrEmpty(ret))
            {
                MessageBox.Show(ret);
                return;
            }

            ShowFriendshipArgs.FriendshipInfo frsinfo = args.Ids[0];
            string fing = frsinfo.IsFollowing ?
                R.GetFriendshipInfo1 :
                R.GetFriendshipInfo2;
            string fed = frsinfo.IsFollowed ?
                R.GetFriendshipInfo3 :
                R.GetFriendshipInfo4;
            string result = frsinfo.Id + R.GetFriendshipInfo5 + Environment.NewLine;
            result += "  " + fing + Environment.NewLine;
            result += "  " + fed;
            if (frsinfo.IsFollowing)
            {
                var rslt = MessageBox.Show(R.GetFriendshipInfo7 + Environment.NewLine + result, R.GetFriendshipInfo8, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                if (rslt == DialogResult.Yes)
                {
                    RemoveCommand(frsinfo.Id, true);
                }
            }
            else
            {
                MessageBox.Show(result);
            }
        }