Skip to content

Commit

Permalink
Merge pull request #11 from filipeinacio/master
Browse files Browse the repository at this point in the history
Obrigado Filipe!

Bloqueado botão de sorteio quando está a decorrer um sorteio.
  • Loading branch information
brunomlopes committed Nov 25, 2014
2 parents c8050db + 5d672b8 commit 1b47017
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/SilverlightApp/Controls/TagCloud.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public class TagCloud : Canvas

public TagItem TopItem;

public event EventHandler WinnerFound;

public TagCloud()
{
Loaded += TagCloud_Loaded;
Expand Down Expand Up @@ -87,6 +89,7 @@ void CompositionTarget_Rendering(object sender, EventArgs e)
if (TopItem != null)
{
TopItem.SetAsWinner();
WinnerFound(null, null);
}
}
}
Expand Down
8 changes: 8 additions & 0 deletions src/SilverlightApp/Controls/TagRandomizer.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public TagRandomizer(IEnumerable<string> memberInput)

_timer = new DispatcherTimer();
_timer.Tick += Timer_Tick;
Cloud.WinnerFound += Cloud_WinnerFound;
}
#endregion

Expand Down Expand Up @@ -58,6 +59,8 @@ private void Timer_Tick(object sender, EventArgs e)

private void Go_Click(object sender, RoutedEventArgs e)
{
Go.IsEnabled = false;

var selectedTag = Cloud.TopItem;
if (selectedTag != null)
{
Expand All @@ -67,6 +70,11 @@ private void Go_Click(object sender, RoutedEventArgs e)
Cloud.SetTags(_members.ToArray());
RandomMembers();
}

private void Cloud_WinnerFound(object sender, EventArgs e)
{
Go.IsEnabled = true;
}
#endregion
}
}

0 comments on commit 1b47017

Please sign in to comment.