Exemplo n.º 1
0
 private void doShowUserStatus(string id, bool ShowInputDialog)
 {
     TwitterDataModel.User user = null;
     GetUserInfoArgs args = new GetUserInfoArgs();
     if (ShowInputDialog)
     {
         using (InputTabName inputName = new InputTabName())
         {
             inputName.FormTitle = "Show UserStatus";
             inputName.FormDescription = Properties.Resources.FRMessage1;
             inputName.TabName = id;
             if (inputName.ShowDialog() == DialogResult.OK &&
                 !string.IsNullOrEmpty(inputName.TabName.Trim()))
             {
                 id = inputName.TabName.Trim();
                 args.tw = tw;
                 args.id = id;
                 args.user = user;
                 using (FormInfo _info = new FormInfo(this, Properties.Resources.doShowUserStatusText1,
                                                      GetUserInfo_DoWork,
                                                      null,
                                                      args))
                 {
                     _info.ShowDialog();
                     string ret = (string)_info.Result;
                     if (string.IsNullOrEmpty(ret))
                         doShowUserStatus(args.user);
                     else
                         MessageBox.Show(ret);
                 }
             }
         }
     }
     else
     {
         args.tw = tw;
         args.id = id;
         args.user = user;
         using (FormInfo _info = new FormInfo(this, Properties.Resources.doShowUserStatusText1,
                                              GetUserInfo_DoWork,
                                              null,
                                              args))
         {
             _info.ShowDialog();
             string ret = (string)_info.Result;
             if (string.IsNullOrEmpty(ret))
             {
                 doShowUserStatus(args.user);
             }
             else
             {
                 MessageBox.Show(ret);
             }
         }
     }
 }
Exemplo n.º 2
0
        private void ShowUserStatus(string id, bool showInputDialog = true)
        {
            if (id == null)
            {
                return;
            }

            var sid = id;
            if (showInputDialog)
            {
                if (!TryUserInputText(ref sid, "Show UserStatus", R.FRMessage1))
                {
                    return;
                }

                id = sid;
            }

            if (string.IsNullOrEmpty(id))
            {
                return;
            }

            var user = new DataModels.Twitter.User();
            var args = new GetUserInfoArgs { Tw = _tw, Id = id, User = user };
            using (var info = new FormInfo(this, R.doShowUserStatusText1, GetUserInfo_DoWork, null, args))
            {
                info.ShowDialog();
                var ret = (string)info.Result;
                if (!string.IsNullOrEmpty(ret))
                {
                    MessageBox.Show(ret);
                    return;
                }
            }

            using (var userinfo = new ShowUserInfo())
            {
                userinfo.Owner = this;
                userinfo.SetUser(args.User);
                userinfo.ShowDialog(this);
                Activate();
                BringToFront();
            }
        }