private void AddListViewItem(string endpoint, ApiLimit apiLimit, ListViewGroup group)
{
- var item = new ListViewItem(
- new string[] {
- endpoint,
- apiLimit.AccessLimitRemain + "/" + apiLimit.AccessLimitCount,
- apiLimit.AccessLimitResetDate.ToLocalTimeString()
- });
- item.Group = group;
+ var subitems = new[]
+ {
+ endpoint,
+ apiLimit.AccessLimitRemain + "/" + apiLimit.AccessLimitCount,
+ apiLimit.AccessLimitResetDate.ToLocalTimeString(),
+ };
+ var item = new ListViewItem(subitems)
+ {
+ Group = group,
+ };
+
this.ListViewApi.Items.Add(item);
}
settings.UserAccounts = new List<UserAccount>();
if (!string.IsNullOrEmpty(settings.UserName))
{
- UserAccount account = new UserAccount();
- account.Username = settings.UserName;
- account.UserId = settings.UserId;
- account.Token = settings.Token;
- account.TokenSecret = settings.TokenSecret;
+ var account = new UserAccount
+ {
+ Username = settings.UserName,
+ UserId = settings.UserId,
+ Token = settings.Token,
+ TokenSecret = settings.TokenSecret,
+ };
settings.UserAccounts.Add(account);
}
private bool BalloonRequired()
{
- Twitter.FormattedEvent ev = new Twitter.FormattedEvent();
- ev.Eventtype = MyCommon.EVENTTYPE.None;
+ var ev = new Twitter.FormattedEvent
+ {
+ Eventtype = MyCommon.EVENTTYPE.None,
+ };
return BalloonRequired(ev);
}
if (userTab != null || listTab != null)
{
- var label = new Label();
- label.Dock = DockStyle.Top;
- label.Name = "labelUser";
- label.TabIndex = 0;
+ var label = new Label
+ {
+ Dock = DockStyle.Top,
+ Name = "labelUser",
+ TabIndex = 0,
+ };
if (listTab != null)
{
private void RunTweenUp()
{
- ProcessStartInfo pinfo = new ProcessStartInfo();
- pinfo.UseShellExecute = true;
- pinfo.WorkingDirectory = MyCommon.settingPath;
- pinfo.FileName = Path.Combine(MyCommon.settingPath, "TweenUp3.exe");
- pinfo.Arguments = "\"" + Application.StartupPath + "\"";
+ var pinfo = new ProcessStartInfo
+ {
+ UseShellExecute = true,
+ WorkingDirectory = MyCommon.settingPath,
+ FileName = Path.Combine(MyCommon.settingPath, "TweenUp3.exe"),
+ Arguments = "\"" + Application.StartupPath + "\"",
+ };
+
try
{
Process.Start(pinfo);
var tabName = this._statuses.MakeTabName("Related Tweets");
- tabRelated = new RelatedPostsTabModel(tabName, post);
- tabRelated.UnreadManage = false;
- tabRelated.Notify = false;
+ tabRelated = new RelatedPostsTabModel(tabName, post)
+ {
+ UnreadManage = false,
+ Notify = false,
+ };
this._statuses.AddTab(tabRelated);
this.AddNewTab(tabRelated, startup: false);
{
if (evtDialog == null || evtDialog.IsDisposed)
{
- evtDialog = null;
- evtDialog = new EventViewerDialog();
- evtDialog.Owner = this;
+ this.evtDialog = new EventViewerDialog
+ {
+ Owner = this,
+ };
+
//親の中央に表示
- Point pos = evtDialog.Location;
- pos.X = Convert.ToInt32(this.Location.X + this.Size.Width / 2 - evtDialog.Size.Width / 2);
- pos.Y = Convert.ToInt32(this.Location.Y + this.Size.Height / 2 - evtDialog.Size.Height / 2);
- evtDialog.Location = pos;
+ this.evtDialog.Location = new Point
+ {
+ X = Convert.ToInt32(this.Location.X + this.Size.Width / 2 - evtDialog.Size.Width / 2),
+ Y = Convert.ToInt32(this.Location.Y + this.Size.Height / 2 - evtDialog.Size.Height / 2),
+ };
}
evtDialog.EventSource = tw.StoredEvent;
if (!evtDialog.Visible)
MyCommon.TraceOut(ex, "Event Exception!" + Environment.NewLine + content);
}
- var evt = new FormattedEvent();
- evt.CreatedAt = MyCommon.DateTimeParse(eventData.CreatedAt);
- evt.Event = eventData.Event;
- evt.Username = eventData.Source.ScreenName;
- evt.IsMe = evt.Username.ToLowerInvariant().Equals(this.Username.ToLowerInvariant());
-
- eventTable.TryGetValue(eventData.Event, out var eventType);
- evt.Eventtype = eventType;
+ var evt = new FormattedEvent
+ {
+ CreatedAt = MyCommon.DateTimeParse(eventData.CreatedAt),
+ Event = eventData.Event,
+ Username = eventData.Source.ScreenName,
+ IsMe = eventData.Source.ScreenName.ToLowerInvariant().Equals(this.Username.ToLowerInvariant()),
+ Eventtype = eventTable.TryGetValue(eventData.Event, out var eventType) ? eventType : MyCommon.EVENTTYPE.None,
+ };
TwitterStreamEvent<TwitterStatusCompat> tweetEvent;
TwitterStatus tweet;