From: rin roula Date: Thu, 5 Jan 2012 23:11:13 +0000 (+0900) Subject: Port ListAvailable.cs to C# X-Git-Tag: OpenTween_v1.0.0~18^2~18 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=784e6cd54dba365ece693fe45a709afd9cbe9951;p=opentween%2Fopen-tween.git Port ListAvailable.cs to C# --- diff --git a/Tween/ListAvailable.Designer.vb b/Tween/ListAvailable.Designer.vb deleted file mode 100644 index 06dd6f8a..00000000 --- a/Tween/ListAvailable.Designer.vb +++ /dev/null @@ -1,191 +0,0 @@ - _ -Partial Class ListAvailable - Inherits System.Windows.Forms.Form - - 'フォームがコンポーネントの一覧をクリーンアップするために dispose をオーバーライドします。 - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub - - 'Windows フォーム デザイナで必要です。 - Private components As System.ComponentModel.IContainer - - 'メモ: 以下のプロシージャは Windows フォーム デザイナで必要です。 - 'Windows フォーム デザイナを使用して変更できます。 - 'コード エディタを使って変更しないでください。 - _ - Private Sub InitializeComponent() - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(ListAvailable)) - Me.TableLayoutPanel1 = New System.Windows.Forms.TableLayoutPanel() - Me.OK_Button = New System.Windows.Forms.Button() - Me.Cancel_Button = New System.Windows.Forms.Button() - Me.Label1 = New System.Windows.Forms.Label() - Me.UsernameLabel = New System.Windows.Forms.Label() - Me.NameLabel = New System.Windows.Forms.Label() - Me.Label4 = New System.Windows.Forms.Label() - Me.Label6 = New System.Windows.Forms.Label() - Me.StatusLabel = New System.Windows.Forms.Label() - Me.Label8 = New System.Windows.Forms.Label() - Me.MemberCountLabel = New System.Windows.Forms.Label() - Me.Label10 = New System.Windows.Forms.Label() - Me.SubscriberCountLabel = New System.Windows.Forms.Label() - Me.Label12 = New System.Windows.Forms.Label() - Me.DescriptionText = New System.Windows.Forms.TextBox() - Me.RefreshButton = New System.Windows.Forms.Button() - Me.ListsList = New System.Windows.Forms.ListBox() - Me.TableLayoutPanel1.SuspendLayout() - Me.SuspendLayout() - ' - 'TableLayoutPanel1 - ' - resources.ApplyResources(Me.TableLayoutPanel1, "TableLayoutPanel1") - Me.TableLayoutPanel1.Controls.Add(Me.OK_Button, 0, 0) - Me.TableLayoutPanel1.Controls.Add(Me.Cancel_Button, 1, 0) - Me.TableLayoutPanel1.Name = "TableLayoutPanel1" - ' - 'OK_Button - ' - resources.ApplyResources(Me.OK_Button, "OK_Button") - Me.OK_Button.Name = "OK_Button" - ' - 'Cancel_Button - ' - resources.ApplyResources(Me.Cancel_Button, "Cancel_Button") - Me.Cancel_Button.DialogResult = System.Windows.Forms.DialogResult.Cancel - Me.Cancel_Button.Name = "Cancel_Button" - ' - 'Label1 - ' - resources.ApplyResources(Me.Label1, "Label1") - Me.Label1.Name = "Label1" - ' - 'UsernameLabel - ' - Me.UsernameLabel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D - resources.ApplyResources(Me.UsernameLabel, "UsernameLabel") - Me.UsernameLabel.Name = "UsernameLabel" - ' - 'NameLabel - ' - Me.NameLabel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D - resources.ApplyResources(Me.NameLabel, "NameLabel") - Me.NameLabel.Name = "NameLabel" - ' - 'Label4 - ' - resources.ApplyResources(Me.Label4, "Label4") - Me.Label4.Name = "Label4" - ' - 'Label6 - ' - resources.ApplyResources(Me.Label6, "Label6") - Me.Label6.Name = "Label6" - ' - 'StatusLabel - ' - Me.StatusLabel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D - resources.ApplyResources(Me.StatusLabel, "StatusLabel") - Me.StatusLabel.Name = "StatusLabel" - ' - 'Label8 - ' - resources.ApplyResources(Me.Label8, "Label8") - Me.Label8.Name = "Label8" - ' - 'MemberCountLabel - ' - Me.MemberCountLabel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D - resources.ApplyResources(Me.MemberCountLabel, "MemberCountLabel") - Me.MemberCountLabel.Name = "MemberCountLabel" - ' - 'Label10 - ' - resources.ApplyResources(Me.Label10, "Label10") - Me.Label10.Name = "Label10" - ' - 'SubscriberCountLabel - ' - Me.SubscriberCountLabel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D - resources.ApplyResources(Me.SubscriberCountLabel, "SubscriberCountLabel") - Me.SubscriberCountLabel.Name = "SubscriberCountLabel" - ' - 'Label12 - ' - resources.ApplyResources(Me.Label12, "Label12") - Me.Label12.Name = "Label12" - ' - 'DescriptionText - ' - resources.ApplyResources(Me.DescriptionText, "DescriptionText") - Me.DescriptionText.Name = "DescriptionText" - Me.DescriptionText.ReadOnly = True - Me.DescriptionText.TabStop = False - ' - 'RefreshButton - ' - resources.ApplyResources(Me.RefreshButton, "RefreshButton") - Me.RefreshButton.Name = "RefreshButton" - ' - 'ListsList - ' - Me.ListsList.FormattingEnabled = True - resources.ApplyResources(Me.ListsList, "ListsList") - Me.ListsList.Name = "ListsList" - ' - 'ListAvailable - ' - Me.AcceptButton = Me.OK_Button - resources.ApplyResources(Me, "$this") - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.CancelButton = Me.Cancel_Button - Me.Controls.Add(Me.ListsList) - Me.Controls.Add(Me.RefreshButton) - Me.Controls.Add(Me.DescriptionText) - Me.Controls.Add(Me.SubscriberCountLabel) - Me.Controls.Add(Me.Label12) - Me.Controls.Add(Me.MemberCountLabel) - Me.Controls.Add(Me.Label10) - Me.Controls.Add(Me.StatusLabel) - Me.Controls.Add(Me.Label8) - Me.Controls.Add(Me.Label6) - Me.Controls.Add(Me.NameLabel) - Me.Controls.Add(Me.Label4) - Me.Controls.Add(Me.UsernameLabel) - Me.Controls.Add(Me.Label1) - Me.Controls.Add(Me.TableLayoutPanel1) - Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog - Me.MaximizeBox = False - Me.MinimizeBox = False - Me.Name = "ListAvailable" - Me.ShowInTaskbar = False - Me.TableLayoutPanel1.ResumeLayout(False) - Me.ResumeLayout(False) - Me.PerformLayout() - - End Sub - Friend WithEvents TableLayoutPanel1 As System.Windows.Forms.TableLayoutPanel - Friend WithEvents OK_Button As System.Windows.Forms.Button - Friend WithEvents Cancel_Button As System.Windows.Forms.Button - Friend WithEvents Label1 As System.Windows.Forms.Label - Friend WithEvents UsernameLabel As System.Windows.Forms.Label - Friend WithEvents NameLabel As System.Windows.Forms.Label - Friend WithEvents Label4 As System.Windows.Forms.Label - Friend WithEvents Label6 As System.Windows.Forms.Label - Friend WithEvents StatusLabel As System.Windows.Forms.Label - Friend WithEvents Label8 As System.Windows.Forms.Label - Friend WithEvents MemberCountLabel As System.Windows.Forms.Label - Friend WithEvents Label10 As System.Windows.Forms.Label - Friend WithEvents SubscriberCountLabel As System.Windows.Forms.Label - Friend WithEvents Label12 As System.Windows.Forms.Label - Friend WithEvents DescriptionText As System.Windows.Forms.TextBox - Friend WithEvents RefreshButton As System.Windows.Forms.Button - Friend WithEvents ListsList As System.Windows.Forms.ListBox - -End Class diff --git a/Tween/ListAvailable.vb b/Tween/ListAvailable.vb deleted file mode 100644 index e6ac2e41..00000000 --- a/Tween/ListAvailable.vb +++ /dev/null @@ -1,120 +0,0 @@ -' Tween - Client of Twitter -' Copyright (c) 2007-2011 kiri_feather (@kiri_feather) -' (c) 2008-2011 Moz (@syo68k) -' (c) 2008-2011 takeshik (@takeshik) -' (c) 2010-2011 anis774 (@anis774) -' (c) 2010-2011 fantasticswallow (@f_swallow) -' All rights reserved. -' -' This file is part of Tween. -' -' This program is free software; you can redistribute it and/or modify it -' under the terms of the GNU General Public License as published by the Free -' Software Foundation; either version 3 of the License, or (at your option) -' any later version. -' -' This program is distributed in the hope that it will be useful, but -' WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -' or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -' for more details. -' -' You should have received a copy of the GNU General Public License along -' with this program. If not, see , or write to -' the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, -' Boston, MA 02110-1301, USA. - -Imports System.ComponentModel - -Public Class ListAvailable - - Private _selectedList As ListElement = Nothing - Public ReadOnly Property SelectedList() As ListElement - Get - Return _selectedList - End Get - End Property - - Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click - If Me.ListsList.SelectedIndex > -1 Then - _selectedList = DirectCast(Me.ListsList.SelectedItem, ListElement) - Me.DialogResult = System.Windows.Forms.DialogResult.OK - Me.Close() - End If - End Sub - - Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click - _selectedList = Nothing - Me.DialogResult = System.Windows.Forms.DialogResult.Cancel - Me.Close() - End Sub - - Private Sub ListAvailable_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown - If TabInformations.GetInstance().SubscribableLists.Count = 0 Then Me.RefreshLists() - Me.ListsList.Items.AddRange(TabInformations.GetInstance.SubscribableLists.ToArray) - If Me.ListsList.Items.Count > 0 Then - Me.ListsList.SelectedIndex = 0 - Else - Me.UsernameLabel.Text = "" - Me.NameLabel.Text = "" - Me.StatusLabel.Text = "" - Me.MemberCountLabel.Text = "0" - Me.SubscriberCountLabel.Text = "0" - Me.DescriptionText.Text = "" - End If - End Sub - - Private Sub ListsList_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListsList.SelectedIndexChanged - Dim lst As ListElement - If Me.ListsList.SelectedIndex > -1 Then - lst = DirectCast(Me.ListsList.SelectedItem, ListElement) - Else - lst = Nothing - End If - If lst Is Nothing Then - Me.UsernameLabel.Text = "" - Me.NameLabel.Text = "" - Me.StatusLabel.Text = "" - Me.MemberCountLabel.Text = "0" - Me.SubscriberCountLabel.Text = "0" - Me.DescriptionText.Text = "" - Else - Me.UsernameLabel.Text = lst.Username + " / " + lst.Nickname - Me.NameLabel.Text = lst.Name - If lst.IsPublic Then - Me.StatusLabel.Text = "Public" - Else - Me.StatusLabel.Text = "Private" - End If - Me.MemberCountLabel.Text = lst.MemberCount.ToString("#,##0") - Me.SubscriberCountLabel.Text = lst.SubscriberCount.ToString("#,##0") - Me.DescriptionText.Text = lst.Description - End If - End Sub - - Private Sub RefreshButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RefreshButton.Click - Me.RefreshLists() - Me.ListsList.Items.Clear() - Me.ListsList.Items.AddRange(TabInformations.GetInstance.SubscribableLists.ToArray) - If Me.ListsList.Items.Count > 0 Then - Me.ListsList.SelectedIndex = 0 - End If - End Sub - - Private Sub RefreshLists() - Using dlg As New FormInfo(Me, "Getting Lists...", AddressOf RefreshLists_DoWork) - dlg.ShowDialog() - If Not String.IsNullOrEmpty(DirectCast(dlg.Result, String)) Then - MessageBox.Show("Failed to get lists. (" + DirectCast(dlg.Result, String) + ")") - Exit Sub - End If - End Using - End Sub - - Private Sub RefreshLists_DoWork(ByVal sender As Object, ByVal e As DoWorkEventArgs) - Try - e.Result = DirectCast(Me.Owner, TweenMain).TwitterInstance.GetListsApi() - Catch ex As InvalidCastException - Exit Sub - End Try - End Sub -End Class diff --git a/Tween/Tween.vbproj b/Tween/Tween.vbproj index f4c1f0b8..3cb62efe 100644 --- a/Tween/Tween.vbproj +++ b/Tween/Tween.vbproj @@ -123,12 +123,6 @@ Form - - ListAvailable.vb - - - Form - True @@ -166,18 +160,6 @@ HashtagManage.vb Designer - - Designer - ListAvailable.vb - - - Designer - ListAvailable.vb - - - ListAvailable.vb - Designer - Designer diff --git a/TweenCS/ListAvailable.Designer.cs b/TweenCS/ListAvailable.Designer.cs new file mode 100644 index 00000000..4eb9ad22 --- /dev/null +++ b/TweenCS/ListAvailable.Designer.cs @@ -0,0 +1,202 @@ +namespace Tween +{ + partial class ListAvailable + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ListAvailable)); + this.TableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.OK_Button = new System.Windows.Forms.Button(); + this.Cancel_Button = new System.Windows.Forms.Button(); + this.Label1 = new System.Windows.Forms.Label(); + this.UsernameLabel = new System.Windows.Forms.Label(); + this.NameLabel = new System.Windows.Forms.Label(); + this.Label4 = new System.Windows.Forms.Label(); + this.Label6 = new System.Windows.Forms.Label(); + this.StatusLabel = new System.Windows.Forms.Label(); + this.Label8 = new System.Windows.Forms.Label(); + this.MemberCountLabel = new System.Windows.Forms.Label(); + this.Label10 = new System.Windows.Forms.Label(); + this.SubscriberCountLabel = new System.Windows.Forms.Label(); + this.Label12 = new System.Windows.Forms.Label(); + this.DescriptionText = new System.Windows.Forms.TextBox(); + this.RefreshButton = new System.Windows.Forms.Button(); + this.ListsList = new System.Windows.Forms.ListBox(); + this.TableLayoutPanel1.SuspendLayout(); + this.SuspendLayout(); + // + // TableLayoutPanel1 + // + resources.ApplyResources(this.TableLayoutPanel1, "TableLayoutPanel1"); + this.TableLayoutPanel1.Controls.Add(this.OK_Button, 0, 0); + this.TableLayoutPanel1.Controls.Add(this.Cancel_Button, 1, 0); + this.TableLayoutPanel1.Name = "TableLayoutPanel1"; + // + // OK_Button + // + resources.ApplyResources(this.OK_Button, "OK_Button"); + this.OK_Button.Name = "OK_Button"; + this.OK_Button.Click += new System.EventHandler(this.OK_Button_Click); + // + // Cancel_Button + // + resources.ApplyResources(this.Cancel_Button, "Cancel_Button"); + this.Cancel_Button.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.Cancel_Button.Name = "Cancel_Button"; + this.Cancel_Button.Click += new System.EventHandler(this.Cancel_Button_Click); + // + // Label1 + // + resources.ApplyResources(this.Label1, "Label1"); + this.Label1.Name = "Label1"; + // + // UsernameLabel + // + this.UsernameLabel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + resources.ApplyResources(this.UsernameLabel, "UsernameLabel"); + this.UsernameLabel.Name = "UsernameLabel"; + // + // NameLabel + // + this.NameLabel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + resources.ApplyResources(this.NameLabel, "NameLabel"); + this.NameLabel.Name = "NameLabel"; + // + // Label4 + // + resources.ApplyResources(this.Label4, "Label4"); + this.Label4.Name = "Label4"; + // + // Label6 + // + resources.ApplyResources(this.Label6, "Label6"); + this.Label6.Name = "Label6"; + // + // StatusLabel + // + this.StatusLabel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + resources.ApplyResources(this.StatusLabel, "StatusLabel"); + this.StatusLabel.Name = "StatusLabel"; + // + // Label8 + // + resources.ApplyResources(this.Label8, "Label8"); + this.Label8.Name = "Label8"; + // + // MemberCountLabel + // + this.MemberCountLabel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + resources.ApplyResources(this.MemberCountLabel, "MemberCountLabel"); + this.MemberCountLabel.Name = "MemberCountLabel"; + // + // Label10 + // + resources.ApplyResources(this.Label10, "Label10"); + this.Label10.Name = "Label10"; + // + // SubscriberCountLabel + // + this.SubscriberCountLabel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + resources.ApplyResources(this.SubscriberCountLabel, "SubscriberCountLabel"); + this.SubscriberCountLabel.Name = "SubscriberCountLabel"; + // + // Label12 + // + resources.ApplyResources(this.Label12, "Label12"); + this.Label12.Name = "Label12"; + // + // DescriptionText + // + resources.ApplyResources(this.DescriptionText, "DescriptionText"); + this.DescriptionText.Name = "DescriptionText"; + this.DescriptionText.ReadOnly = true; + this.DescriptionText.TabStop = false; + // + // RefreshButton + // + resources.ApplyResources(this.RefreshButton, "RefreshButton"); + this.RefreshButton.Name = "RefreshButton"; + this.RefreshButton.Click += new System.EventHandler(this.RefreshButton_Click); + // + // ListsList + // + this.ListsList.FormattingEnabled = true; + resources.ApplyResources(this.ListsList, "ListsList"); + this.ListsList.Name = "ListsList"; + // + // ListAvailable + // + this.AcceptButton = this.OK_Button; + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.Cancel_Button; + this.Controls.Add(this.ListsList); + this.Controls.Add(this.RefreshButton); + this.Controls.Add(this.DescriptionText); + this.Controls.Add(this.SubscriberCountLabel); + this.Controls.Add(this.Label12); + this.Controls.Add(this.MemberCountLabel); + this.Controls.Add(this.Label10); + this.Controls.Add(this.StatusLabel); + this.Controls.Add(this.Label8); + this.Controls.Add(this.Label6); + this.Controls.Add(this.NameLabel); + this.Controls.Add(this.Label4); + this.Controls.Add(this.UsernameLabel); + this.Controls.Add(this.Label1); + this.Controls.Add(this.TableLayoutPanel1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "ListAvailable"; + this.ShowInTaskbar = false; + this.TableLayoutPanel1.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + } + + #endregion + + internal System.Windows.Forms.TableLayoutPanel TableLayoutPanel1; + internal System.Windows.Forms.Button OK_Button; + internal System.Windows.Forms.Button Cancel_Button; + internal System.Windows.Forms.Label Label1; + internal System.Windows.Forms.Label UsernameLabel; + internal System.Windows.Forms.Label NameLabel; + internal System.Windows.Forms.Label Label4; + internal System.Windows.Forms.Label Label6; + internal System.Windows.Forms.Label StatusLabel; + internal System.Windows.Forms.Label Label8; + internal System.Windows.Forms.Label MemberCountLabel; + internal System.Windows.Forms.Label Label10; + internal System.Windows.Forms.Label SubscriberCountLabel; + internal System.Windows.Forms.Label Label12; + internal System.Windows.Forms.TextBox DescriptionText; + internal System.Windows.Forms.Button RefreshButton; + internal System.Windows.Forms.ListBox ListsList; + } +} \ No newline at end of file diff --git a/TweenCS/ListAvailable.cs b/TweenCS/ListAvailable.cs new file mode 100644 index 00000000..dc2c4c77 --- /dev/null +++ b/TweenCS/ListAvailable.cs @@ -0,0 +1,157 @@ +// Tween - Client of Twitter +// Copyright (c) 2007-2011 kiri_feather (@kiri_feather) +// (c) 2008-2011 Moz (@syo68k) +// (c) 2008-2011 takeshik (@takeshik) +// (c) 2010-2011 anis774 (@anis774) +// (c) 2010-2011 fantasticswallow (@f_swallow) +// All rights reserved. +// +// This file is part of Tween. +// +// This program is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 3 of the License, or (at your option) +// any later version. +// +// This program is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with this program. If not, see , or write to +// the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, +// Boston, MA 02110-1301, USA. + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace Tween +{ + public partial class ListAvailable : Form + { + private ListElement _selectedList = null; + public ListElement SelectedList + { + get + { + return _selectedList; + } + } + + private void OK_Button_Click(object sender, EventArgs e) + { + if (this.ListsList.SelectedIndex > -1) { + _selectedList = (ListElement)this.ListsList.SelectedItem; + this.DialogResult = System.Windows.Forms.DialogResult.OK; + this.Close(); + } + } + + private void Cancel_Button_Click(object sender, EventArgs e) + { + _selectedList = null; + this.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.Close(); + } + + private void Cancel_Button_Shown(object sender, EventArgs e) + { + if (TabInformations.GetInstance().SubscribableLists.Count == 0) this.RefreshLists(); + this.ListsList.Items.AddRange(TabInformations.GetInstance().SubscribableLists.ToArray()); + if (this.ListsList.Items.Count > 0) + { + this.ListsList.SelectedIndex = 0; + } + else + { + this.UsernameLabel.Text = ""; + this.NameLabel.Text = ""; + this.StatusLabel.Text = ""; + this.MemberCountLabel.Text = "0"; + this.SubscriberCountLabel.Text = "0"; + this.DescriptionText.Text = ""; + } + } + + private void ListsList_SelectedIndexChanged(object sender, EventArgs e) + { + ListElement lst; + if (this.ListsList.SelectedIndex > -1) + { + lst = (ListElement)this.ListsList.SelectedItem; + } + else + { + lst = null; + } + if (lst == null) + { + this.UsernameLabel.Text = ""; + this.NameLabel.Text = ""; + this.StatusLabel.Text = ""; + this.MemberCountLabel.Text = "0"; + this.SubscriberCountLabel.Text = "0"; + this.DescriptionText.Text = ""; + } + else + { + this.UsernameLabel.Text = lst.Username + " / " + lst.Nickname; + this.NameLabel.Text = lst.Name; + if (lst.IsPublic) + { + this.StatusLabel.Text = "Public"; + } + else + { + this.StatusLabel.Text = "Private"; + } + this.MemberCountLabel.Text = lst.MemberCount.ToString("#,##0"); + this.SubscriberCountLabel.Text = lst.SubscriberCount.ToString("#,##0"); + this.DescriptionText.Text = lst.Description; + } + } + + private void RefreshButton_Click(object sender, EventArgs e) + { + this.RefreshLists(); + this.ListsList.Items.Clear(); + this.ListsList.Items.AddRange(TabInformations.GetInstance().SubscribableLists.ToArray()); + if (this.ListsList.Items.Count > 0) + { + this.ListsList.SelectedIndex = 0; + } + } + + private void RefreshLists() + { + using (FormInfo dlg = new FormInfo(this, "Getting Lists...", RefreshLists_DoWork)) + { + dlg.ShowDialog(); + if (!String.IsNullOrEmpty(dlg.Result as String)) + { + MessageBox.Show("Failed to get lists. (" + (String)dlg.Result + ")"); + return; + } + } + } + + private void RefreshLists_DoWork(object sender, DoWorkEventArgs e) + { + try + { + e.Result = ((TweenMain)this.Owner).TwitterInstance.GetListsApi(); + } + catch (InvalidCastException ex) + { + return; + } + } + } +} diff --git a/Tween/ListAvailable.en.resx b/TweenCS/ListAvailable.en.resx similarity index 97% rename from Tween/ListAvailable.en.resx rename to TweenCS/ListAvailable.en.resx index cf5edb5b..22e7e282 100644 --- a/Tween/ListAvailable.en.resx +++ b/TweenCS/ListAvailable.en.resx @@ -1,160 +1,160 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Cancel - - - - 37, 12 - - - Owner - - - 24, 12 - - - List - - - 63, 12 - - - Description - - - 38, 12 - - - Status - - - 51, 12 - - - Members - - - 65, 12 - - - Subscribers - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Cancel + + + + 37, 12 + + + Owner + + + 24, 12 + + + List + + + 63, 12 + + + Description + + + 38, 12 + + + Status + + + 51, 12 + + + Members + + + 65, 12 + + + Subscribers + \ No newline at end of file diff --git a/Tween/ListAvailable.resx b/TweenCS/ListAvailable.resx similarity index 87% rename from Tween/ListAvailable.resx rename to TweenCS/ListAvailable.resx index fb34f346..1581da80 100644 --- a/Tween/ListAvailable.resx +++ b/TweenCS/ListAvailable.resx @@ -1,597 +1,621 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - Bottom, Right - - - - 2 - - - None - - - - 3, 3 - - - 67, 21 - - - 0 - - - OK - - - OK_Button - - - System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - TableLayoutPanel1 - - - 0 - - - None - - - 76, 3 - - - 67, 21 - - - 1 - - - キャンセル - - - Cancel_Button - - - System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - TableLayoutPanel1 - - - 1 - - - 346, 253 - - - 1 - - - 146, 27 - - - 1 - - - TableLayoutPanel1 - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 14 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="OK_Button" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="Cancel_Button" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,50,Percent,50" /><Rows Styles="Percent,50" /></TableLayoutSettings> - - - True - - - 302, 12 - - - 41, 12 - - - 3 - - - 作成者 - - - Label1 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 13 - - - 318, 24 - - - 174, 14 - - - 4 - - - Label2 - - - UsernameLabel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 12 - - - 318, 50 - - - 174, 14 - - - 6 - - - Label3 - - - NameLabel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 10 - - - True - - - 302, 38 - - - 41, 12 - - - 5 - - - リスト名 - - - Label4 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 11 - - - True - - - 302, 144 - - - 29, 12 - - - 13 - - - 説明 - - - Label6 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 9 - - - 318, 76 - - - 174, 14 - - - 8 - - - Label7 - - - StatusLabel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 7 - - - True - - - 302, 64 - - - 29, 12 - - - 7 - - - 種別 - - - Label8 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 8 - - - 318, 102 - - - 46, 14 - - - 10 - - - Label9 - - - TopRight - - - MemberCountLabel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 5 - - - True - - - 302, 90 - - - 53, 12 - - - 9 - - - 登録者数 - - - Label10 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 6 - - - 318, 130 - - - 46, 14 - - - 12 - - - Label11 - - - TopRight - - - SubscriberCountLabel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 3 - - - True - - - 302, 118 - - - 53, 12 - - - 11 - - - 購読者数 - - - Label12 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 4 - - - 318, 159 - - - True - - - 174, 88 - - - 14 - - - Description - - - DescriptionText - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 2 - - - None - - - 12, 256 - - - 67, 21 - - - 2 - - - Refresh - - - RefreshButton - - - System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 1 - - - 12 - - - 12, 12 - - - 284, 232 - - - 0 - - - ListsList - - - System.Windows.Forms.ListBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 0 - - - True - - - 6, 12 - - - 504, 291 - - - CenterParent - - - ListAvailable - - - ListAvailable - - - System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 12 + + + + 12, 12 + + + 284, 232 + + + 0 + + + ListsList + + + System.Windows.Forms.ListBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + + None + + + 12, 256 + + + 67, 21 + + + 2 + + + Refresh + + + RefreshButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + 318, 159 + + + True + + + 174, 88 + + + 14 + + + Description + + + DescriptionText + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + 318, 130 + + + 46, 14 + + + 12 + + + Label11 + + + TopRight + + + SubscriberCountLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 3 + + + True + + + 302, 118 + + + 53, 12 + + + 11 + + + 購読者数 + + + Label12 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 4 + + + 318, 102 + + + 46, 14 + + + 10 + + + Label9 + + + TopRight + + + MemberCountLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 5 + + + True + + + 302, 90 + + + 53, 12 + + + 9 + + + 登録者数 + + + Label10 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 6 + + + 318, 76 + + + 174, 14 + + + 8 + + + Label7 + + + StatusLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 7 + + + True + + + 302, 64 + + + 29, 12 + + + 7 + + + 種別 + + + Label8 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 8 + + + True + + + 302, 144 + + + 29, 12 + + + 13 + + + 説明 + + + Label6 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 9 + + + 318, 50 + + + 174, 14 + + + 6 + + + Label3 + + + NameLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 10 + + + True + + + 302, 38 + + + 41, 12 + + + 5 + + + リスト名 + + + Label4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 11 + + + 318, 24 + + + 174, 14 + + + 4 + + + Label2 + + + UsernameLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 12 + + + True + + + 302, 12 + + + 41, 12 + + + 3 + + + 作成者 + + + Label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 13 + + + Bottom, Right + + + 2 + + + OK_Button + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TableLayoutPanel1 + + + 0 + + + Cancel_Button + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TableLayoutPanel1 + + + 1 + + + 346, 253 + + + 1 + + + 146, 27 + + + 1 + + + TableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 14 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="OK_Button" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="Cancel_Button" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,50,Percent,50" /><Rows Styles="Percent,50" /></TableLayoutSettings> + + + None + + + 3, 3 + + + 67, 21 + + + 0 + + + OK + + + OK_Button + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TableLayoutPanel1 + + + 0 + + + None + + + 76, 3 + + + 67, 21 + + + 1 + + + キャンセル + + + Cancel_Button + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TableLayoutPanel1 + + + 1 + + + True + + + 6, 12 + + + 504, 291 + + + CenterParent + + + ListAvailable + + + ListAvailable + + + System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + \ No newline at end of file diff --git a/Tween/ListAvailable.zh-CHS.resx b/TweenCS/ListAvailable.zh-CHS.resx similarity index 97% rename from Tween/ListAvailable.zh-CHS.resx rename to TweenCS/ListAvailable.zh-CHS.resx index 7ff27071..4dbe5590 100644 --- a/Tween/ListAvailable.zh-CHS.resx +++ b/TweenCS/ListAvailable.zh-CHS.resx @@ -1,154 +1,154 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 确定 - - - 取消 - - - 创建者 - - - - 41, 12 - - - 列表名 - - - 描述 - - - 类型 - - - 关注人数 - - - 被关注数 - - - 刷新 - - - 可用列表 - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 确定 + + + 取消 + + + 创建者 + + + + 41, 12 + + + 列表名 + + + 描述 + + + 类型 + + + 关注人数 + + + 被关注数 + + + 刷新 + + + 可用列表 + \ No newline at end of file diff --git a/TweenCS/TweenCS.csproj b/TweenCS/TweenCS.csproj index 8216769f..a06cf2ab 100644 --- a/TweenCS/TweenCS.csproj +++ b/TweenCS/TweenCS.csproj @@ -91,6 +91,12 @@ FilterDialog.cs + + Form + + + ListAvailable.cs + Form @@ -230,6 +236,15 @@ FilterDialog.cs + + ListAvailable.cs + + + ListAvailable.cs + + + ListAvailable.cs + ListManage.cs