This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Page | |
x:Class="App11.MainPage" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:local="using:App11" | |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
mc:Ignorable="d"> | |
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static IEnumerable<HogeCategory> CreateDummyCategories() | |
{ | |
var result = Enumerable.Range(0, 5) | |
.Select(s => new HogeItemCategory | |
{ | |
Name = string.Format("Dummy {0:00}", s), | |
Items = Enumerable.Range(1, 10) | |
.Select(t => new HogeItem | |
{ | |
ID = (10 * s) + t, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private async static void DelayTest() | |
{ | |
for (int i = 0; i < 1000; i += 10) | |
{ | |
Console.WriteLine("Delay Start! Delay Time: " + i); | |
var delay1Time = DateTime.Now; | |
await Task.Delay(i); | |
Console.WriteLine("OK Time: " + (DateTime.Now - delay1Time).TotalMilliseconds); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Net; | |
namespace ConsoleApplication3 | |
{ | |
class Program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async Task<HttpResponseMessage> SendAsync(IDictionary<string, object> parameter, AsyncOAuth.AccessToken accessToken, string footer) | |
{ | |
var client = new HttpClient(); | |
var boundary = DateTime.Now.ToString("MMddHHmmss") + new Random().Next().ToString(); | |
var content = new MultipartFormDataContent(boundary); | |
foreach (var item in parameter) | |
{ | |
if (item.Value is string) | |
{ | |
content.Add(new StringContent(item.Value as string), "\"" + this.MessageKeyName + "\""); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected async Task<IEnumerable<byte>> CreateMultipartFormData(IDictionary<string, object> parameter, string boundary) | |
{ | |
var dataBytes = new List<byte>(); | |
foreach (var p in parameter) | |
{ | |
dataBytes.AddRange(Encoding.UTF8.GetBytes("--" + boundary + "\r\n")); | |
if (p.Value is Stream) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// License: BSD | |
using System; | |
namespace LifeClock | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
int n = 80; |
NewerOlder