private void ApiInfoMenuItem_Click(object sender, EventArgs e) { ApiInfo info = new ApiInfo(); StringBuilder tmp = new StringBuilder(); GetApiInfoArgs args = new GetApiInfoArgs() {tw = tw, info = info}; using (FormInfo dlg = new FormInfo(this, Properties.Resources.ApiInfo6, GetApiInfo_Dowork, null, args)) { dlg.ShowDialog(); if ((bool)dlg.Result) { tmp.AppendLine(Properties.Resources.ApiInfo1 + args.info.MaxCount.ToString()); tmp.AppendLine(Properties.Resources.ApiInfo2 + args.info.RemainCount.ToString()); tmp.AppendLine(Properties.Resources.ApiInfo3 + args.info.ResetTime.ToString()); tmp.AppendLine(Properties.Resources.ApiInfo7 + (tw.UserStreamEnabled ? Properties.Resources.Enable : Properties.Resources.Disable).ToString()); tmp.AppendLine(); tmp.AppendLine(Properties.Resources.ApiInfo8 + args.info.AccessLevel.ToString()); SetStatusLabelUrl(); tmp.AppendLine(); tmp.AppendLine(Properties.Resources.ApiInfo9 + (args.info.MediaMaxCount < 0 ? Properties.Resources.ApiInfo91 : args.info.MediaMaxCount.ToString())); tmp.AppendLine(Properties.Resources.ApiInfo10 + (args.info.MediaRemainCount < 0 ? Properties.Resources.ApiInfo91 : args.info.MediaRemainCount.ToString())); tmp.AppendLine(Properties.Resources.ApiInfo11 + (args.info.MediaResetTime == new DateTime() ? Properties.Resources.ApiInfo91 : args.info.MediaResetTime.ToString())); } else { tmp.Append(Properties.Resources.ApiInfo5); } } MessageBox.Show(tmp.ToString(), Properties.Resources.ApiInfo4, MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void ShowApiInfoBox() { var args = new GetApiInfoArgs { Tw = _tw, Info = new ApiInfo() }; var tmp = new StringBuilder(); using (var dlg = new FormInfo(this, R.ApiInfo6, GetApiInfo_Dowork, null, args)) { dlg.ShowDialog(); if ((bool)dlg.Result) { tmp.AppendLine(string.Format("{0}{1}", R.ApiInfo1, args.Info.MaxCount)); tmp.AppendLine(string.Format("{0}{1}", R.ApiInfo2, args.Info.RemainCount)); tmp.AppendLine(string.Format("{0}{1}", R.ApiInfo3, args.Info.ResetTime)); tmp.AppendLine(string.Format("{0}{1}", R.ApiInfo7, _tw.UserStreamEnabled ? R.Enable : R.Disable)); tmp.AppendLine(); tmp.AppendLine(string.Format("{0}{1}", R.ApiInfo8, args.Info.AccessLevel)); tmp.AppendLine(); tmp.AppendLine(string.Format("{0}{1}", R.ApiInfo9, args.Info.MediaMaxCount < 0 ? R.ApiInfo91 : args.Info.MediaMaxCount.ToString())); tmp.AppendLine(string.Format("{0}{1}", R.ApiInfo10, args.Info.MediaRemainCount < 0 ? R.ApiInfo91 : args.Info.MediaRemainCount.ToString())); tmp.AppendLine(string.Format("{0}{1}", R.ApiInfo11, args.Info.MediaResetTime == new DateTime() ? R.ApiInfo91 : args.Info.MediaResetTime.ToString())); SetStatusLabelUrl(); } else { tmp.Append(R.ApiInfo5); } } MessageBox.Show(tmp.ToString(), R.ApiInfo4, MessageBoxButtons.OK, MessageBoxIcon.Information); }