move Period enum into its own file

This commit is contained in:
2020-09-18 21:08:40 +03:00
parent 52f84a9f00
commit 5174dc5688
3 changed files with 38 additions and 27 deletions

37
PomoTime/Period.cs Normal file
View File

@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PomoTime
{
public static class PeriodExtensions
{
public static string Name(this Period period)
{
string output;
switch (period)
{
case Period.LongBreak:
output = "Long break";
break;
case Period.ShortBreak:
output = "Short break";
break;
case Period.Work:
output = "Work";
break;
default:
throw new ArgumentOutOfRangeException();
}
return output;
}
}
public enum Period
{
Work, ShortBreak, LongBreak
}
}

View File

@@ -132,6 +132,7 @@
<Compile Include="MainPage.xaml.cs">
<DependentUpon>MainPage.xaml</DependentUpon>
</Compile>
<Compile Include="Period.cs" />
<Compile Include="PeriodToStringConverter.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RunningState.cs" />

View File

@@ -4,33 +4,6 @@ using System.Runtime.CompilerServices;
namespace PomoTime
{
public static class PeriodExtensions
{
public static string Name(this Period period)
{
string output;
switch (period)
{
case Period.LongBreak:
output = "Long break";
break;
case Period.ShortBreak:
output = "Short break";
break;
case Period.Work:
output = "Work";
break;
default:
throw new ArgumentOutOfRangeException();
}
return output;
}
}
public enum Period
{
Work, ShortBreak, LongBreak
}
public class RunningState : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;