InitializeTraceFrag();
- //Win32Api.SetProxy(HttpConnection.ProxyType.Specified, "127.0.0.1", 8080, "user", "pass")
-
Microsoft.Win32.SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;
Regex.CacheSize = 100;
_brsBackColorAtYou = new SolidBrush(_clAtTarget);
_brsBackColorAtFromTarget = new SolidBrush(_clAtFromTarget);
_brsBackColorAtTo = new SolidBrush(_clAtTo);
- //_brsBackColorNone = new SolidBrush(Color.FromKnownColor(KnownColor.Window));
_brsBackColorNone = new SolidBrush(_clListBackcolor);
// StringFormatオブジェクトへの事前設定
- //sf.Alignment = StringAlignment.Near; // Textを近くへ配置(左から右の場合は左寄せ)
- //sf.LineAlignment = StringAlignment.Near; // Textを近くへ配置(上寄せ)
- //sf.FormatFlags = StringFormatFlags.LineLimit; //
sfTab.Alignment = StringAlignment.Center;
sfTab.LineAlignment = StringAlignment.Center;
InitDetailHtmlFormat();
- //Regex statregex = new Regex("^0*");
this.recommendedStatusFooter = " [TWNv" + Regex.Replace(MyCommon.FileVersion.Replace(".", ""), "^0*", "") + "]";
_history.Add(new StatusTextHistory());
{
_mySpDis3 = ScaleBy(configScaleFactor.Width, SettingManager.Local.PreviewDistance);
}
- //this.Tween_ClientSizeChanged(this, null);
this.PlaySoundMenuItem.Checked = SettingManager.Common.PlaySound;
this.PlaySoundFileMenuItem.Checked = SettingManager.Common.PlaySound;
//入力欄
}
}
- private void TimerInterval_Changed(object sender, IntervalChangedEventArgs e) //Handles SettingDialog.IntervalChanged
+ private void TimerInterval_Changed(object sender, IntervalChangedEventArgs e)
{
if (e.UserStream)
{
title.Append(tw.Username);
title.Append(" - ");
}
- else
- {
- //title.Clear();
- }
+
if (dm)
{
- //NotifyIcon1.BalloonTipIcon = ToolTipIcon.Warning;
- //NotifyIcon1.BalloonTipTitle += Application.ProductName + " [DM] " + Properties.Resources.RefreshDirectMessageText1 + " " + addCount.ToString() + Properties.Resources.RefreshDirectMessageText2;
title.Append(ApplicationSettings.ApplicationName);
title.Append(" [DM] ");
title.AppendFormat(Properties.Resources.RefreshTimeline_NotifyText, addCount);
}
else if (reply)
{
- //NotifyIcon1.BalloonTipIcon = ToolTipIcon.Warning;
- //NotifyIcon1.BalloonTipTitle += Application.ProductName + " [Reply!] " + Properties.Resources.RefreshTimelineText1 + " " + addCount.ToString() + Properties.Resources.RefreshTimelineText2;
title.Append(ApplicationSettings.ApplicationName);
title.Append(" [Reply!] ");
title.AppendFormat(Properties.Resources.RefreshTimeline_NotifyText, addCount);
}
else
{
- //NotifyIcon1.BalloonTipIcon = ToolTipIcon.Info;
- //NotifyIcon1.BalloonTipTitle += Application.ProductName + " " + Properties.Resources.RefreshTimelineText1 + " " + addCount.ToString() + Properties.Resources.RefreshTimelineText2;
title.Append(ApplicationSettings.ApplicationName);
title.Append(" ");
title.AppendFormat(Properties.Resources.RefreshTimeline_NotifyText, addCount);
sb.Append(post.TextFromApi);
}
- //if (SettingDialog.DispUsername) { NotifyIcon1.BalloonTipTitle = tw.Username + " - "; } else { NotifyIcon1.BalloonTipTitle = ""; }
+
var title = new StringBuilder();
ToolTipIcon ntIcon;
if (SettingManager.Common.DispUsername)
title.Append(tw.Username);
title.Append(" - ");
}
- else
- {
- //title.Clear();
- }
+
if (dm)
{
- //NotifyIcon1.BalloonTipIcon = ToolTipIcon.Warning;
- //NotifyIcon1.BalloonTipTitle += Application.ProductName + " [DM] " + Properties.Resources.RefreshDirectMessageText1 + " " + addCount.ToString() + Properties.Resources.RefreshDirectMessageText2;
ntIcon = ToolTipIcon.Warning;
title.Append(ApplicationSettings.ApplicationName);
title.Append(" [DM] ");
}
else if (reply)
{
- //NotifyIcon1.BalloonTipIcon = ToolTipIcon.Warning;
- //NotifyIcon1.BalloonTipTitle += Application.ProductName + " [Reply!] " + Properties.Resources.RefreshTimelineText1 + " " + addCount.ToString() + Properties.Resources.RefreshTimelineText2;
ntIcon = ToolTipIcon.Warning;
title.Append(ApplicationSettings.ApplicationName);
title.Append(" [Reply!] ");
}
else
{
- //NotifyIcon1.BalloonTipIcon = ToolTipIcon.Info;
- //NotifyIcon1.BalloonTipTitle += Application.ProductName + " " + Properties.Resources.RefreshTimelineText1 + " " + addCount.ToString() + Properties.Resources.RefreshTimelineText2;
ntIcon = ToolTipIcon.Info;
title.Append(ApplicationSettings.ApplicationName);
title.Append(" ");
}
var bText = sb.ToString();
if (string.IsNullOrEmpty(bText)) return;
- //NotifyIcon1.BalloonTipText = sb.ToString();
- //NotifyIcon1.ShowBalloonTip(500);
+
NotifyIcon1.BalloonTipTitle = title.ToString();
NotifyIcon1.BalloonTipText = bText;
NotifyIcon1.BalloonTipIcon = ntIcon;
DList.ChangeItemFontAndColor(Item, cl, fnt);
else
DList.ChangeItemForeColor(Item, cl);
- //if (_itemCache != null) DList.RedrawItems(_itemCacheIndex, _itemCacheIndex + _itemCache.Length - 1, false);
}
}
StatusText.SelectionStart = StatusText.Text.Length;
await UrlConvertAsync(MyCommon.UrlConverter.Nicoms);
}
- //if (SettingDialog.UrlConvertAuto)
- //{
- // StatusText.SelectionStart = StatusText.Text.Length;
- // UrlConvertAutoToolStripMenuItem_Click(null, null);
- //}
- //else if (SettingDialog.Nicoms)
- //{
- // StatusText.SelectionStart = StatusText.Text.Length;
- // UrlConvert(UrlConverter.Nicoms);
- //}
+
StatusText.SelectionStart = StatusText.Text.Length;
CheckReplyTo(StatusText.Text);
FavoriteRetweetUnofficialContextMenu.Enabled = true;
}
}
- //if (_statuses.Tabs[ListTab.SelectedTab.Text].TabType != MyCommon.TabUsageType.Favorites)
- //{
- // RefreshMoreStripMenuItem.Enabled = true;
- //}
- //else
- //{
- // RefreshMoreStripMenuItem.Enabled = false;
- //}
+
if (!this.ExistCurrentPost || post == null || post.InReplyToStatusId == null)
{
RepliedStatusOpenMenuItem.Enabled = false;
private void ListTab_SelectedIndexChanged(object sender, EventArgs e)
{
- //_curList.Refresh();
SetMainWindowTitle();
SetStatusLabelUrl();
SetApiStatusLabel();
private ListViewItem CreateItem(TabModel tab, PostClass Post)
{
var mk = new StringBuilder();
- //if (Post.IsDeleted) mk.Append("×");
- //if (Post.IsMark) mk.Append("♪");
- //if (Post.IsProtect) mk.Append("Ю");
- //if (Post.InReplyToStatusId != null) mk.Append("⇒");
+
if (Post.FavoritedCount > 0) mk.Append("+" + Post.FavoritedCount);
ImageListViewItem itm;
if (Post.RetweetedId == null)
var drawLineCount = Math.Max(1, Math.DivRem((int)rct.Height, fontHeight, out var heightDiff));
- //if (heightDiff > fontHeight * 0.7)
- //{
- // rct.Height += fontHeight;
- // drawLineCount += 1;
- //}
-
//フォントの高さの半分を足してるのは保険。無くてもいいかも。
- if (!_iconCol && drawLineCount <= 1)
+ if (this._iconCol || drawLineCount > 1)
{
- //rct.Inflate(0, heightDiff / -2);
- //rct.Height += fontHeight / 2;
- }
- else if (heightDiff < fontHeight * 0.7)
- {
- //最終行が70%以上欠けていたら、最終行は表示しない
- //rct.Height = (float)((fontHeight * drawLineCount) + (fontHeight / 2));
- rct.Height = (fontHeight * drawLineCount) - 1;
- }
- else
- {
- drawLineCount += 1;
+ if (heightDiff < fontHeight * 0.7)
+ {
+ // 最終行が70%以上欠けていたら、最終行は表示しない
+ rct.Height = (fontHeight * drawLineCount) - 1;
+ }
+ else
+ {
+ drawLineCount += 1;
+ }
}
- //if (!_iconCol && drawLineCount > 1)
- //{
- // rct.Y += fontHeight * 0.2;
- // if (heightDiff >= fontHeight * 0.8) rct.Height -= fontHeight * 0.2;
- //}
-
if (rct.Width > 0)
{
var color = (!e.Item.Selected) ? e.Item.ForeColor : //選択されていない行
TextFormatFlags.NoPrefix);
}
}
- //if (e.ColumnIndex == 6) this.DrawListViewItemStateIcon(e, rct);
}
}
}
else
{
iconRect = Rectangle.Intersect(new Rectangle(e.Item.GetBounds(ItemBoundsPortion.Icon).Location, new Size(1, 1)), itemRect);
- //iconRect.Offset(0, Math.Max(0, (itemRect.Height - realIconSize.Height) / 2));
item.GetImageAsync();
}
{
var stateRect = Rectangle.Intersect(new Rectangle(new Point(iconRect.X + realIconSize.Width + 2, iconRect.Y), realStateSize), itemRect);
if (stateRect.Width > 0)
- {
- //e.Graphics.FillRectangle(Brushes.White, stateRect);
- //e.Graphics.InterpolationMode = Drawing2D.InterpolationMode.High;
e.Graphics.DrawImage(this.PostStateImageList.Images[item.StateIndex], stateRect);
- }
}
}
}
}
- //private void DrawListViewItemStateIcon(DrawListViewSubItemEventArgs e, RectangleF rct)
- //{
- // ImageListViewItem item = (ImageListViewItem)e.Item;
- // if (item.StateImageIndex > -1)
- // {
- // ////e.Bounds.Leftが常に0を指すから自前で計算
- // //Rectangle itemRect = item.Bounds;
- // //itemRect.Width = e.Item.ListView.Columns[4].Width;
-
- // //foreach (ColumnHeader clm in e.Item.ListView.Columns)
- // //{
- // // if (clm.DisplayIndex < e.Item.ListView.Columns[4].DisplayIndex)
- // // {
- // // itemRect.X += clm.Width;
- // // }
- // //}
-
- // //Rectangle iconRect = Rectangle.Intersect(new Rectangle(e.Item.GetBounds(ItemBoundsPortion.Icon).Location, new Size(_iconSz, _iconSz)), itemRect);
- // //iconRect.Offset(0, Math.Max(0, (itemRect.Height - _iconSz) / 2));
-
- // if (rct.Width > 0)
- // {
- // RectangleF stateRect = RectangleF.Intersect(rct, new RectangleF(rct.Location, new Size(18, 16)));
- // //e.Graphics.FillRectangle(Brushes.White, rct);
- // //e.Graphics.InterpolationMode = Drawing2D.InterpolationMode.High;
- // e.Graphics.DrawImage(this.PostStateImageList.Images(item.StateImageIndex), stateRect);
- // }
- // }
- //}
-
internal void DoTabSearch(string searchWord, bool caseSensitive, bool useRegex, SEARCHTYPE searchType)
{
var tab = this.CurrentTab;
}
StatusText.Text = StatusText.Text.Insert(sidx, id);
sidx += id.Length;
- //if (StatusText.Text.StartsWith("@"))
- //{
- // //複数リプライ
- // StatusText.Text = ". " + StatusText.Text.Insert(sidx, " @" + _curPost.ScreenName + " ");
- // sidx += 5 + _curPost.ScreenName.Length;
- //}
- //else
- //{
- // // 複数リプライ
- // StatusText.Text = StatusText.Text.Insert(sidx, " @" + _curPost.ScreenName + " ");
- // sidx += 3 + _curPost.ScreenName.Length;
- //}
StatusText.SelectionStart = sidx;
StatusText.Focus();
- //_reply_to_id = 0;
- //_reply_to_name = null;
return;
}
}
foreach (var post in selectedPosts)
{
if (!sTxt.Contains("@" + post.ScreenName + " "))
- {
sTxt = sTxt.Insert(2, "@" + post.ScreenName + " ");
- //sTxt = "@" + post.ScreenName + " " + sTxt;
- }
}
StatusText.Text = sTxt;
}
}
StatusText.Text = StatusText.Text.Insert(sidx, ids);
sidx += ids.Length;
- //if (StatusText.Text.StartsWith("@"))
- //{
- // StatusText.Text = ". " + StatusText.Text.Insert(sidx, ids);
- // sidx += 2 + ids.Length;
- //}
- //else
- //{
- // StatusText.Text = StatusText.Text.Insert(sidx, ids);
- // sidx += 1 + ids.Length;
- //}
StatusText.SelectionStart = sidx;
StatusText.Focus();
return;
}
}
- //t.coで投稿時自動短縮する場合は、外部サービスでの短縮禁止
- //if (SettingDialog.UrlConvertAuto && SettingDialog.ShortenTco) return;
-
//Converter_Type=Nicomsの場合は、nicovideoのみ短縮する
//参考資料 RFC3986 Uniform Resource Identifier (URI): Generic Syntax
//Appendix A. Collected ABNF for URI
this.MarkSettingLocalModified();
this._isColumnChanged = true;
}
- // 非表示の時にColumnChangedが呼ばれた場合はForm初期化処理中なので保存しない
- //if (changed)
- //{
- // SaveConfigsLocal();
- //}
}
private void SplitContainer2_SplitterMoved(object sender, SplitterEventArgs e)
}
catch (Exception)
{
- //MessageBox.Show("ブラウザの起動に失敗、またはタイムアウトしました。" + ex.ToString());
}
});
}
HashTogglePullDownMenuItem.Checked = false;
HashToggleMenuItem.Checked = false;
}
- //if (HashMgr.IsInsert && HashMgr.UseHash != "")
- //{
- // int sidx = StatusText.SelectionStart;
- // string hash = HashMgr.UseHash + " ";
- // if (sidx > 0)
- // {
- // if (StatusText.Text.Substring(sidx - 1, 1) != " ")
- // hash = " " + hash;
- // }
- // StatusText.Text = StatusText.Text.Insert(sidx, hash);
- // sidx += hash.Length;
- // StatusText.SelectionStart = sidx;
- // StatusText.Focus();
- //}
+
this.MarkSettingCommonModified();
this.StatusText_TextChanged(this.StatusText, EventArgs.Empty);
}
RtCountMenuItem.Enabled = true;
else
RtCountMenuItem.Enabled = false;
-
- //if (SettingDialog.UrlConvertAuto && SettingDialog.ShortenTco)
- // TinyUrlConvertToolStripMenuItem.Enabled = false;
- //else
- // TinyUrlConvertToolStripMenuItem.Enabled = true;
}
private void CopyUserIdStripMenuItem_Click(object sender, EventArgs e)
private void CacheInfoMenuItem_Click(object sender, EventArgs e)
{
var buf = new StringBuilder();
- //buf.AppendFormat("キャッシュメモリ容量 : {0}bytes({1}MB)" + Environment.NewLine, IconCache.CacheMemoryLimit, ((ImageDictionary)IconCache).CacheMemoryLimit / 1048576);
- //buf.AppendFormat("物理メモリ使用割合 : {0}%" + Environment.NewLine, IconCache.PhysicalMemoryLimit);
buf.AppendFormat("キャッシュエントリ保持数 : {0}" + Environment.NewLine, IconCache.CacheCount);
buf.AppendFormat("キャッシュエントリ破棄数 : {0}" + Environment.NewLine, IconCache.CacheRemoveCount);
MessageBox.Show(buf.ToString(), "アイコンキャッシュ使用状況");
}
var ev = e.EventData;
StatusLabel.Text = "Event: " + ev.Event;
- //if (ev.Event == "favorite")
- //{
- // NotifyFavorite(ev);
- //}
NotifyEvent(ev);
if (ev.Event == "favorite" || ev.Event == "unfavorite")
{
if (BalloonRequired(ev))
{
NotifyIcon1.BalloonTipIcon = ToolTipIcon.Info;
- //if (SettingDialog.DispUsername) NotifyIcon1.BalloonTipTitle = tw.Username + " - "; else NotifyIcon1.BalloonTipTitle = "";
- //NotifyIcon1.BalloonTipTitle += Application.ProductName + " [" + ev.Event.ToUpper() + "] by " + ((string)(!string.IsNullOrEmpty(ev.Username) ? ev.Username : ""), string);
var title = new StringBuilder();
if (SettingManager.Common.DispUsername)
{
title.Append(tw.Username);
title.Append(" - ");
}
- else
- {
- //title.Clear();
- }
title.Append(ApplicationSettings.ApplicationName);
title.Append(" [");
title.Append(ev.Event.ToUpper(CultureInfo.CurrentCulture));
{
title.Append(ev.Username);
}
- else
- {
- //title.Append("");
- }
+
string text;
if (!string.IsNullOrEmpty(ev.Target))
- {
- //NotifyIcon1.BalloonTipText = ev.Target;
text = ev.Target;
- }
else
- {
- //NotifyIcon1.BalloonTipText = " ";
text = " ";
- }
- //NotifyIcon1.ShowBalloonTip(500);
+
if (SettingManager.Common.IsUseNotifyGrowl)
{
gh.Notify(GrowlHelper.NotifyType.UserStreamEvent,