}
public override bool Equals(object obj)
- {
- return this.Equals(obj as ApiLimit);
- }
+ => this.Equals(obj as ApiLimit);
public bool Equals(ApiLimit obj)
- {
- return obj != null &&
- this.AccessLimitCount == obj.AccessLimitCount &&
- this.AccessLimitRemain == obj.AccessLimitRemain &&
- this.AccessLimitResetDate == obj.AccessLimitResetDate;
- }
+ => obj != null && this.AccessLimitCount == obj.AccessLimitCount &&
+ this.AccessLimitRemain == obj.AccessLimitRemain && this.AccessLimitResetDate == obj.AccessLimitResetDate;
public override int GetHashCode()
- {
- return this.AccessLimitCount ^ this.AccessLimitRemain ^ this.AccessLimitResetDate.GetHashCode();
- }
+ => this.AccessLimitCount ^ this.AccessLimitRemain ^ this.AccessLimitResetDate.GetHashCode();
}
}
}
public BitlyApi(HttpClient http)
- {
- this.localHttpClient = http;
- }
+ => this.localHttpClient = http;
public async Task<Uri> ShortenAsync(Uri srcUri, string domain = null)
{
}
public MicrosoftTranslatorApi(HttpClient http)
- {
- this.localHttpClient = http;
- }
+ => this.localHttpClient = http;
public async Task<string> TranslateAsync(string text, string langTo, string langFrom = null)
{
}
public OAuthEchoHandler CreateOAuthEchoHandler(Uri authServiceProvider, Uri realm = null)
- {
- return ((TwitterApiConnection)this.apiConnection).CreateOAuthEchoHandler(authServiceProvider, realm);
- }
+ => ((TwitterApiConnection)this.apiConnection).CreateOAuthEchoHandler(authServiceProvider, realm);
public void Dispose()
- {
- this.apiConnection?.Dispose();
- }
+ => this.apiConnection?.Dispose();
/// <summary>JSON に出力する文字列を ECMA-404 に従ってエスケープする</summary>
public static string EscapeJsonString(string rawText)
public string EndpointName { get; }
public AccessLimitUpdatedEventArgs(string endpointName)
- {
- this.EndpointName = endpointName;
- }
+ => this.EndpointName = endpointName;
}
public event EventHandler<AccessLimitUpdatedEventArgs> AccessLimitUpdated;
public TwitterApiStatus()
- {
- this.AccessLimit = new EndpointLimits(this);
- }
+ => this.AccessLimit = new EndpointLimits(this);
public void Reset()
{
}
public void UpdateFromHeader(HttpResponseHeaders header, string endpointName)
- {
- this.UpdateFromHeader(header.ToDictionary(x => x.Key, x => string.Join(",", x.Value), StringComparer.OrdinalIgnoreCase), endpointName);
- }
+ => this.UpdateFromHeader(header.ToDictionary(x => x.Key, x => string.Join(",", x.Value), StringComparer.OrdinalIgnoreCase), endpointName);
public void UpdateFromHeader(IDictionary<string, string> header, string endpointName)
{
}
protected virtual void OnAccessLimitUpdated(AccessLimitUpdatedEventArgs e)
- {
- this.AccessLimitUpdated?.Invoke(this, e);
- }
+ => this.AccessLimitUpdated?.Invoke(this, e);
public class EndpointLimits : IEnumerable<KeyValuePair<string, ApiLimit>>
{
private ConcurrentDictionary<string, ApiLimit> innerDict = new ConcurrentDictionary<string, ApiLimit>();
public EndpointLimits(TwitterApiStatus owner)
- {
- this.Owner = owner;
- }
+ => this.Owner = owner;
public ApiLimit this[string endpoint]
{
- get
- {
- return this.innerDict.TryGetValue(endpoint, out var limit)
- ? limit
- : null;
- }
+ get => this.innerDict.TryGetValue(endpoint, out var limit) ? limit : null;
set
{
this.innerDict[endpoint] = value;
}
public IEnumerator<KeyValuePair<string, ApiLimit>> GetEnumerator()
- {
- return this.innerDict.GetEnumerator();
- }
+ => this.innerDict.GetEnumerator();
IEnumerator IEnumerable.GetEnumerator()
- {
- return this.GetEnumerator();
- }
+ => this.GetEnumerator();
}
}
}
public partial class ApiInfoDialog : OTBaseForm
{
public ApiInfoDialog()
- {
- InitializeComponent();
- }
+ => this.InitializeComponent();
private readonly List<string> _tlEndpoints = new List<string>
{
}
private void ApiInfoDialog_FormClosing(object sender, FormClosingEventArgs e)
- {
- MyCommon.TwitterApiInfo.AccessLimitUpdated -= this.TwitterApiStatus_AccessLimitUpdated;
- }
+ => MyCommon.TwitterApiInfo.AccessLimitUpdated -= this.TwitterApiStatus_AccessLimitUpdated;
protected override void ScaleControl(SizeF factor, BoundsSpecified specified)
{
public class BufferedListView : ListView
{
public BufferedListView()
- {
- DoubleBuffered = true;
- }
+ => this.DoubleBuffered = true;
}
}
}
private void CheckPostAndGet_CheckedChanged(object sender, EventArgs e)
- {
- this.GetPeriodPanel.LabelPostAndGet.Visible = this.GetPeriodPanel.CheckPostAndGet.Checked && !tw.UserStreamActive;
- }
+ => this.GetPeriodPanel.LabelPostAndGet.Visible = this.GetPeriodPanel.CheckPostAndGet.Checked && !tw.UserStreamActive;
private void Setting_Shown(object sender, EventArgs e)
{
}
private void CreateAccountButton_Click(object sender, EventArgs e)
- {
- this.OpenUrl("https://twitter.com/signup");
- }
+ => this.OpenUrl("https://twitter.com/signup");
private void GetPeriodPanel_IntervalChanged(object sender, IntervalChangedEventArgs e)
- {
- this.IntervalChanged?.Invoke(sender, e);
- }
+ => this.IntervalChanged?.Invoke(sender, e);
}
public class IntervalChangedEventArgs : EventArgs
public bool Lists;
public bool UserTimeline;
- public static IntervalChangedEventArgs ResetAll
+ public static IntervalChangedEventArgs ResetAll => new IntervalChangedEventArgs
{
- get
- {
- return new IntervalChangedEventArgs
- {
- UserStream = true,
- Timeline = true,
- Reply = true,
- DirectMessage = true,
- PublicSearch = true,
- Lists = true,
- UserTimeline = true,
- };
- }
- }
+ UserStream = true,
+ Timeline = true,
+ Reply = true,
+ DirectMessage = true,
+ PublicSearch = true,
+ Lists = true,
+ UserTimeline = true,
+ };
}
}
}
public int ItemCount
- {
- get
- {
- return this.TextId.AutoCompleteCustomSource.Count;
- }
- }
+ => this.TextId.AutoCompleteCustomSource.Count;
private void ButtonOK_Click(object sender, EventArgs e) /*Handles ButtonOK.Click*/
{
}
public AtIdSupplement()
- {
- InitializeComponent();
- }
+ => this.InitializeComponent();
public AtIdSupplement(List<string> ItemList, string startCharacter)
{
}
public Bing(HttpClient http)
- {
- this.translatorApi = new MicrosoftTranslatorApi(http);
- }
+ => this.translatorApi = new MicrosoftTranslatorApi(http);
/// <summary>
/// Microsoft Translator API を使用した翻訳を非同期に行います
/// </summary>
/// <exception cref="HttpRequestException"/>
public async Task<string> TranslateAsync(string text, string langFrom, string langTo)
- {
- return await this.translatorApi.TranslateAsync(text, langTo, langFrom)
+ => await this.translatorApi.TranslateAsync(text, langTo, langFrom)
.ConfigureAwait(false);
- }
public static string GetLanguageEnumFromIndex(int index)
- {
- return LanguageTable[index];
- }
+ => LanguageTable[index];
public static int GetIndexFromLanguageEnum(string lang)
- {
- return LanguageTable.IndexOf(lang);
- }
+ => LanguageTable.IndexOf(lang);
}
}
this.imgurApi = new ImgurApi();
}
- public int MaxMediaCount
- {
- get { return 1; }
- }
+ public int MaxMediaCount => 1;
public string SupportedFormatsStrForDialog
{
public bool CanUseAltText => false;
public bool CheckFileExtension(string fileExtension)
- {
- return SupportedExtensions.Contains(fileExtension, StringComparer.OrdinalIgnoreCase);
- }
+ => SupportedExtensions.Contains(fileExtension, StringComparer.OrdinalIgnoreCase);
public bool CheckFileSize(string fileExtension, long fileSize)
{
}
public long? GetMaxFileSize(string fileExtension)
- {
- return MaxFileSize;
- }
+ => MaxFileSize;
public async Task<PostStatusParams> UploadAsync(IMediaItem[] mediaItems, PostStatusParams postParams)
{
=> this.twitterConfig.ShortUrlLength + 1;
public void UpdateTwitterConfiguration(TwitterConfiguration config)
- {
- this.twitterConfig = config;
- }
+ => this.twitterConfig = config;
public class ImgurApi
{
private bool completed = false;
public LazyJson(HttpResponseMessage response)
- {
- this.Response = response;
- }
+ => this.Response = response;
internal LazyJson(T instance)
{
}
public void Dispose()
- {
- this.Response?.Dispose();
- }
+ => this.Response?.Dispose();
}
public static class LazyJson
this.mobypictureApi = new MobypictureApi(twitter.Api);
}
- public int MaxMediaCount
- {
- get { return 1; }
- }
+ public int MaxMediaCount => 1;
public string SupportedFormatsStrForDialog
{
public bool CanUseAltText => false;
public bool CheckFileExtension(string fileExtension)
- {
- return AllowedExtensions.Contains(fileExtension, StringComparer.OrdinalIgnoreCase);
- }
+ => AllowedExtensions.Contains(fileExtension, StringComparer.OrdinalIgnoreCase);
public bool CheckFileSize(string fileExtension, long fileSize)
{
}
public long? GetMaxFileSize(string fileExtension)
- {
- return MaxFileSize;
- }
+ => MaxFileSize;
public async Task<PostStatusParams> UploadAsync(IMediaItem[] mediaItems, PostStatusParams postParams)
{
=> this.twitterConfig.ShortUrlLength + 1;
public void UpdateTwitterConfiguration(TwitterConfiguration config)
- {
- this.twitterConfig = config;
- }
+ => this.twitterConfig = config;
public class MobypictureApi
{
/// <summary>
/// OpenTween 内で共通して使用する HttpClient インスタンス
/// </summary>
- public static HttpClient Http
- {
- get { return globalHttpClient; }
- }
+ public static HttpClient Http => globalHttpClient;
/// <summary>
/// pbs.twimg.com で IPv4 を強制的に使用する
/// </summary>
public static bool ForceIPv4
{
- get { return forceIPv4; }
+ get => forceIPv4;
set
{
if (forceIPv4 == value)
=> this.Dispose(false);
private void Networking_WebProxyChanged(object sender, EventArgs e)
- {
- this.InitializeHttpClients();
- }
+ => this.InitializeHttpClients();
public static async Task<Tuple<string, string>> GetRequestTokenAsync()
{
this.twitterConfig = twitterConfig;
}
- public int MaxMediaCount
- {
- get { return 4; }
- }
+ public int MaxMediaCount => 4;
- public string SupportedFormatsStrForDialog
- {
- get
- {
- return "Image Files(*.gif;*.jpg;*.jpeg;*.png)|*.gif;*.jpg;*.jpeg;*.png";
- }
- }
+ public string SupportedFormatsStrForDialog => "Image Files(*.gif;*.jpg;*.jpeg;*.png)|*.gif;*.jpg;*.jpeg;*.png";
public bool CanUseAltText => true;
public bool CheckFileExtension(string fileExtension)
- {
- return this.pictureExt.Contains(fileExtension.ToLowerInvariant());
- }
+ => this.pictureExt.Contains(fileExtension.ToLowerInvariant());
public bool CheckFileSize(string fileExtension, long fileSize)
{
}
public long? GetMaxFileSize(string fileExtension)
- {
- return this.twitterConfig.PhotoSizeLimit;
- }
+ => this.twitterConfig.PhotoSizeLimit;
public async Task<PostStatusParams> UploadAsync(IMediaItem[] mediaItems, PostStatusParams postParams)
{
=> 0;
public void UpdateTwitterConfiguration(TwitterConfiguration config)
- {
- this.twitterConfig = config;
- }
+ => this.twitterConfig = config;
private async Task<long> UploadMediaItem(IMediaItem mediaItem)
{
public static class ControlTransaction
{
public static IDisposable Update(ListView control)
- {
- return new Transaction<ListView>(control, x => x.BeginUpdate(), x => x.EndUpdate());
- }
+ => new Transaction<ListView>(control, x => x.BeginUpdate(), x => x.EndUpdate());
public static IDisposable Update(ListBox control)
- {
- return new Transaction<ListBox>(control, x => x.BeginUpdate(), x => x.EndUpdate());
- }
+ => new Transaction<ListBox>(control, x => x.BeginUpdate(), x => x.EndUpdate());
public static IDisposable Update(ComboBox control)
- {
- return new Transaction<ComboBox>(control, x => x.BeginUpdate(), x => x.EndUpdate());
- }
+ => new Transaction<ComboBox>(control, x => x.BeginUpdate(), x => x.EndUpdate());
public static IDisposable Update(TreeView control)
- {
- return new Transaction<TreeView>(control, x => x.BeginUpdate(), x => x.EndUpdate());
- }
+ => new Transaction<TreeView>(control, x => x.BeginUpdate(), x => x.EndUpdate());
public static IDisposable Update(Control control)
{
}
public static IDisposable Layout(Control control)
- {
- return Layout(control, performLayout: true);
- }
+ => Layout(control, performLayout: true);
public static IDisposable Layout(Control control, bool performLayout)
- {
- return new Transaction<Control>(control, x => x.SuspendLayout(), x => x.ResumeLayout(performLayout));
- }
+ => new Transaction<Control>(control, x => x.SuspendLayout(), x => x.ResumeLayout(performLayout));
public static IDisposable Init(ISupportInitialize control)
- {
- return new Transaction<ISupportInitialize>(control, x => x.BeginInit(), x => x.EndInit());
- }
+ => new Transaction<ISupportInitialize>(control, x => x.BeginInit(), x => x.EndInit());
public static IDisposable Cursor(Control control, Cursor newCursor)
{
}
public void Dispose()
- {
- this.endTransaction(this.control);
- }
+ => this.endTransaction(this.control);
}
}
}
}
public void ChangeItemBackColor(int index, Color backColor)
- {
- ChangeSubItemBackColor(index, 0, backColor);
- }
+ => this.ChangeSubItemBackColor(index, 0, backColor);
public void ChangeItemForeColor(int index, Color foreColor)
- {
- ChangeSubItemForeColor(index, 0, foreColor);
- }
+ => this.ChangeSubItemForeColor(index, 0, foreColor);
public void ChangeItemFont(int index, Font fnt)
- {
- ChangeSubItemFont(index, 0, fnt);
- }
+ => this.ChangeSubItemFont(index, 0, fnt);
public void ChangeItemFontAndColor(int index, Color foreColor, Font fnt)
- {
- ChangeSubItemStyles(index, 0, BackColor, foreColor, fnt);
- }
+ => this.ChangeSubItemStyles(index, 0, BackColor, foreColor, fnt);
public void ChangeItemStyles(int index, Color backColor, Color foreColor, Font fnt)
- {
- ChangeSubItemStyles(index, 0, backColor, foreColor, fnt);
- }
+ => this.ChangeSubItemStyles(index, 0, backColor, foreColor, fnt);
public void ChangeSubItemBackColor(int itemIndex, int subitemIndex, Color backColor)
{
}
private MyCommon.EVENTTYPE ParseEventTypeFromTag()
- {
- return (MyCommon.EVENTTYPE)Enum.Parse(typeof(MyCommon.EVENTTYPE), _curTab.Tag.ToString());
- }
+ => (MyCommon.EVENTTYPE)Enum.Parse(typeof(MyCommon.EVENTTYPE), _curTab.Tag.ToString());
private bool IsFilterMatch(Twitter.FormattedEvent x)
{
}
private void CheckExcludeMyEvent_CheckedChanged(object sender, EventArgs e)
- {
- CreateFilterdEventSource();
- }
+ => this.CreateFilterdEventSource();
private void ButtonRefresh_Click(object sender, EventArgs e)
- {
- CreateFilterdEventSource();
- }
+ => this.CreateFilterdEventSource();
private void TabEventType_SelectedIndexChanged(object sender, EventArgs e)
- {
- CreateFilterdEventSource();
- }
+ => this.CreateFilterdEventSource();
private void TabEventType_Selecting(object sender, TabControlCancelEventArgs e)
{
}
private void EventList_CacheVirtualItems(object sender, CacheVirtualItemsEventArgs e)
- {
- CreateCache(e.StartIndex, e.EndIndex);
- }
+ => this.CreateCache(e.StartIndex, e.EndIndex);
private void CreateCache(int StartIndex, int EndIndex)
{
private EnableButtonMode RuleEnableButtonMode
{
- get { return this._ruleEnableButtonMode; }
+ get => this._ruleEnableButtonMode;
set
{
this._ruleEnableButtonMode = value;
private EnableButtonMode _ruleEnableButtonMode = FilterDialog.EnableButtonMode.NotSelected;
public FilterDialog()
- {
- InitializeComponent();
- }
+ => this.InitializeComponent();
private void SetFilters(string tabName)
{
}
public void SetCurrent(string TabName)
- {
- _cur = TabName;
- }
+ => this._cur = TabName;
public void AddNewFilter(string id, string msg)
{
}
private bool IsValidLambdaExp(string text)
- {
- return false;
- // TODO DynamicQuery相当のGPLv3互換なライブラリで置換する
- }
+ => false; // TODO DynamicQuery相当のGPLv3互換なライブラリで置換する
private bool IsValidRegexp(string text)
{
}
private void ButtonClose_Click(object sender, EventArgs e)
- {
- this.Close();
- }
+ => this.Close();
private void FilterDialog_FormClosed(object sender, FormClosedEventArgs e)
- {
- _directAdd = false;
- }
+ => this._directAdd = false;
private void FilterDialog_KeyDown(object sender, KeyEventArgs e)
{
}
private void OptMove_CheckedChanged(object sender, EventArgs e)
- {
- CheckMark.Enabled = !OptMove.Checked;
- }
+ => this.CheckMark.Enabled = !OptMove.Checked;
private void ButtonRuleUp_Click(object sender, EventArgs e)
- {
- MoveSelectedRules(up: true);
- }
+ => this.MoveSelectedRules(up: true);
private void ButtonRuleDown_Click(object sender, EventArgs e)
- {
- MoveSelectedRules(up: false);
- }
+ => this.MoveSelectedRules(up: false);
private void MoveSelectedRules(bool up)
{
}
private void HistoryHashList_DoubleClick(object sender, EventArgs e)
- {
- this.OK_Button_Click(null, null);
- }
+ => this.OK_Button_Click(null, null);
public void ToggleHash()
{
}
public void ClearHashtag()
- {
- this.UseHash = "";
- }
+ => this.UseHash = "";
public void SetPermanentHash(string hash)
{
}
private void CheckNotAddToAtReply_CheckedChanged(object sender, EventArgs e)
- {
- this.IsNotAddToAtReply = CheckNotAddToAtReply.Checked;
- }
+ => this.IsNotAddToAtReply = CheckNotAddToAtReply.Checked;
}
}
}
public void OnHandleCreated(Object sender, EventArgs e)
- {
- this.AssignHandle(_targetForm.Handle);
- }
+ => this.AssignHandle(_targetForm.Handle);
public void OnHandleDestroyed(Object sender, EventArgs e)
- {
- this.ReleaseHandle();
- }
+ => this.ReleaseHandle();
public bool RegisterOriginalHotkey(Keys hotkey, int hotkeyValue, ModKeys modifiers)
{
/// 保持しているキャッシュの件数
/// </summary>
public long CacheCount
- {
- get { return this.innerDictionary.Count; }
- }
+ => this.innerDictionary.Count;
/// <summary>
/// 破棄されたキャッシュの件数
}
public MemoryImage Image
- {
- get
- {
- return (MemoryImage)this.imageReference.Target;
- }
- }
+ => (MemoryImage)this.imageReference.Target;
public Task RefreshImageAsync()
{
public partial class InputDialog : OTBaseForm
{
protected InputDialog()
- {
- InitializeComponent();
- }
+ => this.InitializeComponent();
private void buttonOK_Click(object sender, EventArgs e)
- {
- this.DialogResult = DialogResult.OK;
- }
+ => this.DialogResult = DialogResult.OK;
private void buttonCancel_Click(object sender, EventArgs e)
- {
- this.DialogResult = DialogResult.Cancel;
- }
+ => this.DialogResult = DialogResult.Cancel;
public static DialogResult Show(string text, out string inputText)
- {
- return Show(null, text, "", out inputText);
- }
+ => Show(null, text, "", out inputText);
public static DialogResult Show(IWin32Window owner, string text, out string inputText)
- {
- return Show(owner, text, "", out inputText);
- }
+ => Show(owner, text, "", out inputText);
public static DialogResult Show(string text, string caption, out string inputText)
- {
- return Show(null, text, caption, out inputText);
- }
+ => Show(null, text, caption, out inputText);
public static DialogResult Show(IWin32Window owner, string text, string caption, out string inputText)
{
public partial class InputTabName : OTBaseForm
{
public InputTabName()
- {
- InitializeComponent();
- }
+ => this.InitializeComponent();
private void OK_Button_Click(object sender, EventArgs e)
{
public KeyValuePair<TKey, TValue> Item { get; }
public CacheRemovedEventArgs(KeyValuePair<TKey, TValue> item)
- {
- this.Item = item;
- }
+ => this.Item = item;
}
public event EventHandler<CacheRemovedEventArgs> CacheRemoved;
}
public void Add(TKey key, TValue value)
- {
- this.Add(new KeyValuePair<TKey, TValue>(key, value));
- }
+ => this.Add(new KeyValuePair<TKey, TValue>(key, value));
public void Add(KeyValuePair<TKey, TValue> item)
{
}
public bool ContainsKey(TKey key)
- {
- return this.innerDict.ContainsKey(key);
- }
+ => this.innerDict.ContainsKey(key);
public bool Contains(KeyValuePair<TKey, TValue> item)
{
}
public ICollection<TKey> Keys
- {
- get { return this.innerDict.Keys; }
- }
+ => this.innerDict.Keys;
public ICollection<TValue> Values
- {
- get { return this.innerDict.Values.Select(x => x.Value.Value).ToList(); }
- }
+ => this.innerDict.Values.Select(x => x.Value.Value).ToList();
public TValue this[TKey key]
{
}
public int Count
- {
- get { return this.innerDict.Count; }
- }
+ => this.innerDict.Count;
public bool IsReadOnly
- {
- get { return false; }
- }
+ => false;
public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()
- {
- return this.innerDict.Select(x => x.Value.Value).GetEnumerator();
- }
+ => this.innerDict.Select(x => x.Value.Value).GetEnumerator();
IEnumerator IEnumerable.GetEnumerator()
- {
- return this.GetEnumerator();
- }
+ => this.GetEnumerator();
}
}
public ListElement SelectedList { get; private set; }
public ListAvailable()
- {
- InitializeComponent();
- }
+ => this.InitializeComponent();
private void OK_Button_Click(object sender, EventArgs e)
{
}
public async Task GetMoreMembers()
- {
- this.Cursor = await this._tw.GetListMembers(this.Id, this._members, this.Cursor)
+ => this.Cursor = await this._tw.GetListMembers(this.Id, this._members, this.Cursor)
.ConfigureAwait(false);
- }
public override string ToString()
- {
- return "@" + Username + "/" + Name + " [" + (this.IsPublic ? "public" : "Protected") + "]";
- }
+ => $"@{Username}/{Name} [{(this.IsPublic ? "public" : "Protected")}]";
}
}
public bool IsCreated { get; private set; } = false;
public NewListElement(Twitter tw)
- {
- this._tw = tw;
- }
+ => this._tw = tw;
public override async Task Refresh()
{
public string AltText { get; set; }
public FileMediaItem(string path)
- {
- this.FileInfo = new FileInfo(path);
- }
+ => this.FileInfo = new FileInfo(path);
public FileMediaItem(FileInfo fileInfo)
: this(fileInfo.FullName)
}
public string Path
- {
- get { return this.FileInfo.FullName; }
- }
+ => this.FileInfo.FullName;
public string Name
- {
- get { return this.FileInfo.Name; }
- }
+ => this.FileInfo.Name;
public string Extension
- {
- get { return this.FileInfo.Extension; }
- }
+ => this.FileInfo.Extension;
public bool Exists
- {
- get { return this.FileInfo.Exists; }
- }
+ => this.FileInfo.Exists;
public long Size
- {
- get { return this.FileInfo.Length; }
- }
+ => this.FileInfo.Length;
public bool IsImage
{
}
public Stream OpenRead()
- {
- return this.FileInfo.OpenRead();
- }
+ => this.FileInfo.OpenRead();
public void CopyTo(Stream stream)
{
public string AltText { get; set; }
public string Name
- {
- get { return this.Path.Substring(PathPrefix.Length); }
- }
+ => this.Path.Substring(PathPrefix.Length);
public string Extension
- {
- get { return this._image.ImageFormatExt; }
- }
+ => this._image.ImageFormatExt;
public bool Exists
- {
- get { return this._image != null; }
- }
+ => this._image != null;
public long Size
- {
- get { return this._image.Stream.Length; }
- }
+ => this._image.Stream.Length;
public bool IsImage
- {
- get { return true; }
- }
+ => true;
public MemoryImage CreateImage()
- {
- return this._image.Clone();
- }
+ => this._image.Clone();
public Stream OpenRead()
{
}
public void CopyTo(Stream stream)
- {
- this._image.Stream.WriteTo(stream);
- }
+ => this._image.Stream.WriteTo(stream);
protected virtual void Dispose(bool disposing)
{
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string ServiceName
- {
- get { return ImageServiceCombo.Text; }
- }
+ => this.ImageServiceCombo.Text;
/// <summary>
/// 選択されている投稿先を示すインデックスを取得する。
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public int ServiceIndex
- {
- get { return ImageServiceCombo.SelectedIndex; }
- }
+ => this.ImageServiceCombo.SelectedIndex;
/// <summary>
/// 選択されている投稿先の IMediaUploadService を取得する。
/// 利用可能な全ての IMediaUploadService インスタンスを取得する。
/// </summary>
public ICollection<IMediaUploadService> GetServices()
- {
- return this.pictureService.Values;
- }
+ => this.pictureService.Values;
private class SelectedMedia
{
}
public bool IsValid
- {
- get
- {
- return this.Item != null && this.Type != MyCommon.UploadFileType.Invalid;
- }
- }
+ => this.Item != null && this.Type != MyCommon.UploadFileType.Invalid;
public string Path
- {
- get
- {
- return this.Item?.Path ?? "";
- }
- }
+ => this.Item?.Path ?? "";
public string AltText => this.Item?.AltText ?? "";
public override string ToString()
- {
- return this.Text;
- }
+ => this.Text;
}
private Dictionary<string, IMediaUploadService> pictureService;
}
private void ImageFromSelectedFile(IMediaItem item, bool noMsgBox)
- {
- ImageFromSelectedFile(-1, item, noMsgBox);
- }
+ => this.ImageFromSelectedFile(-1, item, noMsgBox);
private void ImageFromSelectedFile(int index, IMediaItem item, bool noMsgBox)
{
}
private void ImageCancelButton_Click(object sender, EventArgs e)
- {
- EndSelection();
- }
+ => this.EndSelection();
private void ImageSelection_KeyDown(object sender, KeyEventArgs e)
{
}
private void SetSelectedImagePage(IMediaItem item, MyCommon.UploadFileType type)
- {
- SetImagePage(-1, item, type);
- }
+ => this.SetImagePage(-1, item, type);
private void SetImagePage(int index, IMediaItem item, MyCommon.UploadFileType type)
{
}
private void ClearSelectedImagePage()
- {
- ClearImagePage(-1);
- }
+ => this.ClearImagePage(-1);
private void ClearImagePage(int index)
{
}
private void ImagePageCombo_SelectedIndexChanged(object sender, EventArgs e)
- {
- ValidateSelectedImagePage();
- }
+ => this.ValidateSelectedImagePage();
private void AlternativeTextBox_Validating(object sender, CancelEventArgs e)
{
/// MemoryImage が保持している画像のフォーマット
/// </summary>
public ImageFormat ImageFormat
- {
- get { return this.Image.RawFormat; }
- }
+ => this.Image.RawFormat;
/// <summary>
/// MemoryImage が保持している画像のフォーマットに相当する拡張子 (ピリオド付き)
}
public override bool Equals(object other)
- {
- return this.Equals(other as MemoryImage);
- }
+ => this.Equals(other as MemoryImage);
public bool Equals(MemoryImage other)
{
}
object ICloneable.Clone()
- {
- return this.Clone();
- }
+ => this.Clone();
protected virtual void Dispose(bool disposing)
{
}
private void OnFilterModified(object sender, PropertyChangedEventArgs e)
- {
- this.FilterModified = true;
- }
+ => this.FilterModified = true;
public PostFilterRule[] FilterArray
{
=> obj is MediaInfo info && info.Url == this.Url && info.VideoUrl == this.VideoUrl;
public override int GetHashCode()
- {
- return (this.Url == null ? 0 : this.Url.GetHashCode()) ^
- (this.VideoUrl == null ? 0 : this.VideoUrl.GetHashCode());
- }
+ => (this.Url?.GetHashCode() ?? 0) ^ (this.VideoUrl?.GetHashCode() ?? 0);
public override string ToString()
- {
- return this.Url;
- }
+ => this.Url;
}
}
public bool IsProtect
{
- get
- {
- return _IsProtect;
- }
+ get => this._IsProtect;
set
{
if (value)
}
public bool IsMark
{
- get
- {
- return _IsMark;
- }
+ get => this._IsMark;
set
{
if (value)
}
public long? InReplyToStatusId
{
- get
- {
- return _InReplyToStatusId;
- }
+ get => this._InReplyToStatusId;
set
{
if (value != null)
public bool IsDeleted
{
- get
- {
- return _IsDeleted;
- }
+ get => this._IsDeleted;
set
{
if (value)
}
protected virtual PostClass RetweetSource
- {
- get
- {
- return TabInformations.GetInstance().RetweetSource(this.RetweetedId.Value);
- }
- }
+ => TabInformations.GetInstance().RetweetSource(this.RetweetedId.Value);
public StatusGeo? PostGeo
{
- get
- {
- return _postGeo;
- }
+ get => this._postGeo;
set
{
if (value != null)
}
public int StateIndex
- {
- get
- {
- return (int)_states - 1;
- }
- }
+ => (int)_states - 1;
// 互換性のために用意
public string SourceHtml
}
public override int GetHashCode()
- {
- return this.StatusId.GetHashCode();
- }
+ => this.StatusId.GetHashCode();
}
}
/// </summary>
[XmlIgnore]
public string SummaryText
- {
- get { return this.MakeSummary(); }
- }
+ => this.MakeSummary();
/// <summary>
/// ExecFilter() メソッドの実行時に自動でコンパイルを実行する
this.ExUseNameField = true;
}
+ // TODO: TabsClass とかの改修が終わるまでデフォルト有効
static PostFilterRule()
- {
- // TODO: TabsClass とかの改修が終わるまでデフォルト有効
- PostFilterRule.AutoCompile = true;
- }
+ => PostFilterRule.AutoCompile = true;
/// <summary>
/// 振り分けルールをコンパイルします
/// </summary>
/// <returns>振り分けルールの概要</returns>
public override string ToString()
- {
- return this.SummaryText;
- }
+ => this.SummaryText;
protected override void OnPropertyChanged(PropertyChangedEventArgs e)
{
}
public override bool Equals(object obj)
- {
- return this.Equals(obj as PostFilterRule);
- }
+ => this.Equals(obj as PostFilterRule);
public bool Equals(PostFilterRule other)
{
public string SearchWords
{
- get { return this._searchWords; }
+ get => this._searchWords;
set
{
this._searchWords = value;
public string SearchLang
{
- get { return this._searchLang; }
+ get => this._searchLang;
set
{
this._searchLang = value;
}
public static TabInformations GetInstance()
- {
- return _instance; //singleton
- }
+ => _instance; // singleton
public List<ListElement> SubscribableLists
{
- get
- {
- return _lists;
- }
+ get => this._lists;
set
{
if (value != null && value.Count > 0)
}
public bool ContainsTab(string TabText)
- {
- return this.Tabs.ContainsKey(TabText);
- }
+ => this.Tabs.ContainsKey(TabText);
public bool ContainsTab(TabModel ts)
- {
- return this.Tabs.ContainsValue(ts);
- }
+ => this.Tabs.ContainsValue(ts);
/// <summary>
/// 指定されたタブ名を元に、既存のタブ名との重複を避けた名前を生成します
/// <returns>生成されたタブ名</returns>
/// <exception cref="TabException">タブ名の生成を 100 回試行して失敗した場合</exception>
public string MakeTabName(string baseTabName)
- {
- return this.MakeTabName(baseTabName, 100);
- }
+ => this.MakeTabName(baseTabName, 100);
/// <summary>
/// 指定されたタブ名を元に、既存のタブ名との重複を避けた名前を生成します
}
public Dictionary<string, TabModel>.KeyCollection KeysTab
- {
- get
- {
- return this.Tabs.Keys;
- }
- }
+ => this.Tabs.Keys;
public SortOrder SortOrder { get; private set; }
// }
// }
public PostClass RetweetSource(long Id)
- {
- return this.Posts.TryGetValue(Id, out var status)
- ? status
- : null;
- }
+ => this.Posts.TryGetValue(Id, out var status) ? status : null;
public void ScrubGeoReserve(long id, long upToStatusId)
{
}
public int SubmitUpdate()
- {
- return this.SubmitUpdate(out var soundFile, out var notifyPosts,
- out var newMentionOrDm, out var isDeletePost);
- }
+ => this.SubmitUpdate(out var soundFile, out var notifyPosts, out var newMentionOrDm, out var isDeletePost);
public int SubmitUpdate(out string soundFile, out PostClass[] notifyPosts,
out bool newMentionOrDm, out bool isDeletePost)
private readonly object _lockObj = new object();
protected TabModel(string tabName)
- {
- this.TabName = tabName;
- }
+ => this.TabName = tabName;
public abstract Task RefreshAsync(Twitter tw, bool backward, bool startup, IProgress<string> progress);
}
public virtual void EnqueueRemovePost(long statusId, bool setIsDeleted)
- {
- this.removeQueue.Enqueue(statusId);
- }
+ => this.removeQueue.Enqueue(statusId);
public virtual bool RemovePostImmediately(long statusId)
{
/// デフォルトタブかどうかを示す値を取得します。
/// </summary>
public static bool IsDefault(this MyCommon.TabUsageType tabType)
- {
- return (tabType & DefaultTabTypeMask) != 0;
- }
+ => (tabType & DefaultTabTypeMask) != 0;
/// <summary>
/// 振り分け可能タブかどうかを示す値を取得します。
/// </summary>
public static bool IsDistributable(this MyCommon.TabUsageType tabType)
- {
- return (tabType & DistributableTabTypeMask) != 0;
- }
+ => (tabType & DistributableTabTypeMask) != 0;
/// <summary>
/// 内部ストレージを使用するタブかどうかを示す値を取得します。
/// </summary>
public static bool IsInnerStorage(this MyCommon.TabUsageType tabType)
- {
- return (tabType & InnerStorageTabTypeMask) != 0;
- }
+ => (tabType & InnerStorageTabTypeMask) != 0;
}
}
private readonly List<Control> controls = new List<Control>();
public MouseWheelMessageFilter()
- {
- Application.AddMessageFilter(this);
- }
+ => Application.AddMessageFilter(this);
public void Register(Control target)
- {
- this.controls.Add(target);
- }
+ => this.controls.Add(target);
public void Unregister(Control target)
- {
- this.controls.Remove(target);
- }
+ => this.controls.Remove(target);
public bool PreFilterMessage(ref Message m)
{
}
public static string GetErrorLogPath()
- {
- return Path.Combine(Path.GetDirectoryName(MyCommon.EntryAssembly.Location), "ErrorLogs");
- }
+ => Path.Combine(Path.GetDirectoryName(MyCommon.EntryAssembly.Location), "ErrorLogs");
public static void TraceOut(WebApiException ex)
{
}
public static void TraceOut(string Message)
- {
- TraceOut(TraceFlag, Message);
- }
+ => TraceOut(TraceFlag, Message);
public static void TraceOut(bool OutputFlag, string Message)
{
/// <param name="keys">状態を調べるキー</param>
/// <returns><paramref name="keys"/> で指定された修飾キーがすべて押されている状態であれば true。それ以外であれば false。</returns>
public static bool IsKeyDown(params Keys[] keys)
- {
- return MyCommon._IsKeyDown(Control.ModifierKeys, keys);
- }
+ => MyCommon._IsKeyDown(Control.ModifierKeys, keys);
internal static bool _IsKeyDown(Keys modifierKeys, Keys[] targetKeys)
{
/// </remarks>
/// <returns>アプリケーションのアセンブリ名</returns>
public static string GetAssemblyName()
- {
- return MyCommon.EntryAssembly.GetName().Name;
- }
+ => MyCommon.EntryAssembly.GetName().Name;
/// <summary>
/// 文字列中に含まれる %AppName% をアプリケーション名に置換する
/// <param name="orig">対象となる文字列</param>
/// <returns>置換後の文字列</returns>
public static string ReplaceAppName(string orig)
- {
- return MyCommon.ReplaceAppName(orig, ApplicationSettings.ApplicationName);
- }
+ => MyCommon.ReplaceAppName(orig, ApplicationSettings.ApplicationName);
/// <summary>
/// 文字列中に含まれる %AppName% をアプリケーション名に置換する
/// <param name="appname">アプリケーション名</param>
/// <returns>置換後の文字列</returns>
public static string ReplaceAppName(string orig, string appname)
- {
- return orig.Replace("%AppName%", appname);
- }
+ => orig.Replace("%AppName%", appname);
/// <summary>
/// 表示用のバージョン番号の文字列を生成する
}
public static string GetStatusUrl(string screenName, long statusId)
- {
- return TwitterUrl + screenName + "/status/" + statusId;
- }
+ => TwitterUrl + screenName + "/status/" + statusId;
/// <summary>
/// 指定された IDictionary を元にクエリ文字列を生成します
private long[] addedListIds = new long[0];
public MyLists()
- {
- InitializeComponent();
- }
+ => this.InitializeComponent();
public MyLists(string screenName, TwitterApi twitterApi)
{
}
private void ContextMenuStrip1_Opening(object sender, CancelEventArgs e)
- {
- e.Cancel = this.ListsCheckedListBox.SelectedItem == null;
- }
+ => e.Cancel = this.ListsCheckedListBox.SelectedItem == null;
private async void MenuItemAdd_Click(object sender, EventArgs e)
{
}
private void CloseButton_Click(object sender, EventArgs e)
- {
- this.Close();
- }
+ => this.Close();
}
}
/// <param name="width">アイテムの最小幅。-1 を指定するとデフォルトの幅が使用されます</param>
/// <returns>設定前の最小幅</returns>
public static int SetMinTabWidth(TabControl tabControl, int width)
- {
- return (int)SendMessage(tabControl.Handle, SendMessageType.TCM_SETMINTABWIDTH, IntPtr.Zero, (IntPtr)width);
- }
+ => (int)SendMessage(tabControl.Handle, SendMessageType.TCM_SETMINTABWIDTH, IntPtr.Zero, (IntPtr)width);
// 参照: LVITEM structure (Windows)
// http://msdn.microsoft.com/en-us/library/windows/desktop/bb774760%28v=vs.85%29.aspx
/// <param name="listView">対象となる ListView</param>
/// <returns>成功した場合は true、それ以外の場合は false</returns>
public static bool SelectAllItems(ListView listView)
- {
- return SelectItem(listView, -1 /* all items */);
- }
+ => SelectItem(listView, -1 /* all items */);
#region "画面ブリンク用"
public static bool FlashMyWindow(IntPtr hwnd,
#region "selection mark"
// 複数選択時の起点になるアイテム (selection mark) の位置を取得する
public static int ListView_GetSelectionMark(IntPtr hwndLV)
- {
- return SendMessage(hwndLV, SendMessageType.LVM_GETSELECTIONMARK, IntPtr.Zero, IntPtr.Zero).ToInt32();
- }
+ => SendMessage(hwndLV, SendMessageType.LVM_GETSELECTIONMARK, IntPtr.Zero, IntPtr.Zero).ToInt32();
// 複数選択時の起点になるアイテム (selection mark) を設定する
public static void ListView_SetSelectionMark(IntPtr hwndLV, int itemIndex)
- {
- SendMessage(hwndLV, SendMessageType.LVM_SETSELECTIONMARK, IntPtr.Zero, (IntPtr)itemIndex);
- }
+ => SendMessage(hwndLV, SendMessageType.LVM_SETSELECTIONMARK, IntPtr.Zero, (IntPtr)itemIndex);
#endregion
#region "スクリーンセーバー起動中か判定"
/// 標準の VScrollBar のスケーリングでは不十分な処理を補います
/// </summary>
public static void ScaleChildControl(VScrollBar scrollBar, SizeF factor)
- {
- scrollBar.Width = ScaleBy(factor.Width, scrollBar.Width);
- }
+ => scrollBar.Width = ScaleBy(factor.Width, scrollBar.Width);
/// <summary>
/// 標準の ImageList のスケーリングでは不十分な処理を補います
/// </summary>
public static void ScaleChildControl(ImageList imageList, SizeF factor)
- {
- imageList.ImageSize = ScaleBy(factor, imageList.ImageSize);
- }
+ => imageList.ImageSize = ScaleBy(factor, imageList.ImageSize);
public static Size ScaleBy(SizeF factor, Size size)
- {
- return Size.Round(new SizeF(size.Width * factor.Width, size.Height * factor.Height));
- }
+ => Size.Round(new SizeF(size.Width * factor.Width, size.Height * factor.Height));
public static int ScaleBy(float factor, int size)
- {
- return (int)Math.Round(size * factor);
- }
+ => (int)Math.Round(size * factor);
}
}
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public new MemoryImage Image
{
- get { return this.memoryImage; }
+ get => this.memoryImage;
set
{
this.memoryImage = value;
[DefaultValue(PictureBoxSizeMode.Normal)]
public new PictureBoxSizeMode SizeMode
{
- get { return this.currentSizeMode; }
+ get => this.currentSizeMode;
set
{
this.currentSizeMode = value;
}
private void RestoreSizeMode()
- {
- base.SizeMode = this.currentSizeMode;
- }
+ => base.SizeMode = this.currentSizeMode;
/// <summary>
/// SetImageFromTask メソッドを連続で呼び出した際に設定される画像が前後するのを防ぐため、
[EditorBrowsable(EditorBrowsableState.Never)]
public new void Load(string url)
- {
- throw new NotSupportedException();
- }
+ => throw new NotSupportedException();
}
}
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsPanelInverted
{
- get { return _isPanelInverted; }
+ get => this._isPanelInverted;
set
{
- if (_isPanelInverted == value) return;
+ if (_isPanelInverted == value)
+ return;
_isPanelInverted = value;
// Panel1 と Panel2 の中身を入れ替え
/// SplitContainer.Orientation プロパティの設定に応じて、スプリッタが移動する方向の幅を返す。
/// </summary>
private int SplitterTotalWidth
- {
- get { return (base.Orientation == Orientation.Horizontal) ? base.Height : base.Width; }
- }
+ => (base.Orientation == Orientation.Horizontal) ? base.Height : base.Width;
/// <summary>
/// IsPanelInverted プロパティの設定に応じて、SplitContainer.Panel1 または SplitContainer.Panel2 を返す。
/// </summary>
public new SplitterPanel Panel1
- {
- get { return IsPanelInverted ? base.Panel2 : base.Panel1; }
- }
+ => IsPanelInverted ? base.Panel2 : base.Panel1;
/// <summary>
/// IsPanelInverted プロパティの設定に応じて、SplitContainer.Panel1 または SplitContainer.Panel2 を返す。
/// </summary>
public new SplitterPanel Panel2
- {
- get { return IsPanelInverted ? base.Panel1 : base.Panel2; }
- }
+ => IsPanelInverted ? base.Panel1 : base.Panel2;
/// <summary>
/// IsPanelInverted プロパティの設定に応じて、SplitContainer.FixedPanel を返す。
/// </summary>
public new int Panel1MinSize
{
- get { return IsPanelInverted ? base.Panel2MinSize : base.Panel1MinSize; }
+ get => IsPanelInverted ? base.Panel2MinSize : base.Panel1MinSize;
set
{
if (IsPanelInverted)
/// </summary>
public new int Panel2MinSize
{
- get { return IsPanelInverted ? base.Panel1MinSize : base.Panel2MinSize; }
+ get => IsPanelInverted ? base.Panel1MinSize : base.Panel2MinSize;
set
{
if (IsPanelInverted)
/// </summary>
public new bool Panel1Collapsed
{
- get { return IsPanelInverted ? base.Panel2Collapsed : base.Panel1Collapsed; }
+ get => IsPanelInverted ? base.Panel2Collapsed : base.Panel1Collapsed;
set
{
if (IsPanelInverted)
/// </summary>
public new bool Panel2Collapsed
{
- get { return IsPanelInverted ? base.Panel1Collapsed : base.Panel2Collapsed; }
+ get => IsPanelInverted ? base.Panel1Collapsed : base.Panel2Collapsed;
set
{
if (IsPanelInverted)
private string _selUrl;
public OpenURL()
- {
- InitializeComponent();
- }
+ => this.InitializeComponent();
private void OK_Button_Click(object sender, EventArgs e)
{
}
public void ClearUrl()
- {
- UrlList.Items.Clear();
- }
+ => this.UrlList.Items.Clear();
public void AddUrl(OpenUrlItem openUrlItem)
- {
- UrlList.Items.Add(openUrlItem);
- }
+ => this.UrlList.Items.Add(openUrlItem);
public string SelectedUrl
{
}
public override string ToString()
- {
- return this.Href;
- }
+ => this.Href;
public string Url { get; }
public string Href { get; }
private SearchOptions resultOptoins = null;
public SearchOptions ResultOptions
{
- get { return this.resultOptoins; }
+ get => this.resultOptoins;
set
{
this.resultOptoins = value;
private bool disableNetTabButton = false;
public bool DisableNewTabButton
{
- get { return this.disableNetTabButton; }
+ get => this.disableNetTabButton;
set
{
this.disableNetTabButton = value;
}
public SearchWordDialog()
- {
- InitializeComponent();
- }
+ => this.InitializeComponent();
public void Reset()
{
}
private void SearchWordDialog_Shown(object sender, EventArgs e)
- {
- ActivateSelectedTabPage();
- }
+ => this.ActivateSelectedTabPage();
private void tabControl_SelectedIndexChanged(object sender, EventArgs e)
- {
- ActivateSelectedTabPage();
- }
+ => this.ActivateSelectedTabPage();
private void ActivateSelectedTabPage()
{
{
public ErrorReport ErrorReport
{
- get { return this._errorReport; }
+ get => this._errorReport;
set
{
this._errorReport = value;
private ErrorReport _errorReport;
public SendErrorReportForm()
- {
- this.InitializeComponent();
- }
+ => this.InitializeComponent();
private void SendErrorReportForm_Shown(object sender, EventArgs e)
{
}
private void buttonReset_Click(object sender, EventArgs e)
- {
- this.ErrorReport.Reset();
- }
+ => this.ErrorReport.Reset();
private async void buttonSendByMail_Click(object sender, EventArgs e)
{
}
private void buttonNotSend_Click(object sender, EventArgs e)
- {
- this.DialogResult = DialogResult.Cancel;
- }
+ => this.DialogResult = DialogResult.Cancel;
}
public class ErrorReport : NotifyPropertyChangedBase
{
public string ReportText
{
- get { return this._reportText; }
+ get => this._reportText;
set
{
this.SetProperty(ref this._reportText, value);
public bool AnonymousReport
{
- get { return this._anonymousReport; }
+ get => this._anonymousReport;
set
{
this.SetProperty(ref this._anonymousReport, value);
}
public void Reset()
- {
- this.ReportText = this.originalReportText;
- }
+ => this.ReportText = this.originalReportText;
public async Task SendByMailAsync()
{
}
public async Task SendByDmAsync()
- {
- await this.tw.SendDirectMessage(this.EncodedReportForDM);
- }
+ => await this.tw.SendDirectMessage(this.EncodedReportForDM);
private void UpdateEncodedReport()
{
public partial class ActionPanel : SettingPanelBase
{
public ActionPanel()
- {
- InitializeComponent();
- }
+ => this.InitializeComponent();
public void LoadConfig(SettingCommon settingCommon, SettingLocal settingLocal)
{
public partial class BasedPanel : SettingPanelBase
{
public BasedPanel()
- {
- InitializeComponent();
- }
+ => this.InitializeComponent();
public void LoadConfig(SettingCommon settingCommon)
{
}
public void SaveConfig(SettingCommon settingCommon)
- {
- settingCommon.UserAccounts = this.AuthUserCombo.Items.Cast<UserAccount>().ToList();
- }
+ => settingCommon.UserAccounts = this.AuthUserCombo.Items.Cast<UserAccount>().ToList();
private void AuthClearButton_Click(object sender, EventArgs e)
{
public partial class ConnectionPanel : SettingPanelBase
{
public ConnectionPanel()
- {
- InitializeComponent();
- }
+ => InitializeComponent();
public void LoadConfig(SettingCommon settingCommon)
{
public partial class CooperatePanel : SettingPanelBase
{
public CooperatePanel()
- {
- InitializeComponent();
- }
+ => this.InitializeComponent();
public void LoadConfig(SettingCommon settingCommon)
{
}
private void EnableImgAzyobuziNetCheckBox_CheckedChanged(object sender, EventArgs e)
- {
- this.ImgAzyobuziNetDisabledInDMCheckBox.Enabled = this.EnableImgAzyobuziNetCheckBox.Checked;
- }
+ => this.ImgAzyobuziNetDisabledInDMCheckBox.Enabled = this.EnableImgAzyobuziNetCheckBox.Checked;
}
}
public partial class FontPanel : SettingPanelBase
{
public FontPanel()
- {
- InitializeComponent();
- }
+ => this.InitializeComponent();
public void LoadConfig(SettingLocal settingLocal)
{
}
private void btnListFont_Click(object sender, EventArgs e)
- {
- this.ShowFontDialog(this.lblListFont);
- }
+ => this.ShowFontDialog(this.lblListFont);
private void btnUnread_Click(object sender, EventArgs e)
- {
- this.ShowFontDialog(this.lblUnread);
- }
+ => this.ShowFontDialog(this.lblUnread);
private void btnFav_Click(object sender, EventArgs e)
- {
- this.ShowForeColorDialog(this.lblFav);
- }
+ => this.ShowForeColorDialog(this.lblFav);
private void btnOWL_Click(object sender, EventArgs e)
- {
- this.ShowForeColorDialog(this.lblOWL);
- }
+ => this.ShowForeColorDialog(this.lblOWL);
private void btnRetweet_Click(object sender, EventArgs e)
- {
- this.ShowForeColorDialog(this.lblRetweet);
- }
+ => this.ShowForeColorDialog(this.lblRetweet);
private void btnDetail_Click(object sender, EventArgs e)
- {
- this.ShowFontDialog(this.lblDetail);
- }
+ => this.ShowFontDialog(this.lblDetail);
private void btnDetailLink_Click(object sender, EventArgs e)
- {
- this.ShowForeColorDialog(this.lblDetailLink);
- }
+ => this.ShowForeColorDialog(this.lblDetailLink);
private void btnDetailBack_Click(object sender, EventArgs e)
- {
- this.ShowBackColorDialog(this.lblDetailBackcolor);
- }
+ => this.ShowBackColorDialog(this.lblDetailBackcolor);
}
}
public partial class FontPanel2 : SettingPanelBase
{
public FontPanel2()
- {
- InitializeComponent();
- }
+ => this.InitializeComponent();
public void LoadConfig(SettingLocal settingLocal)
{
}
private void btnSelf_Click(object sender, EventArgs e)
- {
- this.ShowBackColorDialog(this.lblSelf);
- }
+ => this.ShowBackColorDialog(this.lblSelf);
private void btnAtSelf_Click(object sender, EventArgs e)
- {
- this.ShowBackColorDialog(this.lblAtSelf);
- }
+ => this.ShowBackColorDialog(this.lblAtSelf);
private void btnTarget_Click(object sender, EventArgs e)
- {
- this.ShowBackColorDialog(this.lblTarget);
- }
+ => this.ShowBackColorDialog(this.lblTarget);
private void btnAtTarget_Click(object sender, EventArgs e)
- {
- this.ShowBackColorDialog(this.lblAtTarget);
- }
+ => this.ShowBackColorDialog(this.lblAtTarget);
private void btnAtFromTarget_Click(object sender, EventArgs e)
- {
- this.ShowBackColorDialog(this.lblAtFromTarget);
- }
+ => this.ShowBackColorDialog(this.lblAtFromTarget);
private void btnAtTo_Click(object sender, EventArgs e)
- {
- this.ShowBackColorDialog(this.lblAtTo);
- }
+ => this.ShowBackColorDialog(this.lblAtTo);
private void btnListBack_Click(object sender, EventArgs e)
- {
- this.ShowBackColorDialog(this.lblListBackcolor);
- }
+ => this.ShowBackColorDialog(this.lblListBackcolor);
private void btnInputBackcolor_Click(object sender, EventArgs e)
- {
- this.ShowBackColorDialog(this.lblInputBackcolor);
- }
+ => this.ShowBackColorDialog(this.lblInputBackcolor);
private void btnInputFont_Click(object sender, EventArgs e)
- {
- this.ShowFontDialog(this.lblInputFont);
- }
+ => this.ShowFontDialog(this.lblInputFont);
}
}
public partial class GetCountPanel : SettingPanelBase
{
public GetCountPanel()
- {
- InitializeComponent();
- }
+ => this.InitializeComponent();
public void LoadConfig(SettingCommon settingCommon)
{
public event EventHandler<IntervalChangedEventArgs> IntervalChanged;
public GetPeriodPanel()
- {
- InitializeComponent();
- }
+ => this.InitializeComponent();
public void LoadConfig(SettingCommon settingCommon)
{
public partial class NotifyPanel : SettingPanelBase
{
public NotifyPanel()
- {
- InitializeComponent();
- }
+ => this.InitializeComponent();
public void LoadConfig(SettingCommon settingCommon)
{
public partial class PreviewPanel : SettingPanelBase
{
public PreviewPanel()
- {
- InitializeComponent();
- }
+ => this.InitializeComponent();
public void LoadConfig(SettingCommon settingCommon)
{
public partial class ProxyPanel : SettingPanelBase
{
public ProxyPanel()
- {
- InitializeComponent();
- }
+ => this.InitializeComponent();
public void LoadConfig(SettingLocal settingLocal)
{
public partial class SettingPanelBase : UserControl
{
public SettingPanelBase()
- {
- InitializeComponent();
- }
+ => this.InitializeComponent();
protected void ShowFontDialog(Label targetLabel)
{
public partial class ShortUrlPanel : SettingPanelBase
{
public ShortUrlPanel()
- {
- InitializeComponent();
- }
+ => this.InitializeComponent();
public void LoadConfig(SettingCommon settingCommon)
{
}
private void CheckAutoConvertUrl_CheckedChanged(object sender, EventArgs e)
- {
- ShortenTcoCheck.Enabled = CheckAutoConvertUrl.Checked;
- }
+ => ShortenTcoCheck.Enabled = CheckAutoConvertUrl.Checked;
private void ButtonBitlyAuthorize_Click(object sender, EventArgs e)
{
public partial class StartupPanel : SettingPanelBase
{
public StartupPanel()
- {
- InitializeComponent();
- }
+ => this.InitializeComponent();
public void LoadConfig(SettingCommon settingCommon)
{
public partial class TweetActPanel : SettingPanelBase
{
public TweetActPanel()
- {
- InitializeComponent();
- }
+ => this.InitializeComponent();
public void LoadConfig(SettingCommon settingCommon, SettingLocal settingLocal)
{
public partial class TweetPrvPanel : SettingPanelBase
{
public TweetPrvPanel()
- {
- InitializeComponent();
- }
+ => this.InitializeComponent();
public void LoadConfig(SettingCommon settingCommon)
{
}
private void CmbDateTimeFormat_TextUpdate(object sender, EventArgs e)
- {
- CreateDateTimeFormatSample();
- }
+ => this.CreateDateTimeFormatSample();
private void CmbDateTimeFormat_SelectedIndexChanged(object sender, EventArgs e)
- {
- CreateDateTimeFormatSample();
- }
+ => this.CreateDateTimeFormatSample();
private void CmbDateTimeFormat_Validating(object sender, CancelEventArgs e)
{
}
private void LabelDateTimeFormatApplied_VisibleChanged(object sender, EventArgs e)
- {
- CreateDateTimeFormatSample();
- }
+ => this.CreateDateTimeFormatSample();
}
}
}
public void Save()
- {
- SaveSettings(this);
- }
+ => SaveSettings(this);
public SettingAtIdList()
- {
- AtIdList = new List<String>();
- }
+ => this.AtIdList = new List<String>();
public SettingAtIdList(List<string> ids)
- {
- this.AtIdList = ids;
- }
+ => this.AtIdList = ids;
#endregion
public List<string> AtIdList;
}
protected static T LoadSettings()
- {
- return LoadSettings("");
- }
+ => LoadSettings("");
protected static void SaveSettings(T instance, string fileId)
{
}
protected static void SaveSettings(T Instance)
- {
- SaveSettings(Instance, "");
- }
+ => SaveSettings(Instance, "");
public static string GetSettingFilePath(string FileId)
- {
- return Path.Combine(MyCommon.settingPath, typeof(T).Name + FileId + ".xml");
- }
+ => Path.Combine(MyCommon.settingPath, typeof(T).Name + FileId + ".xml");
}
}
{
#region "Settingクラス基本"
public static SettingCommon Load()
- {
- return LoadSettings();
- }
+ => LoadSettings();
public void Save()
- {
- SaveSettings(this);
- }
+ => SaveSettings(this);
#endregion
public List<UserAccount> UserAccounts;
}
return password;
}
+
public override string ToString()
- {
- return this.Username;
- }
+ => this.Username;
}
}
\ No newline at end of file
{
public class SettingLocal : SettingBase<SettingLocal>, IDisposable
{
-#region Settingクラス基本
+ #region Settingクラス基本
public static SettingLocal Load()
- {
- return LoadSettings();
- }
+ => LoadSettings();
public void Save()
- {
- SaveSettings(this);
- }
-#endregion
+ => SaveSettings(this);
+ #endregion
/// <summary>
/// ウィンドウサイズ等の保存時のDPI
private FontConverter fontConverter = new FontConverter();
protected string FontToString(Font font)
- {
- return font != null ? this.fontConverter.ConvertToString(font) : null;
- }
+ => font != null ? this.fontConverter.ConvertToString(font) : null;
protected Font StringToFont(string str)
- {
- return str != null ? (Font)this.fontConverter.ConvertFromString(str) : null;
- }
+ => str != null ? (Font)this.fontConverter.ConvertFromString(str) : null;
[XmlIgnore]
private ColorConverter colorConverter = new ColorConverter();
protected string ColorToString(Color color)
- {
- return this.colorConverter.ConvertToString(color);
- }
+ => this.colorConverter.ConvertToString(color);
protected Color StringToColor(string str)
- {
- return (Color)this.colorConverter.ConvertFromString(str);
- }
+ => (Color)this.colorConverter.ConvertFromString(str);
/// <summary>
/// 指定されたスケールと SettingLocal.ScaleDimension のスケールとの拡大比を返します
{
#region Settingクラス基本
public static SettingTabs Load()
- {
- SettingTabs setting = LoadSettings("");
- return setting;
- }
+ => LoadSettings("");
public void Save()
- {
- SaveSettings(this);
- }
+ => SaveSettings(this);
public SettingTabs()
- {
- Tabs = new List<SettingTabItem>();
- }
+ => this.Tabs = new List<SettingTabItem>();
#endregion
public List<SettingTabItem> Tabs;
/// ShortUrl のインスタンスを取得します
/// </summary>
public static ShortUrl Instance
- {
- get { return _instance.Value; }
- }
+ => _instance.Value;
/// <summary>
/// 短縮 URL の展開を無効にするか否か
};
static ShortUrl()
- {
- _instance = new Lazy<ShortUrl>(() => new ShortUrl(), true);
- }
+ => _instance = new Lazy<ShortUrl>(() => new ShortUrl(), true);
[SuppressMessage("Microsoft.Reliability", "CA2000:DisposeObjectsBeforeLosingScope")]
internal ShortUrl()
/// <param name="uri">展開するURL</param>
/// <returns>URLの展開を行うタスク</returns>
public Task<Uri> ExpandUrlAsync(Uri uri)
- {
- return this.ExpandUrlAsync(uri, 10);
- }
+ => this.ExpandUrlAsync(uri, 10);
/// <summary>
/// 短縮 URL を非同期に展開します
/// <param name="uriStr">展開するURL</param>
/// <returns>URLの展開を行うタスク</returns>
public Task<string> ExpandUrlAsync(string uriStr)
- {
- return this.ExpandUrlAsync(uriStr, 10);
- }
+ => this.ExpandUrlAsync(uriStr, 10);
/// <summary>
/// 短縮 URL を非同期に展開します
[Obsolete]
public string ExpandUrlHtml(string html)
- {
- return this.ExpandUrlHtmlAsync(html, 10).Result;
- }
+ => this.ExpandUrlHtmlAsync(html, 10).Result;
/// <summary>
/// HTML内に含まれるリンクのURLを非同期に展開する
/// <param name="html">処理対象のHTML</param>
/// <returns>URLの展開を行うタスク</returns>
public Task<string> ExpandUrlHtmlAsync(string html)
- {
- return this.ExpandUrlHtmlAsync(html, 10);
- }
+ => this.ExpandUrlHtmlAsync(html, 10);
/// <summary>
/// HTML内に含まれるリンクのURLを非同期に展開する
/// コマンドを実行します
/// </summary>
public async Task RunCommand()
- {
- await this.command();
- }
+ => await this.command();
/// <summary>
/// 新規に ShortcutCommand インスタンスを作成するビルダーを返します
/// </summary>
public static ShortcutCommand.Builder Create(params Keys[] shortcuts)
- {
- return new Builder().Keys(shortcuts);
- }
+ => new Builder().Keys(shortcuts);
public class Builder
{
private readonly ShortcutCommand instance;
internal Builder()
- {
- this.instance = new ShortcutCommand();
- }
+ => this.instance = new ShortcutCommand();
/// <summary>
/// 指定されたキーが入力された時にショートカットを発動します
/// ショートカットが入力された時に行う動作の内容
/// </summary>
public ShortcutCommand Do(Action action, bool preventDefault = true)
- {
- return this.Do(SynchronousTask(action), preventDefault);
- }
+ => this.Do(SynchronousTask(action), preventDefault);
/// <summary>
/// ショートカットが入力された時に行う動作の内容
/// Action を Func<Task> に変換します
/// </summary>
private static Func<Task> SynchronousTask(Action action)
- {
- return () => { action(); return noOpTask; };
- }
+ => () => { action(); return noOpTask; };
}
}
}
public string Label { get; set; }
public override string ToString()
- {
- return this.Label;
- }
+ => this.Label;
}
public TabsDialog(TabInformations tabinformation)
=> this.TabList.SelectedItem is TabListItem item ? item.Tab : null;
public TabModel[] SelectedTabs
- {
- get
- {
- return this.TabList.SelectedItems
+ => this.TabList.SelectedItems
.Cast<TabListItem>()
.Select(x => x.Tab)
.ToArray();
- }
- }
}
}
public static readonly string ApiBase = "https://api.foursquare.com/v2";
protected HttpClient http
- {
- get { return this.localHttpClient ?? Networking.Http; }
- }
+ => this.localHttpClient ?? Networking.Http;
+
private readonly HttpClient localHttpClient;
public FoursquareCheckin()
}
public FoursquareCheckin(HttpClient http)
- {
- this.localHttpClient = http;
- }
+ => this.localHttpClient = http;
public override async Task<ThumbnailInfo> GetThumbnailInfoAsync(string url, PostClass post, CancellationToken token)
{
protected Timer UpdateTimer;
protected HttpClient http
- {
- get { return this.localHttpClient ?? Networking.Http; }
- }
+ => this.localHttpClient ?? Networking.Http;
+
private readonly HttpClient localHttpClient;
private object LockObj = new object();
public bool AutoUpdate
{
- get { return this._AutoUpdate; }
+ get => this._AutoUpdate;
set
{
if (value)
public bool DisabledInDM { get; set; }
protected void StartAutoUpdate()
- {
- this.UpdateTimer.Change(0, 30 * 60 * 1000); // 30分おきに更新
- }
+ => this.UpdateTimer.Change(0, 30 * 60 * 1000); // 30分おきに更新
protected void StopAutoUpdate()
- {
- this.UpdateTimer.Change(Timeout.Infinite, Timeout.Infinite);
- }
+ => this.UpdateTimer.Change(Timeout.Infinite, Timeout.Infinite);
public async Task LoadRegexAsync()
{
}
public virtual void Dispose()
- {
- this.UpdateTimer.Dispose();
- }
+ => this.UpdateTimer.Dispose();
}
}
protected static string[] PropertyNames = { "og:image", "twitter:image", "twitter:image:src" };
protected HttpClient http
- {
- get { return this.localHttpClient ?? Networking.Http; }
- }
+ => this.localHttpClient ?? Networking.Http;
+
private readonly HttpClient localHttpClient;
protected readonly Regex regex;
}
protected string ReplaceUrl(string url)
- {
- return ReplaceUrl(url, this.thumb_replacement);
- }
+ => this.ReplaceUrl(url, this.thumb_replacement);
protected string ReplaceUrl(string url, string replacement)
{
new Regex(@"^https?://www\.tinami\.com/view/(?<ContentId>\d+)$");
protected HttpClient http
- {
- get { return this.localHttpClient ?? Networking.Http; }
- }
+ => this.localHttpClient ?? Networking.Http;
+
private readonly HttpClient localHttpClient;
public Tinami()
}
public Tinami(HttpClient http)
- {
- this.localHttpClient = http;
- }
+ => this.localHttpClient = http;
public override async Task<ThumbnailInfo> GetThumbnailInfoAsync(string url, PostClass post, CancellationToken token)
{
new Regex(@"^https?://(?<host>[^.]+\.tumblr\.com|tumblr\.[^.]+\.[^.]+)/post/(?<postId>[0-9]+)(/.*)?");
protected HttpClient http
- {
- get { return this.localHttpClient ?? Networking.Http; }
- }
+ => this.localHttpClient ?? Networking.Http;
+
private readonly HttpClient localHttpClient;
public Tumblr()
}
public Tumblr(HttpClient http)
- {
- this.localHttpClient = http;
- }
+ => this.localHttpClient = http;
public override async Task<ThumbnailInfo> GetThumbnailInfoAsync(string url, PostClass post, CancellationToken token)
{
new Regex(@"^https?://via\.me/-(\w+)$");
protected HttpClient http
- {
- get { return this.localHttpClient ?? Networking.Http; }
- }
+ => this.localHttpClient ?? Networking.Http;
+
private readonly HttpClient localHttpClient;
public ViaMe()
}
public ViaMe(HttpClient http)
- {
- this.localHttpClient = http;
- }
+ => this.localHttpClient = http;
public override async Task<ThumbnailInfo> GetThumbnailInfoAsync(string url, PostClass post, CancellationToken token)
{
new Regex(@"https?://vimeo\.com/(?<postID>[0-9]+)");
protected HttpClient http
- {
- get { return this.localHttpClient ?? Networking.Http; }
- }
+ => this.localHttpClient ?? Networking.Http;
+
private readonly HttpClient localHttpClient;
public Vimeo()
}
public Vimeo(HttpClient http)
- {
- this.localHttpClient = http;
- }
+ => this.localHttpClient = http;
public override async Task<ThumbnailInfo> GetThumbnailInfoAsync(string url, PostClass post, CancellationToken token)
{
internal static ImgAzyobuziNet ImgAzyobuziNetInstance { get; private set; }
static ThumbnailGenerator()
- {
- ThumbnailGenerator.Services = new List<IThumbnailService>();
- }
+ => ThumbnailGenerator.Services = new List<IThumbnailService>();
public static void InitializeGenerator()
{
public bool IsPlayable { get; set; }
public Task<MemoryImage> LoadThumbnailImageAsync()
- {
- return this.LoadThumbnailImageAsync(CancellationToken.None);
- }
+ => this.LoadThumbnailImageAsync(CancellationToken.None);
public Task<MemoryImage> LoadThumbnailImageAsync(CancellationToken cancellationToken)
- {
- return this.LoadThumbnailImageAsync(Networking.Http, cancellationToken);
- }
+ => this.LoadThumbnailImageAsync(Networking.Http, cancellationToken);
public async virtual Task<MemoryImage> LoadThumbnailImageAsync(HttpClient http, CancellationToken cancellationToken)
{
}
public override bool Equals(object obj)
- {
- return this.Equals(obj as ThumbnailInfo);
- }
+ => this.Equals(obj as ThumbnailInfo);
public bool Equals(ThumbnailInfo other)
{
}
public override int GetHashCode()
- {
- return this.MediaPageUrl.GetHashCode() ^ this.ThumbnailImageUrl.GetHashCode();
- }
+ => this.MediaPageUrl.GetHashCode() ^ this.ThumbnailImageUrl.GetHashCode();
}
}
[RefreshProperties(RefreshProperties.Repaint)]
public int GaugeHeight
{
- get { return this._GaugeHeight; }
+ get => this._GaugeHeight;
set
{
this._GaugeHeight = value;
[Browsable(false)]
public ApiLimit ApiLimit
{
- get { return this._ApiLimit; }
+ get => this._ApiLimit;
private set
{
this._ApiLimit = value;
[Browsable(false)]
public string ApiEndpoint
{
- get { return this._ApiEndpoint; }
+ get => this._ApiEndpoint;
set
{
if (string.IsNullOrEmpty(value))
}
public override string ToString()
- {
- return Timestamp.ToLocalTime().ToString("T") + ": " + Summary;
- }
+ => Timestamp.ToLocalTime().ToString("T") + ": " + Summary;
}
LinkedList<LogEntry> _logs;
public override string Text
{
- get { return base.Text; }
+ get => base.Text;
set
{
_logs.AddLast(new LogEntry(DateTimeUtc.Now, value));
}
public ToolStripLabelHistory()
- {
- _logs = new LinkedList<LogEntry>();
- }
+ => this._logs = new LinkedList<LogEntry>();
}
}
}
private async void FavAddToolStripMenuItem_Click(object sender, EventArgs e)
- {
- await this.FavoriteChange(true);
- }
+ => await this.FavoriteChange(true);
private async void FavRemoveToolStripMenuItem_Click(object sender, EventArgs e)
- {
- await this.FavoriteChange(false);
- }
+ => await this.FavoriteChange(false);
private async void FavoriteRetweetMenuItem_Click(object sender, EventArgs e)
- {
- await this.FavoritesRetweetOfficial();
- }
+ => await this.FavoritesRetweetOfficial();
private async void FavoriteRetweetUnofficialMenuItem_Click(object sender, EventArgs e)
- {
- await this.FavoritesRetweetUnofficial();
- }
+ => await this.FavoritesRetweetUnofficial();
private async Task FavoriteChange(bool FavAdd, bool multiFavoriteChangeDialogEnable = true)
{
}
private void ReplyStripMenuItem_Click(object sender, EventArgs e)
- {
- MakeReplyOrDirectStatus(false, true);
- }
+ => this.MakeReplyOrDirectStatus(false, true);
private void DMStripMenuItem_Click(object sender, EventArgs e)
- {
- MakeReplyOrDirectStatus(false, false);
- }
+ => this.MakeReplyOrDirectStatus(false, false);
private async Task doStatusDelete()
{
}
private async void DeleteStripMenuItem_Click(object sender, EventArgs e)
- {
- await this.doStatusDelete();
- }
+ => await this.doStatusDelete();
private void ReadedStripMenuItem_Click(object sender, EventArgs e)
{
}
private async void RefreshStripMenuItem_Click(object sender, EventArgs e)
- {
- await this.DoRefresh();
- }
+ => await this.DoRefresh();
private async Task DoRefresh()
{
}
public void ShowSuplDialog(TextBox owner, AtIdSupplement dialog)
- {
- ShowSuplDialog(owner, dialog, 0, "");
- }
+ => this.ShowSuplDialog(owner, dialog, 0, "");
public void ShowSuplDialog(TextBox owner, AtIdSupplement dialog, int offset)
- {
- ShowSuplDialog(owner, dialog, offset, "");
- }
+ => this.ShowSuplDialog(owner, dialog, offset, "");
public void ShowSuplDialog(TextBox owner, AtIdSupplement dialog, int offset, string startswith)
{
/// DetailsListView のための ListViewItem のキャッシュを消去する
/// </summary>
private void PurgeListViewItemCache()
- {
- Interlocked.Exchange(ref this._listItemCache, null);
- }
+ => Interlocked.Exchange(ref this._listItemCache, null);
private ListViewItem CreateItem(TabPage Tab, PostClass Post, int Index)
{
}
private void MyList_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
- {
- e.DrawDefault = true;
- }
+ => e.DrawDefault = true;
private void MyList_HScrolled(object sender, EventArgs e)
- {
- DetailsListView listView = (DetailsListView)sender;
- listView.Refresh();
- }
+ => ((DetailsListView)sender).Refresh();
private void MyList_DrawItem(object sender, DrawListViewItemEventArgs e)
{
}
private void MenuItemSubSearch_Click(object sender, EventArgs e)
- {
- // 検索メニュー
- this.ShowSearchDialog();
- }
+ => this.ShowSearchDialog(); // 検索メニュー
private void MenuItemSearchNext_Click(object sender, EventArgs e)
{
}
private async void VerUpMenuItem_Click(object sender, EventArgs e)
- {
- await this.CheckNewVersion(false);
- }
+ => await this.CheckNewVersion(false);
private void RunTweenUp()
{
}
private Task DispSelectedPost()
- {
- return this.DispSelectedPost(false);
- }
+ => this.DispSelectedPost(false);
private PostClass displayPost = new PostClass();
}
private async void MatomeMenuItem_Click(object sender, EventArgs e)
- {
- await this.OpenApplicationWebsite();
- }
+ => await this.OpenApplicationWebsite();
private async Task OpenApplicationWebsite()
- {
- await this.OpenUriInBrowserAsync(ApplicationSettings.WebsiteUrl);
- }
+ => await this.OpenUriInBrowserAsync(ApplicationSettings.WebsiteUrl);
private async void ShortcutKeyListMenuItem_Click(object sender, EventArgs e)
- {
- await this.OpenUriInBrowserAsync(ApplicationSettings.ShortcutKeyUrl);
- }
+ => await this.OpenUriInBrowserAsync(ApplicationSettings.ShortcutKeyUrl);
private async void ListTab_KeyDown(object sender, KeyEventArgs e)
{
}
private void MyList_MouseClick(object sender, MouseEventArgs e)
- {
- _anchorFlag = false;
- }
+ => this._anchorFlag = false;
private void StatusText_Enter(object sender, EventArgs e)
{
}
private void ListTab_DoubleClick(object sender, MouseEventArgs e)
- {
- TabRename(this.ListTab.SelectedTab.Text, out var _);
- }
+ => this.TabRename(this.ListTab.SelectedTab.Text, out var _);
private void ListTab_MouseDown(object sender, MouseEventArgs e)
{
}
private void ListTab_MouseUp(object sender, MouseEventArgs e)
- {
- _tabDrag = false;
- }
+ => this._tabDrag = false;
private static int iconCnt = 0;
private static int blinkCnt = 0;
}
private async void TimerRefreshIcon_Tick(object sender, EventArgs e)
- {
- //200ms
- await this.RefreshTasktrayIcon();
- }
+ => await this.RefreshTasktrayIcon(); // 200ms
private void ContextMenuTabProperty_Opening(object sender, CancelEventArgs e)
{
}
private void ReplyAllStripMenuItem_Click(object sender, EventArgs e)
- {
- MakeReplyOrDirectStatus(false, true, true);
- }
+ => this.MakeReplyOrDirectStatus(false, true, true);
private void IDRuleMenuItem_Click(object sender, EventArgs e)
{
mark = false;
}
}
+
private void CopySTOTMenuItem_Click(object sender, EventArgs e)
- {
- this.CopyStot();
- }
+ => this.CopyStot();
private void CopyURLMenuItem_Click(object sender, EventArgs e)
- {
- this.CopyIdUri();
- }
+ => this.CopyIdUri();
private void SelectAllMenuItem_Click(object sender, EventArgs e)
{
}
private void SetStatusLabelUrl()
- {
- StatusLabelUrl.Text = GetStatusLabelText();
- }
+ => this.StatusLabelUrl.Text = this.GetStatusLabelText();
public void SetStatusLabel(string text)
- {
- StatusLabel.Text = text;
- }
+ => this.StatusLabel.Text = text;
private void SetNotifyIconText()
{
}
private async void RepliedStatusOpenMenuItem_Click(object sender, EventArgs e)
- {
- await this.doRepliedStatusOpen();
- }
+ => await this.doRepliedStatusOpen();
private void SplitContainer2_Panel2_Resize(object sender, EventArgs e)
{
}
private async void TinyURLToolStripMenuItem_Click(object sender, EventArgs e)
- {
- await UrlConvertAsync(MyCommon.UrlConverter.TinyUrl);
- }
+ => await this.UrlConvertAsync(MyCommon.UrlConverter.TinyUrl);
private async void IsgdToolStripMenuItem_Click(object sender, EventArgs e)
- {
- await UrlConvertAsync(MyCommon.UrlConverter.Isgd);
- }
+ => await this.UrlConvertAsync(MyCommon.UrlConverter.Isgd);
private async void TwurlnlToolStripMenuItem_Click(object sender, EventArgs e)
- {
- await UrlConvertAsync(MyCommon.UrlConverter.Twurl);
- }
+ => await this.UrlConvertAsync(MyCommon.UrlConverter.Twurl);
private async void UxnuMenuItem_Click(object sender, EventArgs e)
- {
- await UrlConvertAsync(MyCommon.UrlConverter.Uxnu);
- }
+ => await this.UrlConvertAsync(MyCommon.UrlConverter.Uxnu);
private async void UrlConvertAutoToolStripMenuItem_Click(object sender, EventArgs e)
{
}
private void UrlUndoToolStripMenuItem_Click(object sender, EventArgs e)
- {
- doUrlUndo();
- }
+ => this.doUrlUndo();
private void NewPostPopMenuItem_CheckStateChanged(object sender, EventArgs e)
{
}
private void ListTab_Selecting(object sender, TabControlCancelEventArgs e)
- {
- ListTabSelect(e.TabPage);
- }
+ => this.ListTabSelect(e.TabPage);
private void SelectListItem(DetailsListView LView, int Index)
{
}
private async void GetFollowersAllToolStripMenuItem_Click(object sender, EventArgs e)
- {
- await this.doGetFollowersMenu();
- }
+ => await this.doGetFollowersMenu();
private void ReTweetUnofficialStripMenuItem_Click(object sender, EventArgs e)
- {
- doReTweetUnofficial();
- }
+ => this.doReTweetUnofficial();
private async Task doReTweetOfficial(bool isConfirm)
{
}
private async void ReTweetStripMenuItem_Click(object sender, EventArgs e)
- {
- await this.doReTweetOfficial(true);
- }
+ => await this.doReTweetOfficial(true);
private async Task FavoritesRetweetOfficial()
{
}
private void UrlMultibyteSplitMenuItem_CheckedChanged(object sender, EventArgs e)
- {
- this.urlMultibyteSplit = ((ToolStripMenuItem)sender).Checked;
- }
+ => this.urlMultibyteSplit = ((ToolStripMenuItem)sender).Checked;
private void PreventSmsCommandMenuItem_CheckedChanged(object sender, EventArgs e)
- {
- this.preventSmsCommand = ((ToolStripMenuItem)sender).Checked;
- }
+ => this.preventSmsCommand = ((ToolStripMenuItem)sender).Checked;
private void UrlAutoShortenMenuItem_CheckedChanged(object sender, EventArgs e)
- {
- SettingManager.Common.UrlConvertAuto = ((ToolStripMenuItem)sender).Checked;
- }
+ => SettingManager.Common.UrlConvertAuto = ((ToolStripMenuItem)sender).Checked;
private void IdeographicSpaceToSpaceMenuItem_Click(object sender, EventArgs e)
{
}
private void TweenMain_Deactivate(object sender, EventArgs e)
- {
- //画面が非アクティブになったら、発言欄の背景色をデフォルトへ
- this.StatusText_Leave(StatusText, System.EventArgs.Empty);
- }
+ => this.StatusText_Leave(StatusText, EventArgs.Empty); // 画面が非アクティブになったら、発言欄の背景色をデフォルトへ
private void TabRenameMenuItem_Click(object sender, EventArgs e)
{
}
private async void BitlyToolStripMenuItem_Click(object sender, EventArgs e)
- {
- await UrlConvertAsync(MyCommon.UrlConverter.Bitly);
- }
+ => await this.UrlConvertAsync(MyCommon.UrlConverter.Bitly);
private async void JmpToolStripMenuItem_Click(object sender, EventArgs e)
- {
- await UrlConvertAsync(MyCommon.UrlConverter.Jmp);
- }
+ => await this.UrlConvertAsync(MyCommon.UrlConverter.Jmp);
private async void ApiUsageInfoMenuItem_Click(object sender, EventArgs e)
{
}
private async void OwnStatusMenuItem_Click(object sender, EventArgs e)
- {
- await this.doShowUserStatus(tw.Username, false);
- //if (!string.IsNullOrEmpty(tw.UserInfoXml))
- //{
- // doShowUserStatus(tw.Username, false);
- //}
- //else
- //{
- // MessageBox.Show(Properties.Resources.ShowYourProfileText1, "Your status", MessageBoxButtons.OK, MessageBoxIcon.Information);
- // return;
- //}
- }
+ => await this.doShowUserStatus(tw.Username, false);
// TwitterIDでない固定文字列を調べる(文字列検証のみ 実際に取得はしない)
// URLから切り出した文字列を渡す
}
}
- private void QuoteStripMenuItem_Click(object sender, EventArgs e) // Handles QuoteStripMenuItem.Click, QtOpMenuItem.Click
- {
- doQuoteOfficial();
- }
+ private void QuoteStripMenuItem_Click(object sender, EventArgs e)
+ => this.doQuoteOfficial();
private async void SearchButton_Click(object sender, EventArgs e)
{
}
private async void RefreshMoreStripMenuItem_Click(object sender, EventArgs e)
- {
- //もっと前を取得
- await this.DoRefreshMore();
- }
+ => await this.DoRefreshMore(); // もっと前を取得
/// <summary>
/// 指定されたタブのListTabにおける位置を返します
}
private async void MoveToRTHomeMenuItem_Click(object sender, EventArgs e)
- {
- await this.doMoveToRTHome();
- }
+ => await this.doMoveToRTHome();
private void ListManageUserContextToolStripMenuItem_Click(object sender, EventArgs e)
{
}
private void StatusLabel_DoubleClick(object sender, EventArgs e)
- {
- MessageBox.Show(StatusLabel.TextHistory, "Logs", MessageBoxButtons.OK, MessageBoxIcon.None);
- }
+ => MessageBox.Show(StatusLabel.TextHistory, "Logs", MessageBoxButtons.OK, MessageBoxIcon.None);
private void HashManageMenuItem_Click(object sender, EventArgs e)
{
}
private void HashStripSplitButton_ButtonClick(object sender, EventArgs e)
- {
- HashToggleMenuItem_Click(null, null);
- }
+ => this.HashToggleMenuItem_Click(null, null);
public void SetPermanentHashtag(string hashtag)
{
}
private void MenuItemTab_DropDownOpening(object sender, EventArgs e)
- {
- ContextMenuTabProperty_Opening(sender, null);
- }
+ => this.ContextMenuTabProperty_Opening(sender, null);
public Twitter TwitterInstance
- {
- get { return tw; }
- }
+ => this.tw;
private void SplitContainer3_SplitterMoved(object sender, SplitterEventArgs e)
{
}
private void NotifyIcon1_MouseMove(object sender, MouseEventArgs e)
- {
- SetNotifyIconText();
- }
+ => this.SetNotifyIconText();
private async void UserStatusToolStripMenuItem_Click(object sender, EventArgs e)
- {
- var id = _curPost?.ScreenName ?? "";
-
- await this.ShowUserStatus(id);
- }
+ => await this.ShowUserStatus(this._curPost?.ScreenName ?? "");
private async Task doShowUserStatus(string id, bool ShowInputDialog)
{
}
internal Task ShowUserStatus(string id, bool ShowInputDialog)
- {
- return this.doShowUserStatus(id, ShowInputDialog);
- }
+ => this.doShowUserStatus(id, ShowInputDialog);
internal Task ShowUserStatus(string id)
- {
- return this.doShowUserStatus(id, true);
- }
+ => this.doShowUserStatus(id, true);
private async void ShowProfileMenuItem_Click(object sender, EventArgs e)
{
}
private void SplitContainer2_MouseDoubleClick(object sender, MouseEventArgs e)
- {
- this.MultiLinePullDownMenuItem.PerformClick();
- }
+ => this.MultiLinePullDownMenuItem.PerformClick();
public PostClass CurPost
- {
- get { return _curPost; }
- }
+ => this._curPost;
#region "画像投稿"
private void ImageSelectMenuItem_Click(object sender, EventArgs e)
}
private void ImageSelector_FilePickDialogOpening(object sender, EventArgs e)
- {
- this.AllowDrop = false;
- }
+ => this.AllowDrop = false;
private void ImageSelector_FilePickDialogClosed(object sender, EventArgs e)
- {
- this.AllowDrop = true;
- }
+ => this.AllowDrop = true;
private void ImageSelector_SelectedServiceChanged(object sender, EventArgs e)
{
}
private void ImageSelector_VisibleChanged(object sender, EventArgs e)
- {
- this.StatusText_TextChanged(null, null);
- }
+ => this.StatusText_TextChanged(null, null);
/// <summary>
/// StatusTextでCtrl+Vが押下された時の処理
}
private void CopyUserIdStripMenuItem_Click(object sender, EventArgs e)
- {
- CopyUserId();
- }
+ => this.CopyUserId();
private void CopyUserId()
{
}
private void tw_UserIdChanged()
- {
- this.ModifySettingCommon = true;
- }
+ => this.ModifySettingCommon = true;
#region "Userstream"
private async void tw_PostDeleted(object sender, PostDeletedEventArgs e)
}
private async void OpenOwnHomeMenuItem_Click(object sender, EventArgs e)
- {
- await this.OpenUriInBrowserAsync(MyCommon.TwitterUrl + tw.Username);
- }
+ => await this.OpenUriInBrowserAsync(MyCommon.TwitterUrl + tw.Username);
private bool ExistCurrentPost
{
}
private void StopRefreshAllMenuItem_CheckedChanged(object sender, EventArgs e)
- {
- TimelineRefreshEnableChange(!StopRefreshAllMenuItem.Checked);
- }
+ => this.TimelineRefreshEnableChange(!StopRefreshAllMenuItem.Checked);
private async Task OpenUserAppointUrl()
{
}
private async void OpenUserSpecifiedUrlMenuItem_Click(object sender, EventArgs e)
- {
- await this.OpenUserAppointUrl();
- }
+ => await this.OpenUserAppointUrl();
private async void GrowlHelper_Callback(object sender, GrowlHelper.NotifyCallbackEventArgs e)
{
}
private void tweetThumbnail1_ThumbnailLoading(object sender, EventArgs e)
- {
- this.SplitContainer3.Panel2Collapsed = false;
- }
+ => this.SplitContainer3.Panel2Collapsed = false;
private async void tweetThumbnail1_ThumbnailDoubleClick(object sender, ThumbnailDoubleClickEventArgs e)
- {
- await this.OpenThumbnailPicture(e.Thumbnail);
- }
+ => await this.OpenThumbnailPicture(e.Thumbnail);
private async void tweetThumbnail1_ThumbnailImageSearchClick(object sender, ThumbnailImageSearchEventArgs e)
- {
- await this.OpenUriInBrowserAsync(e.ImageUrl);
- }
+ => await this.OpenUriInBrowserAsync(e.ImageUrl);
private async Task OpenThumbnailPicture(ThumbnailInfo thumbnail)
{
}
private async void TwitterApiStatusToolStripMenuItem_Click(object sender, EventArgs e)
- {
- await this.OpenUriInBrowserAsync(Twitter.ServiceAvailabilityStatusUrl);
- }
+ => await this.OpenUriInBrowserAsync(Twitter.ServiceAvailabilityStatusUrl);
private void PostButton_KeyDown(object sender, KeyEventArgs e)
{
}
private void IconSizeNoneToolStripMenuItem_Click(object sender, EventArgs e)
- {
- ChangeListViewIconSize(MyCommon.IconSizes.IconNone);
- }
+ => this.ChangeListViewIconSize(MyCommon.IconSizes.IconNone);
private void IconSize16ToolStripMenuItem_Click(object sender, EventArgs e)
- {
- ChangeListViewIconSize(MyCommon.IconSizes.Icon16);
- }
+ => this.ChangeListViewIconSize(MyCommon.IconSizes.Icon16);
private void IconSize24ToolStripMenuItem_Click(object sender, EventArgs e)
- {
- ChangeListViewIconSize(MyCommon.IconSizes.Icon24);
- }
+ => this.ChangeListViewIconSize(MyCommon.IconSizes.Icon24);
private void IconSize48ToolStripMenuItem_Click(object sender, EventArgs e)
- {
- ChangeListViewIconSize(MyCommon.IconSizes.Icon48);
- }
+ => this.ChangeListViewIconSize(MyCommon.IconSizes.Icon48);
private void IconSize48_2ToolStripMenuItem_Click(object sender, EventArgs e)
- {
- ChangeListViewIconSize(MyCommon.IconSizes.Icon48_2);
- }
+ => this.ChangeListViewIconSize(MyCommon.IconSizes.Icon48_2);
private void ChangeListViewIconSize(MyCommon.IconSizes iconSize)
{
public partial class TweenAboutBox : OTBaseForm
{
public TweenAboutBox()
- {
- InitializeComponent();
- }
+ => this.InitializeComponent();
private void TweenAboutBox_Load(object sender, EventArgs e)
{
}
private void OKButton_Click(object sender, EventArgs e)
- {
- this.Close();
- }
+ => this.Close();
private void TweenAboutBox_Shown(object sender, EventArgs e)
- {
- OKButton.Focus();
- }
+ => this.OKButton.Focus();
}
}
/// 指定されたHTMLからリンクを除去します
/// </summary>
internal static string StripLinkTagHtml(string html)
- {
- // a 要素はネストされていない前提の正規表現パターン
- return Regex.Replace(html, @"<a[^>]*>(.*?)</a>", "$1");
- }
+ => Regex.Replace(html, @"<a[^>]*>(.*?)</a>", "$1"); // a 要素はネストされていない前提の正規表現パターン
public async Task DoTranslation()
{
}
protected void RaiseStatusChanged(string statusText)
- {
- this.StatusChanged?.Invoke(this, new TweetDetailsViewStatusChengedEventArgs(statusText));
- }
+ => this.StatusChanged?.Invoke(this, new TweetDetailsViewStatusChengedEventArgs(statusText));
private void TweetDetailsView_FontChanged(object sender, EventArgs e)
{
}
private void UserPicture_MouseEnter(object sender, EventArgs e)
- {
- this.UserPicture.Cursor = Cursors.Hand;
- }
+ => this.UserPicture.Cursor = Cursors.Hand;
private void UserPicture_MouseLeave(object sender, EventArgs e)
- {
- this.UserPicture.Cursor = Cursors.Default;
- }
+ => this.UserPicture.Cursor = Cursors.Default;
private async void PostBrowser_Navigated(object sender, WebBrowserNavigatedEventArgs e)
{
}
private void SourceLinkLabel_MouseLeave(object sender, EventArgs e)
- {
- this.RaiseStatusChanged(statusText: "");
- }
+ => this.RaiseStatusChanged(statusText: "");
#endregion
}
private async void SearchGoogleContextMenuItem_Click(object sender, EventArgs e)
- {
- await this.DoSearchToolStrip(Properties.Resources.SearchItem2Url);
- }
+ => await this.DoSearchToolStrip(Properties.Resources.SearchItem2Url);
private async void SearchWikipediaContextMenuItem_Click(object sender, EventArgs e)
- {
- await this.DoSearchToolStrip(Properties.Resources.SearchItem1Url);
- }
+ => await this.DoSearchToolStrip(Properties.Resources.SearchItem1Url);
private async void SearchPublicSearchContextMenuItem_Click(object sender, EventArgs e)
- {
- await this.DoSearchToolStrip(Properties.Resources.SearchItem4Url);
- }
+ => await this.DoSearchToolStrip(Properties.Resources.SearchItem4Url);
private void CurrentTabToolStripMenuItem_Click(object sender, EventArgs e)
{
}
private void SelectionAllContextMenuItem_Click(object sender, EventArgs e)
- {
- //発言詳細ですべて選択
- PostBrowser.Document.ExecCommand("SelectAll", false, null);
- }
+ => this.PostBrowser.Document.ExecCommand("SelectAll", false, null); // 発言詳細ですべて選択
private async void FollowContextMenuItem_Click(object sender, EventArgs e)
{
}
private async void TranslationToolStripMenuItem_Click(object sender, EventArgs e)
- {
- await this.DoTranslation();
- }
+ => await this.DoTranslation();
#endregion
public string StatusText { get; }
public TweetDetailsViewStatusChengedEventArgs(string statusText)
- {
- this.StatusText = statusText;
- }
+ => this.StatusText = statusText;
}
}
/// テキストから URL を抽出して返します
/// </summary>
public static IEnumerable<string> ExtractUrls(string text)
- {
- return ExtractUrlEntities(text).Select(x => x.Url);
- }
+ => ExtractUrlEntities(text).Select(x => x.Url);
/// <summary>
/// テキストから URL を抽出してエンティティとして返します
}
private static string FormatHashtagEntity(string targetText, TwitterEntityHashtag entity)
- {
- return "<a class=\"hashtag\" href=\"https://twitter.com/search?q=%23" + eu(entity.Text) + "\">" + t(e(targetText)) + "</a>";
- }
+ => "<a class=\"hashtag\" href=\"https://twitter.com/search?q=%23" + eu(entity.Text) + "\">" + t(e(targetText)) + "</a>";
private static string FormatMentionEntity(string targetText, TwitterEntityMention entity)
- {
- return "<a class=\"mention\" href=\"https://twitter.com/" + eu(entity.ScreenName) + "\">" + t(e(targetText)) + "</a>";
- }
+ => "<a class=\"mention\" href=\"https://twitter.com/" + eu(entity.ScreenName) + "\">" + t(e(targetText)) + "</a>";
// 長いのでエイリアスとして e(...), eu(...), t(...) でエスケープできるようにする
private static Func<string, string> e = EscapeHtml;
public event EventHandler<ThumbnailImageSearchEventArgs> ThumbnailImageSearchClick;
public ThumbnailInfo Thumbnail
- {
- get { return this.pictureBox[this.scrollBar.Value].Tag as ThumbnailInfo; }
- }
+ => this.pictureBox[this.scrollBar.Value].Tag as ThumbnailInfo;
public TweetThumbnail()
- {
- InitializeComponent();
- }
+ => this.InitializeComponent();
public Task ShowThumbnailAsync(PostClass post)
- {
- return this.ShowThumbnailAsync(post, CancellationToken.None);
- }
+ => this.ShowThumbnailAsync(post, CancellationToken.None);
public async Task ShowThumbnailAsync(PostClass post, CancellationToken cancelToken)
{
}
private string GetImageSearchUriGoogle(string image_uri)
- {
- return @"https://www.google.com/searchbyimage?image_url=" + Uri.EscapeDataString(image_uri);
- }
+ => @"https://www.google.com/searchbyimage?image_url=" + Uri.EscapeDataString(image_uri);
private string GetImageSearchUriSauceNao(string imageUri)
- {
- return @"https://saucenao.com/search.php?url=" + Uri.EscapeDataString(imageUri);
- }
+ => @"https://saucenao.com/search.php?url=" + Uri.EscapeDataString(imageUri);
protected virtual Task<IEnumerable<ThumbnailInfo>> GetThumbailInfoAsync(PostClass post, CancellationToken token)
- {
- return ThumbnailGenerator.GetThumbnailsAsync(post, token);
- }
+ => ThumbnailGenerator.GetThumbnailsAsync(post, token);
/// <summary>
/// 表示するサムネイルの数を設定する
public ThumbnailInfo Thumbnail { get; }
public ThumbnailDoubleClickEventArgs(ThumbnailInfo thumbnail)
- {
- this.Thumbnail = thumbnail;
- }
+ => this.Thumbnail = thumbnail;
}
public class ThumbnailImageSearchEventArgs : EventArgs
public string ImageUrl { get; }
public ThumbnailImageSearchEventArgs(string url)
- {
- this.ImageUrl = url;
- }
+ => this.ImageUrl = url;
}
}
}
public TwitterApiAccessLevel AccessLevel
- {
- get
- {
- return MyCommon.TwitterApiInfo.AccessLevel;
- }
- }
+ => MyCommon.TwitterApiInfo.AccessLevel;
protected void ResetApiStatus()
- {
- MyCommon.TwitterApiInfo.Reset();
- }
+ => MyCommon.TwitterApiInfo.Reset();
public void ClearAuthInfo()
{
/// 渡された取得件数がWORKERTYPEに応じた取得可能範囲に収まっているか検証する
/// </summary>
public static bool VerifyApiResultCount(MyCommon.WORKERTYPE type, int count)
- {
- return count >= 20 && count <= GetMaxApiResultCount(type);
- }
+ => count >= 20 && count <= GetMaxApiResultCount(type);
/// <summary>
/// 渡された取得件数が更新時の取得可能範囲に収まっているか検証する
/// </summary>
public static bool VerifyMoreApiResultCount(int count)
- {
- return count >= 20 && count <= 200;
- }
+ => count >= 20 && count <= 200;
/// <summary>
/// 渡された取得件数が起動時の取得可能範囲に収まっているか検証する
/// </summary>
public static bool VerifyFirstApiResultCount(int count)
- {
- return count >= 20 && count <= 200;
- }
+ => count >= 20 && count <= 200;
/// <summary>
/// WORKERTYPEに応じた取得可能な最大件数を取得する
}
private PostClass CreatePostsFromStatusData(TwitterStatus status)
- {
- return CreatePostsFromStatusData(status, false);
- }
+ => this.CreatePostsFromStatusData(status, false);
private PostClass CreatePostsFromStatusData(TwitterStatus status, bool favTweet)
{
}
private void userStream_Started()
- {
- this.UserStreamStarted?.Invoke(this, EventArgs.Empty);
- }
+ => this.UserStreamStarted?.Invoke(this, EventArgs.Empty);
private void userStream_Stopped()
- {
- this.UserStreamStopped?.Invoke(this, EventArgs.Empty);
- }
+ => this.UserStreamStopped?.Invoke(this, EventArgs.Empty);
public bool UserStreamActive
=> this.userStream != null && this.userStream.IsStreamActive;
private CancellationTokenSource streamCts;
public TwitterUserstream(TwitterApi twitterApi)
- {
- this.twitterApi = twitterApi;
- }
+ => this.twitterApi = twitterApi;
public void Start(bool allAtReplies, string trackwords)
{
public long StatusId { get; }
public PostDeletedEventArgs(long statusId)
- {
- this.StatusId = statusId;
- }
+ => this.StatusId = statusId;
}
public class UserStreamEventReceivedEventArgs : EventArgs
public Twitter.FormattedEvent EventData { get; }
public UserStreamEventReceivedEventArgs(Twitter.FormattedEvent eventData)
- {
- this.EventData = eventData;
- }
+ => this.EventData = eventData;
}
}
}
private void YesButton_Click(object sender, EventArgs e)
- {
- this.Close();
- }
+ => this.Close();
private void NoButton_Click(object sender, EventArgs e)
- {
- this.Close();
- }
+ => this.Close();
private void UpdateDialog_Shown(object sender, EventArgs e)
- {
- // デフォルトではテキストが全選択されるため抑制
- this.TextDetail.SelectionLength = 0;
- }
+ => this.TextDetail.SelectionLength = 0; // デフォルトではテキストが全選択されるため抑制
}
}
public bool isFollowed = false;
public override string ToString()
- {
- return this.ScreenName + " / " + this.Name;
- }
+ => this.ScreenName + " / " + this.Name;
}
}
}
private void ShowUserInfo_Shown(object sender, EventArgs e)
- {
- ButtonClose.Focus();
- }
+ => this.ButtonClose.Focus();
private async void WebBrowser_Navigating(object sender, WebBrowserNavigatingEventArgs e)
{
}
private async void LinkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
- {
- await this.mainForm.OpenUriInBrowserAsync("https://support.twitter.com/groups/31-twitter-basics/topics/111-features/articles/268350-x8a8d-x8a3c-x6e08-x307f-x30a2-x30ab-x30a6-x30f3-x30c8-x306b-x3064-x3044-x3066");
- }
+ => await this.mainForm.OpenUriInBrowserAsync("https://support.twitter.com/groups/31-twitter-basics/topics/111-features/articles/268350-x8a8d-x8a3c-x6e08-x307f-x30a2-x30ab-x30a6-x30f3-x30c8-x306b-x3064-x3044-x3066");
private async void LinkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
- {
- await this.mainForm.OpenUriInBrowserAsync("https://support.twitter.com/groups/31-twitter-basics/topics/107-my-profile-account-settings/articles/243055-x516c-x958b-x3001-x975e-x516c-x958b-x30a2-x30ab-x30a6-x30f3-x30c8-x306b-x3064-x3044-x3066");
- }
+ => await this.mainForm.OpenUriInBrowserAsync("https://support.twitter.com/groups/31-twitter-basics/topics/107-my-profile-account-settings/articles/243055-x516c-x958b-x3001-x975e-x516c-x958b-x30a2-x30ab-x30a6-x30f3-x30c8-x306b-x3064-x3044-x3066");
private async void ButtonSearchPosts_Click(object sender, EventArgs e)
- {
- await this.mainForm.AddNewTabForUserTimeline(this._displayUser.ScreenName);
- }
+ => await this.mainForm.AddNewTabForUserTimeline(this._displayUser.ScreenName);
private async void UserPicture_Click(object sender, EventArgs e)
{
}
public Task WaitForAsync(Task task)
- {
- return this.WaitForAsync(this.ConvertTaskWithValue(task));
- }
+ => this.WaitForAsync(this.ConvertTaskWithValue(task));
public Task WaitForAsync(IWin32Window owner, Task task)
- {
- return this.WaitForAsync(owner, this.ConvertTaskWithValue(task));
- }
+ => this.WaitForAsync(owner, this.ConvertTaskWithValue(task));
public Task<T> WaitForAsync<T>(Task<T> task)
- {
- return this.WaitForAsync(null, task);
- }
+ => this.WaitForAsync(null, task);
/// <summary>
/// タスクを待機し、状況に応じて待機中ダイアログを表示します
}
int WebBrowserAPI.IInternetSecurityManager.GetSecurityId(string pwszUrl, byte[] pbSecurityId, ref uint pcbSecurityId, uint dwReserved)
- {
- return WebBrowserAPI.INET_E_DEFAULT_ACTION;
- }
+ => WebBrowserAPI.INET_E_DEFAULT_ACTION;
int WebBrowserAPI.IInternetSecurityManager.GetSecuritySite(out WebBrowserAPI.IInternetSecurityMgrSite pSite)
{
}
int WebBrowserAPI.IInternetSecurityManager.QueryCustomPolicy(string pwszUrl, ref Guid guidKey, byte ppPolicy, int pcbPolicy, byte pContext, int cbContext, int dwReserved)
- {
- return WebBrowserAPI.INET_E_DEFAULT_ACTION;
- }
+ => WebBrowserAPI.INET_E_DEFAULT_ACTION;
int WebBrowserAPI.IInternetSecurityManager.SetSecuritySite(WebBrowserAPI.IInternetSecurityMgrSite pSite)
- {
- return WebBrowserAPI.INET_E_DEFAULT_ACTION;
- }
+ => WebBrowserAPI.INET_E_DEFAULT_ACTION;
int WebBrowserAPI.IInternetSecurityManager.SetZoneMapping(int dwZone, string lpszPattern, int dwFlags)
- {
- return WebBrowserAPI.INET_E_DEFAULT_ACTION;
- }
+ => WebBrowserAPI.INET_E_DEFAULT_ACTION;
}
}