-
-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(notification): Banner positions (#1346)
Fixes #242 Fixes #1176 * feat(notification): Banner positions * Update SoundSwitch/Framework/Banner/BannerForm.cs Co-authored-by: Antoine Aflalo <Belphemur@users.noreply.github.com> --------- Co-authored-by: Antoine Aflalo <Belphemur@users.noreply.github.com>
- Loading branch information
1 parent
9f7170f
commit 40892fe
Showing
21 changed files
with
537 additions
and
122 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/******************************************************************** | ||
* Copyright (C) 2015-2017 Antoine Aflalo | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version 2 | ||
* of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
********************************************************************/ | ||
|
||
namespace SoundSwitch.Framework.Banner | ||
{ | ||
public enum BannerPositionEnum | ||
{ | ||
TopLeft = 0, | ||
TopRight = 1, | ||
BottomLeft = 2, | ||
BottomRight = 3 | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/******************************************************************** | ||
* Copyright (C) 2015-2017 Antoine Aflalo | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version 2 | ||
* of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
********************************************************************/ | ||
|
||
using System.Collections.Generic; | ||
using System.Linq; | ||
using SoundSwitch.Framework.Banner; | ||
using SoundSwitch.Framework.Banner.Position; | ||
using SoundSwitch.Framework.Factory; | ||
|
||
namespace SoundSwitch.Framework.NotificationManager | ||
{ | ||
public class BannerPositionFactory : AbstractFactory<BannerPositionEnum, IPosition> | ||
{ | ||
private static readonly IEnumImplList<BannerPositionEnum, IPosition> Positions = new EnumImplList | ||
<BannerPositionEnum, IPosition> | ||
{ | ||
new PositionTopLeft(), | ||
new PositionTopRight(), | ||
new PositionBottomLeft(), | ||
new PositionBottomRight() | ||
}; | ||
|
||
public BannerPositionFactory() : base(Positions) | ||
{ | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/******************************************************************** | ||
* Copyright (C) 2015-2017 Antoine Aflalo | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version 2 | ||
* of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
********************************************************************/ | ||
|
||
using SoundSwitch.Framework.Factory; | ||
|
||
namespace SoundSwitch.Framework.Banner.Position | ||
{ | ||
public interface IPosition : IEnumImpl<BannerPositionEnum> | ||
{ | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
SoundSwitch/Framework/Banner/Position/PositionBottomLeft.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/******************************************************************** | ||
* Copyright (C) 2015-2017 Antoine Aflalo | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version 2 | ||
* of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
********************************************************************/ | ||
|
||
using SoundSwitch.Localization; | ||
|
||
namespace SoundSwitch.Framework.Banner.Position | ||
{ | ||
internal class PositionBottomLeft : IPosition | ||
{ | ||
public BannerPositionEnum TypeEnum => BannerPositionEnum.BottomLeft; | ||
public string Label => SettingsStrings.positionOptionBottomLeft; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
SoundSwitch/Framework/Banner/Position/PositionBottomRight.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/******************************************************************** | ||
* Copyright (C) 2015-2017 Antoine Aflalo | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version 2 | ||
* of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
********************************************************************/ | ||
|
||
using SoundSwitch.Localization; | ||
|
||
namespace SoundSwitch.Framework.Banner.Position | ||
{ | ||
internal class PositionBottomRight : IPosition | ||
{ | ||
public BannerPositionEnum TypeEnum => BannerPositionEnum.BottomRight; | ||
public string Label => SettingsStrings.positionOptionBottomRight; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/******************************************************************** | ||
* Copyright (C) 2015-2017 Antoine Aflalo | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version 2 | ||
* of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
********************************************************************/ | ||
|
||
using SoundSwitch.Localization; | ||
|
||
namespace SoundSwitch.Framework.Banner.Position | ||
{ | ||
internal class PositionTopLeft : IPosition | ||
{ | ||
public BannerPositionEnum TypeEnum => BannerPositionEnum.TopLeft; | ||
public string Label => SettingsStrings.positionOptionTopLeft; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/******************************************************************** | ||
* Copyright (C) 2015-2017 Antoine Aflalo | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version 2 | ||
* of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
********************************************************************/ | ||
|
||
using SoundSwitch.Localization; | ||
|
||
namespace SoundSwitch.Framework.Banner.Position | ||
{ | ||
internal class PositionTopRight : IPosition | ||
{ | ||
public BannerPositionEnum TypeEnum => BannerPositionEnum.TopRight; | ||
public string Label => SettingsStrings.positionOptionTopRight; | ||
} | ||
} |
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
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
8 changes: 1 addition & 7 deletions
8
SoundSwitch/Framework/NotificationManager/NotificationCustomSoundEnum.cs
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
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
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
Oops, something went wrong.