public TabClass() { Posts = new Dictionary<long, PostClass>(); _filters = new List<FiltersClass>(); Notify = true; SoundFile = string.Empty; _unreadManage = true; _ids = new List<long>(); OldestUnreadId = -1; _tabType = TabUsageType.Undefined; _listInfo = null; }
public TabClass(string tabName, TabUsageType tabType, ListElement list) { Posts = new Dictionary<long, PostClass>(); TabName = tabName; _filters = new List<FiltersClass>(); Notify = true; SoundFile = string.Empty; _unreadManage = true; _ids = new List<long>(); OldestUnreadId = -1; _tabType = tabType; ListInfo = list; _sorter.Posts = IsInnerStorageTabType ? Posts : TabInformations.Instance.Posts; }
private void CancelButton_Click(object sender, EventArgs e) { SelectedList = null; DialogResult = DialogResult.Cancel; Close(); }
private void SetListInfo(ListElement lst) { UsernameLabel.Text = string.Format("{0} / {1}", lst.Username, lst.Nickname); NameLabel.Text = lst.Name; StatusLabel.Text = lst.IsPublic ? "Public" : "Private"; MemberCountLabel.Text = lst.MemberCount.ToString("#,##0"); SubscriberCountLabel.Text = lst.SubscriberCount.ToString("#,##0"); DescriptionText.Text = lst.Description; }
private void OkButton_Click(object sender, EventArgs e) { if (ListsList.SelectedIndex < 0) { return; } SelectedList = (ListElement)ListsList.SelectedItem; DialogResult = DialogResult.OK; Close(); }
public string EditList(string listId, string newName, bool isPrivate, string description, ref ListElement list) { HttpStatusCode res; string content = string.Empty; try { res = _twitterConnection.UpdateListID(Username, listId, newName, isPrivate, description, ref content); } catch (Exception ex) { return string.Format("Err:{0}({1})", ex.Message, MethodBase.GetCurrentMethod().Name); } switch (res) { case HttpStatusCode.OK: AccountState = AccountState.Valid; break; case HttpStatusCode.Unauthorized: AccountState = AccountState.Invalid; return R.Unauthorized; case HttpStatusCode.BadRequest: return "Err:API Limits?"; default: return string.Format("Err:{0}({1})", res, MethodBase.GetCurrentMethod().Name); } try { var le = D.CreateDataFromJson<ListElementData>(content); var newList = new ListElement(le, this); list.Description = newList.Description; list.Id = newList.Id; list.IsPublic = newList.IsPublic; list.MemberCount = newList.MemberCount; list.Name = newList.Name; list.SubscriberCount = newList.SubscriberCount; list.Slug = newList.Slug; list.Nickname = newList.Nickname; list.Username = newList.Username; list.UserId = newList.UserId; return string.Empty; } catch (SerializationException ex) { MyCommon.TraceOut(ex.Message + Environment.NewLine + content); return "Err:Json Parse Error(DataContractJsonSerializer)"; } catch (Exception ex) { MyCommon.TraceOut(ex, MethodBase.GetCurrentMethod().Name + " " + content); return "Err:Invalid Json!"; } }
public bool AddNewTab(string tabName, bool startup, TabUsageType tabType, ListElement listInfo = null) { // 重複チェック if (ListTab.TabPages.Cast <TabPage>().Any(tb => tb.Text == tabName)) { return(false); } // 新規タブ名チェック if (tabName == R.AddNewTabText1) { return(false); } // タブタイプ重複チェック if (!startup) { if (tabType == TabUsageType.DirectMessage || tabType == TabUsageType.Favorites || tabType == TabUsageType.Home || tabType == TabUsageType.Mentions || tabType == TabUsageType.Related) { if (_statuses.GetTabByType(tabType) != null) { return(false); } } } var tabPage = new TabPage(); int cnt = ListTab.TabPages.Count; //// ToDo:Create and set controls follow tabtypes SplitContainer1.Panel1.SuspendLayout(); SplitContainer1.Panel2.SuspendLayout(); SplitContainer1.SuspendLayout(); ListTab.SuspendLayout(); SuspendLayout(); tabPage.SuspendLayout(); // UserTimeline関連 Label label = null; if (tabType == TabUsageType.UserTimeline || tabType == TabUsageType.Lists) { label = new Label { Dock = DockStyle.Top, Name = "labelUser", Text = tabType == TabUsageType.Lists ? listInfo.ToString() : _statuses.Tabs[tabName].User + "'s Timeline", TextAlign = ContentAlignment.MiddleLeft }; using (var tmpComboBox = new ComboBox()) { label.Height = tmpComboBox.Height; } } ListTab.Controls.Add(tabPage); var listCustom = CreateDetailListView(tabName, startup); listCustom.SelectedIndexChanged += MyList_SelectedIndexChanged; listCustom.MouseDoubleClick += MyList_MouseDoubleClick; listCustom.ColumnClick += MyList_ColumnClick; listCustom.DrawColumnHeader += MyList_DrawColumnHeader; listCustom.DragDrop += TweenMain_DragDrop; listCustom.DragOver += TweenMain_DragOver; listCustom.DrawItem += MyList_DrawItem; listCustom.MouseClick += MyList_MouseClick; listCustom.ColumnReordered += MyList_ColumnReordered; listCustom.ColumnWidthChanged += MyList_ColumnWidthChanged; listCustom.CacheVirtualItems += MyList_CacheVirtualItems; listCustom.RetrieveVirtualItem += MyList_RetrieveVirtualItem; listCustom.DrawSubItem += MyList_DrawSubItem; listCustom.HScrolled += MyList_HScrolled; tabPage.Controls.Add(listCustom); if (_statuses.IsDistributableTab(tabName)) { _tabDialog.AddTab(tabName); } // 検索関連の準備 Panel pnl = null; if (tabType == TabUsageType.PublicSearch) { pnl = CreateSearchPanel(tabName); tabPage.Controls.Add(pnl); } if (tabType == TabUsageType.UserTimeline || tabType == TabUsageType.Lists) { tabPage.Controls.Add(label); } tabPage.Location = new Point(4, 4); tabPage.Name = string.Format("CTab{0}", cnt); tabPage.Size = new Size(380, 260); tabPage.TabIndex = 2 + cnt; tabPage.Text = tabName; tabPage.UseVisualStyleBackColor = true; if (tabType == TabUsageType.PublicSearch) { pnl.ResumeLayout(false); } tabPage.ResumeLayout(false); SplitContainer1.Panel1.ResumeLayout(false); SplitContainer1.Panel2.ResumeLayout(false); SplitContainer1.ResumeLayout(false); ListTab.ResumeLayout(false); ResumeLayout(false); PerformLayout(); tabPage.Tag = listCustom; return(true); }
public bool AddNewTab(string tabName, bool startup, TabUsageType tabType, ListElement listInfo = null) { // 重複チェック if (ListTab.TabPages.Cast<TabPage>().Any(tb => tb.Text == tabName)) { return false; } // 新規タブ名チェック if (tabName == R.AddNewTabText1) { return false; } // タブタイプ重複チェック if (!startup) { if (tabType == TabUsageType.DirectMessage || tabType == TabUsageType.Favorites || tabType == TabUsageType.Home || tabType == TabUsageType.Mentions || tabType == TabUsageType.Related) { if (_statuses.GetTabByType(tabType) != null) { return false; } } } var tabPage = new TabPage(); int cnt = ListTab.TabPages.Count; //// ToDo:Create and set controls follow tabtypes SplitContainer1.Panel1.SuspendLayout(); SplitContainer1.Panel2.SuspendLayout(); SplitContainer1.SuspendLayout(); ListTab.SuspendLayout(); SuspendLayout(); tabPage.SuspendLayout(); // UserTimeline関連 Label label = null; if (tabType == TabUsageType.UserTimeline || tabType == TabUsageType.Lists) { label = new Label { Dock = DockStyle.Top, Name = "labelUser", Text = tabType == TabUsageType.Lists ? listInfo.ToString() : _statuses.Tabs[tabName].User + "'s Timeline", TextAlign = ContentAlignment.MiddleLeft }; using (var tmpComboBox = new ComboBox()) { label.Height = tmpComboBox.Height; } } ListTab.Controls.Add(tabPage); var listCustom = CreateDetailListView(tabName, startup); listCustom.SelectedIndexChanged += MyList_SelectedIndexChanged; listCustom.MouseDoubleClick += MyList_MouseDoubleClick; listCustom.ColumnClick += MyList_ColumnClick; listCustom.DrawColumnHeader += MyList_DrawColumnHeader; listCustom.DragDrop += TweenMain_DragDrop; listCustom.DragOver += TweenMain_DragOver; listCustom.DrawItem += MyList_DrawItem; listCustom.MouseClick += MyList_MouseClick; listCustom.ColumnReordered += MyList_ColumnReordered; listCustom.ColumnWidthChanged += MyList_ColumnWidthChanged; listCustom.CacheVirtualItems += MyList_CacheVirtualItems; listCustom.RetrieveVirtualItem += MyList_RetrieveVirtualItem; listCustom.DrawSubItem += MyList_DrawSubItem; listCustom.HScrolled += MyList_HScrolled; tabPage.Controls.Add(listCustom); if (_statuses.IsDistributableTab(tabName)) { _tabDialog.AddTab(tabName); } // 検索関連の準備 Panel pnl = null; if (tabType == TabUsageType.PublicSearch) { pnl = CreateSearchPanel(tabName); tabPage.Controls.Add(pnl); } if (tabType == TabUsageType.UserTimeline || tabType == TabUsageType.Lists) { tabPage.Controls.Add(label); } tabPage.Location = new Point(4, 4); tabPage.Name = string.Format("CTab{0}", cnt); tabPage.Size = new Size(380, 260); tabPage.TabIndex = 2 + cnt; tabPage.Text = tabName; tabPage.UseVisualStyleBackColor = true; if (tabType == TabUsageType.PublicSearch) { pnl.ResumeLayout(false); } tabPage.ResumeLayout(false); SplitContainer1.Panel1.ResumeLayout(false); SplitContainer1.Panel2.ResumeLayout(false); SplitContainer1.ResumeLayout(false); ListTab.ResumeLayout(false); ResumeLayout(false); PerformLayout(); tabPage.Tag = listCustom; return true; }
public bool AddTab(string tabName, TabUsageType tabType, ListElement list) { if (Tabs.ContainsKey(tabName)) { return false; } Tabs.Add(tabName, new TabClass(tabName, tabType, list)); Tabs[tabName].Sorter.Mode = _sorter.Mode; Tabs[tabName].Sorter.Order = _sorter.Order; return true; }