private void EnableSnapshot_Executed(object sender, ExecutedRoutedEventArgs e)
{
Extras.CreateTemp(_pathTemp);
if (Settings.Default.Snapshot)
{
#region SnapShot Recording
FpsNumericUpDown.IsEnabled = false;
Topmost = true;
//Set to Snapshot Mode, change the text of the record button to "Snap" and
//every press of the button, takes a screenshot
Stage = Stage.Snapping;
Title = "Screen To Gif - " + FindResource("Recorder.Snapshot");
AutoFitButtons();
#endregion
}
else
{
#region Normal Recording
_snapDelay = null;
if (ListFrames.Count > 0)
{
Stage = Stage.Paused;
Title = Properties.Resources.TitlePaused;
DiscardButton.BeginStoryboard(FindResource("ShowDiscardStoryboard") as Storyboard,
HandoffBehavior.Compose);
}
else
{
Stage = Stage.Stopped;
Title = "Screen To Gif";
}
AutoFitButtons();
FrameRate.Stop();
#region Register the events
UnregisterEvents();
if (Settings.Default.ShowCursor)
{
if (!Settings.Default.FullScreen)
{
_capture.Tick += Cursor_Elapsed;
}
else
{
_capture.Tick += FullCursor_Elapsed;
}
}
else
{
if (!Settings.Default.FullScreen)
{
_capture.Tick += Normal_Elapsed;
}
else
{
_capture.Tick += Full_Elapsed;
}
}
#endregion
#endregion
}
}