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 static Task<WebResponse> GetResponseAsync(WebRequest request) | |
{ | |
return Task.Run<WebResponse>(() => | |
{ | |
AutoResetEvent autoResetEvent = new AutoResetEvent(false); | |
// BeginGetResponse で autoResetEvent を発火させる | |
IAsyncResult asyncResult = request.BeginGetResponse(r => autoResetEvent.Set(), null); | |
// autoResetEvent.Set() の発火を待つ。すなわちここでブロックする |
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 IList<参加者> Create() | |
{ | |
// …前略 | |
}).ToList(); | |
int count = list.Count; | |
var rnd = new Random(); | |
for (int i = 0; i < count; i++) | |
{ | |
int src = rnd.Next(0, count); |
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 NextButton_Click_1(object sender, RoutedEventArgs e) | |
{ | |
itemListView.Background = backButton.Background; | |
var selected = itemListView.SelectedItem as Kujian.Data.SampleDataItem; | |
var dataGroup = itemListView.DataContext as Kujian.Data.SampleDataGroup; | |
dataGroup.Items.Remove(selected); | |
} |
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 Button_Click_2(object sender, RoutedEventArgs e) | |
{ | |
_isContinue = false; | |
while (!_isBreaking) | |
await Task.Delay(50); | |
itemListView.Background = new SolidColorBrush(Colors.DarkGray); | |
int remain = 5000; |
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 Button_Click_1(object sender, RoutedEventArgs e) | |
{ | |
itemListView.Background = backButton.Background; | |
Rotate(); | |
} | |
private bool _isContinue; | |
private bool _isBreaking; |
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 SampleDataSource() | |
{ | |
String ITEM_CONTENT = String.Format("Item Content: {0}\n\n{0}\n\n{0}\n\n{0}\n\n{0}\n\n{0}\n\n{0}", | |
"Curabitur class …中略…"); | |
var group1 = new SampleDataGroup("Group-1", | |
"くじ庵", //"Group Title: 1", | |
"Group Subtitle: 1", | |
"Assets/DarkGray.png", | |
"Group Description: Lorem ipsum …中略… ante a ante"); |
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 SampleDataSource() | |
{ | |
String ITEM_CONTENT = String.Format("Item Content: {0}\n\n{0}\n\n{0}\n\n{0}\n\n{0}\n\n{0}\n\n{0}", | |
"Curabitur class …中略…"); | |
var group1 = new SampleDataGroup("Group-1", | |
"Group Title: 1", | |
"Group Subtitle: 1", | |
"Assets/DarkGray.png", | |
"Group Description: Lorem ipsum …中略… ante a ante"); |
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
<Grid Grid.Column="1" x:Name="ControlGrid" > | |
<Grid.ColumnDefinitions> | |
<ColumnDefinition /> | |
<ColumnDefinition /> | |
<ColumnDefinition /> | |
</Grid.ColumnDefinitions> | |
<Button x:Name="StartButton" Content="START" Click="Button_Click_1" /> | |
<Button x:Name="StopButton" Content="STOP" Click="Button_Click_2" Grid.Column="1" /> | |
<Button x:Name="NextButton" Content="Next" Click="NextButton_Click_1" Grid.Column="2" /> |
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
<DataTemplate x:Key="DataTemplate1"> | |
<Grid Height="Auto" Margin="6" Opacity="{Binding DataContext.Content, RelativeSource={RelativeSource Mode=Self}}" > | |
<Grid.ColumnDefinitions> | |
<ColumnDefinition Width="Auto"/> | |
<ColumnDefinition Width="*"/> | |
</Grid.ColumnDefinitions> | |
<Border Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}" Width="110" Height="110" | |
VerticalAlignment="Center" > | |
<Image Source="{Binding Image}" Stretch="UniformToFill"/> | |
</Border> |
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 = | |
@"<?xml version=""1.0"" encoding=""UTF-8""?> | |
<ol> | |
<li><span><img alt=""5zj"" class=""icon"" height=""18"" src=""http://a0.twimg.com/profile_images/64048378/20081110-235006-41046300_normal.gif"" width=""18"" /><a href=""/users/46103"" class="""">5zj</a> : <em>いたって真面目なイベントです。</em></span></li> | |
…中略(約40人分)… | |
</ol>"; |