using System;
using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Net;
using System.Net.Http;
private static ProxyType proxyType = ProxyType.IE;
private static IWebProxy proxy = null;
+ [SuppressMessage("Microsoft.Reliability", "CA2000:DisposeObjectsBeforeLosingScope")]
static Networking()
{
DefaultTimeout = TimeSpan.FromSeconds(20);
/// 通常は Networking.Http を使用すべきです。
/// このメソッドを使用する場合は、WebProxyChanged イベントが発生する度に HttpClient を生成し直すように実装してください。
/// </remarks>
+ [SuppressMessage("Microsoft.Reliability", "CA2000:DisposeObjectsBeforeLosingScope")]
public static HttpClient CreateHttpClient(HttpClientHandler handler)
{
if (Networking.Proxy != null)
throw new InvalidOperationException("Sequence error.(not initialized)");
}
+ [SuppressMessage("Microsoft.Reliability", "CA2000:DisposeObjectsBeforeLosingScope")]
private static void OnWebProxyChanged(EventArgs e)
{
var newClient = Networking.CreateHttpClient(new HttpClientHandler());
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
+using System.Diagnostics.CodeAnalysis;
using System.Drawing;
using System.Linq;
using System.Text;
}
}
+ [SuppressMessage("Microsoft.Reliability", "CA2000:DisposeObjectsBeforeLosingScope")]
private static IEnumerable<TabPage> CreateTabsFromUserStreamsEvent()
{
return Enum.GetNames(typeof(MyCommon.EVENTTYPE))
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Text;
+using System.Diagnostics.CodeAnalysis;
using System.Drawing;
using System.IO;
using System.Threading.Tasks;
/// <param name="stream">読み込む対象となる Stream</param>
/// <returns>作成された MemoryImage</returns>
/// <exception cref="InvalidImageException">不正な画像データが入力された場合</exception>
+ [SuppressMessage("Microsoft.Reliability", "CA2000:DisposeObjectsBeforeLosingScope")]
public static MemoryImage CopyFromStream(Stream stream)
{
var memstream = new MemoryStream();
/// <param name="bytes">読み込む対象となるバイト列</param>
/// <returns>作成された MemoryImage</returns>
/// <exception cref="InvalidImageException">不正な画像データが入力された場合</exception>
+ [SuppressMessage("Microsoft.Reliability", "CA2000:DisposeObjectsBeforeLosingScope")]
public static MemoryImage CopyFromBytes(byte[] bytes)
{
return new MemoryImage(new MemoryStream(bytes));
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Net.Http;
using System.Text;
_instance = new Lazy<ShortUrl>(() => new ShortUrl(), true);
}
+ [SuppressMessage("Microsoft.Reliability", "CA2000:DisposeObjectsBeforeLosingScope")]
internal ShortUrl()
: this(CreateDefaultHttpClient())
{
}
}
+ [SuppressMessage("Microsoft.Reliability", "CA2000:DisposeObjectsBeforeLosingScope")]
private static HttpClient CreateDefaultHttpClient()
{
var handler = new HttpClientHandler
using System;
using System.Collections.Generic;
using System.ComponentModel;
+using System.Diagnostics.CodeAnalysis;
using System.Drawing;
using System.Data;
using System.Linq;
}
}
+ [SuppressMessage("Microsoft.Reliability", "CA2000:DisposeObjectsBeforeLosingScope")]
protected virtual OTPictureBox CreatePictureBox(string name)
{
return new OTPictureBox()