C#に投稿されたコード一覧
/// <summary> /// Streaming APIを呼び出します。 /// </summary> /// <typeparam name="T">APIからの戻り値の型</typeparam> /// <param name="apiMethod">呼び出すAPI</param>
switch (contentType) { case "application/x-www-form-urlencoded": if (parameters.Any(param => param.IsFile)) throw new ArgumentException("application/x-www-form-urlencodedでファイルを送ることはできません。");
public TResult Query<TResult>(Func<IEnumerable<User>, TResult> action) { lock (this.lockObj) { return action(EnumerableEx.Create(() => this.collection.GetEnumerator()));
private async void Button_Click(object sender, RoutedEventArgs e) { var client = new WebClient(); var html = await client.DownloadStringTaskAsync(this.Url.Text); this.Output.Text = html;
using (FileStream in = new FileStream("in.txt", FileMode.Open)) using (FileStream out = new FileStream("out.txt", FileMode.Create)) { // ...ここで処理 }
public class TrialModeTypeConverter : TypeConverter { public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) { return sourceType.Equals(typeof(String));
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) { return sourceType.Equals(typeof(String)); }
public void RefreshEntrysCache() { this.EntrysCache.Clear(); Observable.Repeat(this.CreateHatenaDiaryClient()) .Select((client, i) => client.GetEntrys(i + 1))
this.StatusId = ulong.Parse( new string( Enumerable.Range(1, id.Length) .Select(i => id[id.Length - i]) .TakeWhile(c => "0123456789".Contains(c))