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 class 参加者 | |
{ | |
private const string OriginalData = @"…略(約40人分)…"; | |
public string Name { get; set; } | |
public string ImageUrl { get; set; } | |
public static IList<参加者> Create() | |
{ | |
XName img = XName.Get("img"); |
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 void ToKatakanaButton_Click_1(object sender, RoutedEventArgs e) | |
{ | |
this.TextArea.Text = NativeMethods.StringConvertToKatakana(this.TextArea.Text); | |
} | |
private void ToHiraganaButton_Click_1(object sender, RoutedEventArgs e) | |
{ | |
this.TextArea.Text = NativeMethods.StringConvertToHiragana(this.TextArea.Text); | |
} |
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 void SaveTxtAutoButton_Click_1(object sender, RoutedEventArgs e) | |
{ | |
var thisButton = sender as Button; | |
thisButton.IsEnabled = false; | |
// "My Document" に "AutoSaved.txt" という名前で勝手に保存 | |
StorageFolder myDoc = KnownFolders.DocumentsLibrary; // ←System.UnauthorizedAccessException が発生!! | |
// Package.appxmanifest に次の設定が必要: |
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 void SaveTxtButton_Click_1(object sender, RoutedEventArgs e) | |
{ | |
var thisButton = sender as Button; | |
thisButton.IsEnabled = false; | |
// FileSavePicker を用意する | |
var picker = new FileSavePicker (); | |
picker.CommitButtonText = "テキストファイルを保存する"; | |
picker.DefaultFileExtension = ".txt"; |
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 void OpenTxtButton_Click_1(object sender, RoutedEventArgs e) | |
{ | |
var thisButton = sender as Button; | |
thisButton.IsEnabled = false; | |
// FileOpenPicker を用意する | |
var picker = new FileOpenPicker(); | |
picker.CommitButtonText = "テキストファイルを開く"; | |
picker.FileTypeFilter.Add(".txt"); // 1つは必須!! |
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 FizzBuzzModel; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
using NUnit.Framework; | |
using MS = Microsoft.VisualStudio.TestTools.UnitTesting; | |
using NU = NUnit.Framework; | |
namespace FizzBuzzModelTests | |
{ |
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
// XAML | |
<Page | |
x:Class="FizzBuzzMetro.FizzBuzzPage" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:local="using:FizzBuzzMetro" | |
xmlns:vm="using:FizzBuzzModel" | |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
mc:Ignorable="d" |
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
static void Main(string[] args) { | |
if (expr1() || expr2()) | |
Console.WriteLine("|| - short circuit"); | |
if (expr1() | expr2()) | |
Console.WriteLine("| - both evaluated"); | |
Console.ReadKey(); | |
} |
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
// 元記事 http://www.atmarkit.co.jp/fdotnet/dotnettips/579regexmatch/regexmatch.html | |
// その中の「HTMLからアンカー要素を抜き出すサンプル・プログラム」が残念だったので、いぢくってみる f(^^; | |
static void Main(string[] args) { | |
string anchor = "<a href=\"(?<url>.*?)\".*?>(?<text>.*?)</a>"; | |
// @ITのトップページを取得 | |
using (WebClient wc = new WebClient()) { | |
string html = wc.DownloadString("http://www.atmarkit.co.jp/"); |
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
// 抜き書きしたので、間違ってたらゴメン f(^^; | |
// try ~ catch も削ったし。 | |
private static async Task SaveImplAsync(UserDataRepository clonedData) | |
{ | |
//UserDataRepository clonedData; | |
//↑ここに、ユーザーごとのデータが入ってると思いねえ。 | |
// ※非同期でセーブするんだから、ナマ禁止! スナップショットをコピーしたのを使う。 | |
// Get the output stream for the SessionState file. |