{
public partial class ShowUserInfo : OTBaseForm
{
+ private new TweenMain Owner
+ {
+ get { return (TweenMain)base.Owner; }
+ }
+
+ private Twitter Twitter
+ {
+ get { return this.Owner.TwitterInstance; }
+ }
+
public ShowUserInfo()
{
InitializeComponent();
private string Following;
private string Followers;
private string Favorites;
- private TweenMain MyOwner;
private string FriendshipResult = "";
private void InitPath()
{
string webtext;
string jumpto;
- webtext = MyOwner.TwitterInstance.PreProcessUrl("<a href=\"" + data + "\">Dummy</a>");
+ webtext = this.Twitter.PreProcessUrl("<a href=\"" + data + "\">Dummy</a>");
webtext = await ShortUrl.Instance.ExpandUrlHtmlAsync(webtext);
jumpto = Regex.Match(webtext, @"<a href=""(?<url>.*?)""").Groups["url"].Value;
ToolTip1.SetToolTip(LinkLabelWeb, jumpto);
private async Task SetDescriptionAsync(string descriptionText)
{
var html = WebUtility.HtmlEncode(descriptionText);
- html = await this.MyOwner.TwitterInstance.CreateHtmlAnchorAsync(html, this.atlist, null);
- html = this.MyOwner.createDetailHtml(html);
+ html = await this.Twitter.CreateHtmlAnchorAsync(html, this.atlist, null);
+ html = this.Owner.createDetailHtml(html);
this.DescriptionBrowser.DocumentText = html;
}
private async void ShowUserInfo_Load(object sender, EventArgs e)
{
- MyOwner = (TweenMain)this.Owner;
if (!AnalizeUserInfo(userInfo))
{
MessageBox.Show(Properties.Resources.ShowUserInfo1);
RecentPostBrowser.Visible = false;
if (_info.RecentPost != null)
{
- recentPostTxt = MyOwner.createDetailHtml(
- MyOwner.TwitterInstance.CreateHtmlAnchor(_info.RecentPost, atlist, userInfo.Status.Entities, null) +
+ recentPostTxt = this.Owner.createDetailHtml(
+ this.Twitter.CreateHtmlAnchor(_info.RecentPost, atlist, userInfo.Status.Entities, null) +
" Posted at " + _info.PostCreatedAt.ToString() +
" via " + _info.PostSource);
}
else
LabelIsVerified.Text = Properties.Resources.No;
- if (MyOwner.TwitterInstance.Username == _info.ScreenName)
+ if (this.Twitter.Username == _info.ScreenName)
{
ButtonEdit.Enabled = true;
ChangeIconToolStripMenuItem.Enabled = true;
private void LinkLabelWeb_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
if (_info.Url != null)
- MyOwner.OpenUriAsync(LinkLabelWeb.Text);
+ this.Owner.OpenUriAsync(LinkLabelWeb.Text);
}
private void LinkLabelFollowing_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
- MyOwner.OpenUriAsync(Following);
+ this.Owner.OpenUriAsync(Following);
}
private void LinkLabelFollowers_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
- MyOwner.OpenUriAsync(Followers);
+ this.Owner.OpenUriAsync(Followers);
}
private void LinkLabelTweet_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
- MyOwner.OpenUriAsync(Home);
+ this.Owner.OpenUriAsync(Home);
}
private void LinkLabelFav_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
- MyOwner.OpenUriAsync(Favorites);
+ this.Owner.OpenUriAsync(Favorites);
}
private void ButtonFollow_Click(object sender, EventArgs e)
{
- string ret = MyOwner.TwitterInstance.PostFollowCommand(_info.ScreenName);
+ string ret = this.Twitter.PostFollowCommand(_info.ScreenName);
if (!string.IsNullOrEmpty(ret))
{
MessageBox.Show(Properties.Resources.FRMessage2 + ret);
Properties.Resources.ButtonUnFollow_ClickText2,
MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
{
- string ret = MyOwner.TwitterInstance.PostRemoveCommand(_info.ScreenName);
+ string ret = this.Twitter.PostRemoveCommand(_info.ScreenName);
if (!string.IsNullOrEmpty(ret))
{
MessageBox.Show(Properties.Resources.FRMessage2 + ret);
{
string name = _info.ImageUrl.ToString();
icondata = (new HttpVarious()).GetImage(name.Replace("_normal", "_bigger"));
- if (MyOwner.TwitterInstance.Username == _info.ScreenName) return;
+ if (this.Twitter.Username == _info.ScreenName) return;
_info.isFollowing = false;
_info.isFollowed = false;
- FriendshipResult = MyOwner.TwitterInstance.GetFriendshipInfo(_info.ScreenName, ref _info.isFollowing, ref _info.isFollowed);
+ FriendshipResult = this.Twitter.GetFriendshipInfo(_info.ScreenName, ref _info.isFollowing, ref _info.isFollowed);
}
private void BackgroundWorkerImageLoader_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
UserPicture.Image = null;
}
- if (MyOwner.TwitterInstance.Username == _info.ScreenName)
+ if (this.Twitter.Username == _info.ScreenName)
{
// 自分の場合
LabelIsFollowing.Text = "";
//ハッシュタグの場合は、タブで開く
string urlStr = Uri.UnescapeDataString(e.Url.AbsoluteUri);
string hash = urlStr.Substring(urlStr.IndexOf("#"));
- MyOwner.HashSupl.AddItem(hash);
- MyOwner.HashMgr.AddHashToHistory(hash.Trim(), false);
- MyOwner.AddNewTabForSearch(hash);
+ this.Owner.HashSupl.AddItem(hash);
+ this.Owner.HashMgr.AddHashToHistory(hash.Trim(), false);
+ this.Owner.AddNewTabForSearch(hash);
return;
}
else
{
Match m = Regex.Match(e.Url.AbsoluteUri, @"^https?://twitter.com/(#!/)?(?<ScreenName>[a-zA-Z0-9_]+)$");
- if (AppendSettingDialog.Instance.OpenUserTimeline && m.Success && MyOwner.IsTwitterId(m.Result("${ScreenName}")))
+ if (AppendSettingDialog.Instance.OpenUserTimeline && m.Success && this.Owner.IsTwitterId(m.Result("${ScreenName}")))
{
- MyOwner.AddNewTabForUserTimeline(m.Result("${ScreenName}"));
+ this.Owner.AddNewTabForUserTimeline(m.Result("${ScreenName}"));
}
else
{
- MyOwner.OpenUriAsync(e.Url.OriginalString);
+ this.Owner.OpenUriAsync(e.Url.OriginalString);
}
}
}
WebBrowser sc = ContextMenuRecentPostBrowser.SourceControl as WebBrowser;
if (sc != null)
{
- string _selText = MyOwner.WebBrowser_GetSelectionText(ref sc);
+ string _selText = this.Owner.WebBrowser_GetSelectionText(ref sc);
if (_selText != null)
{
try
WebBrowser sc = ContextMenuRecentPostBrowser.SourceControl as WebBrowser;
if (sc != null)
{
- string _selText = MyOwner.WebBrowser_GetSelectionText(ref sc);
+ string _selText = this.Owner.WebBrowser_GetSelectionText(ref sc);
if (_selText == null)
SelectionCopyToolStripMenuItem.Enabled = false;
else
private void LinkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
- MyOwner.OpenUriAsync("https://support.twitter.com/groups/31-twitter-basics/topics/111-features/articles/268350-x8a8d-x8a3c-x6e08-x307f-x30a2-x30ab-x30a6-x30f3-x30c8-x306b-x3064-x3044-x3066");
+ this.Owner.OpenUriAsync("https://support.twitter.com/groups/31-twitter-basics/topics/111-features/articles/268350-x8a8d-x8a3c-x6e08-x307f-x30a2-x30ab-x30a6-x30f3-x30c8-x306b-x3064-x3044-x3066");
}
private void LinkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
- MyOwner.OpenUriAsync("https://support.twitter.com/groups/31-twitter-basics/topics/107-my-profile-account-settings/articles/243055-x516c-x958b-x3001-x975e-x516c-x958b-x30a2-x30ab-x30a6-x30f3-x30c8-x306b-x3064-x3044-x3066");
+ this.Owner.OpenUriAsync("https://support.twitter.com/groups/31-twitter-basics/topics/107-my-profile-account-settings/articles/243055-x516c-x958b-x3001-x975e-x516c-x958b-x30a2-x30ab-x30a6-x30f3-x30c8-x306b-x3064-x3044-x3066");
}
private void ButtonSearchPosts_Click(object sender, EventArgs e)
{
- MyOwner.AddNewTabForUserTimeline(_info.ScreenName);
+ this.Owner.AddNewTabForUserTimeline(_info.ScreenName);
}
private void UserPicture_DoubleClick(object sender, EventArgs e)
if (UserPicture.Image != null)
{
string name = _info.ImageUrl.ToString();
- MyOwner.OpenUriAsync(name.Remove(name.LastIndexOf("_normal"), 7));
+ this.Owner.OpenUriAsync(name.Remove(name.LastIndexOf("_normal"), 7));
}
}
private async void ButtonEdit_Click(object sender, EventArgs e)
{
// 自分以外のプロフィールは変更できない
- if (MyOwner.TwitterInstance.Username != _info.ScreenName) return;
+ if (this.Twitter.Username != _info.ScreenName) return;
this.ButtonEdit.Enabled = false;
TextBoxName.Location = LabelName.Location;
TextBoxName.Height = LabelName.Height;
TextBoxName.Width = LabelName.Width;
- TextBoxName.BackColor = MyOwner.InputBackColor;
+ TextBoxName.BackColor = this.Owner.InputBackColor;
TextBoxName.MaxLength = 20;
TextBoxName.Text = LabelName.Text;
TextBoxName.TabStop = true;
TextBoxLocation.Location = LabelLocation.Location;
TextBoxLocation.Height = LabelLocation.Height;
TextBoxLocation.Width = LabelLocation.Width;
- TextBoxLocation.BackColor = MyOwner.InputBackColor;
+ TextBoxLocation.BackColor = this.Owner.InputBackColor;
TextBoxLocation.MaxLength = 30;
TextBoxLocation.Text = LabelLocation.Text;
TextBoxLocation.TabStop = true;
TextBoxWeb.Location = LinkLabelWeb.Location;
TextBoxWeb.Height = LinkLabelWeb.Height;
TextBoxWeb.Width = LinkLabelWeb.Width;
- TextBoxWeb.BackColor = MyOwner.InputBackColor;
+ TextBoxWeb.BackColor = this.Owner.InputBackColor;
TextBoxWeb.MaxLength = 100;
TextBoxWeb.Text = _info.Url;
TextBoxWeb.TabStop = true;
TextBoxDescription.Location = DescriptionBrowser.Location;
TextBoxDescription.Height = DescriptionBrowser.Height;
TextBoxDescription.Width = DescriptionBrowser.Width;
- TextBoxDescription.BackColor = MyOwner.InputBackColor;
+ TextBoxDescription.BackColor = this.Owner.InputBackColor;
TextBoxDescription.MaxLength = 160;
TextBoxDescription.Text = _info.Description;
TextBoxDescription.Multiline = true;
TextBoxWeb.Modified ||
TextBoxDescription.Modified)
{
- arg.tw = MyOwner.TwitterInstance;
+ arg.tw = this.Twitter;
arg.name = TextBoxName.Text.Trim();
arg.url = TextBoxWeb.Text.Trim();
arg.location = TextBoxLocation.Text.Trim();
try
{
- res = MyOwner.TwitterInstance.GetUserInfo(_info.ScreenName, ref user);
+ res = this.Twitter.GetUserInfo(_info.ScreenName, ref user);
Image img = (new HttpVarious()).GetImage(user.ProfileImageUrlHttps);
if (img != null)
{
private void doChangeIcon(string filename)
{
string res = "";
- UpdateProfileImageArgs arg = new UpdateProfileImageArgs() { tw = MyOwner.TwitterInstance, FileName = filename };
+ UpdateProfileImageArgs arg = new UpdateProfileImageArgs() { tw = this.Twitter, FileName = filename };
using (FormInfo dlg = new FormInfo(this, Properties.Resources.ChangeIconToolStripMenuItem_ClickText3,
UpdateProfileImage_Dowork,
Properties.Resources.ButtonBlock_ClickText2,
MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
{
- string res = MyOwner.TwitterInstance.PostCreateBlock(_info.ScreenName);
+ string res = this.Twitter.PostCreateBlock(_info.ScreenName);
if (!string.IsNullOrEmpty(res))
{
MessageBox.Show(res + Environment.NewLine + Properties.Resources.ButtonBlock_ClickText3);
Properties.Resources.ButtonReportSpam_ClickText2,
MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
{
- string res = MyOwner.TwitterInstance.PostReportSpam(_info.ScreenName);
+ string res = this.Twitter.PostReportSpam(_info.ScreenName);
if (!string.IsNullOrEmpty(res))
{
MessageBox.Show(res + Environment.NewLine + Properties.Resources.ButtonReportSpam_ClickText3);
Properties.Resources.ButtonBlockDestroy_ClickText2,
MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
{
- string res = MyOwner.TwitterInstance.PostDestroyBlock(_info.ScreenName);
+ string res = this.Twitter.PostDestroyBlock(_info.ScreenName);
if (!string.IsNullOrEmpty(res))
{
MessageBox.Show(res + Environment.NewLine + Properties.Resources.ButtonBlockDestroy_ClickText3);