Skip to content

Commit

Permalink
Remove leftover 'WINDOWS_UWP' ifdefs
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio0694 committed Oct 23, 2024
1 parent ba11dec commit d782f50
Show file tree
Hide file tree
Showing 16 changed files with 8 additions and 71 deletions.
6 changes: 1 addition & 5 deletions components/Notifications/src/Badges/BadgeGlyphContent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
// See the LICENSE file in the project root for more information.

using System;
#if WINDOWS_UWP
using Windows.Data.Xml.Dom;
#endif

namespace CommunityToolkit.Notifications
{
Expand Down Expand Up @@ -80,7 +78,6 @@ public override string ToString()
return GetContent();
}

#if WINDOWS_UWP
/// <summary>
/// Retrieves the notification XML content as a WinRT Xml document.
/// </summary>
Expand All @@ -91,8 +88,7 @@ public XmlDocument GetXml()
xml.LoadXml(GetContent());
return xml;
}
#endif

private BadgeGlyphValue _glyph = (BadgeGlyphValue)(-1);
}
}
}
6 changes: 1 addition & 5 deletions components/Notifications/src/Badges/BadgeNumericContent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

#if WINDOWS_UWP
using Windows.Data.Xml.Dom;
#endif

namespace CommunityToolkit.Notifications
{
Expand Down Expand Up @@ -62,7 +60,6 @@ public override string ToString()
return GetContent();
}

#if WINDOWS_UWP
/// <summary>
/// Retrieves the notification Xml content as a WinRT Xml document.
/// </summary>
Expand All @@ -73,8 +70,7 @@ public XmlDocument GetXml()
xml.LoadXml(GetContent());
return xml;
}
#endif

private uint _number = 0;
}
}
}
6 changes: 1 addition & 5 deletions components/Notifications/src/Common/BaseElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
using System.IO;
using System.Text;

#if WINDOWS_UWP
using Windows.Data.Xml.Dom;
#endif

namespace CommunityToolkit.Notifications
{
Expand Down Expand Up @@ -40,7 +38,6 @@ public string GetContent()
}
}

#if WINDOWS_UWP
/// <summary>
/// Retrieves the notification XML content as a WinRT XML document.
/// </summary>
Expand All @@ -51,6 +48,5 @@ public XmlDocument GetXml()
xml.LoadXml(GetContent());
return xml;
}
#endif
}
}
}
6 changes: 1 addition & 5 deletions components/Notifications/src/Common/INotificationContent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

#if WINDOWS_UWP
using Windows.Data.Xml.Dom;
#endif

namespace CommunityToolkit.Notifications
{
Expand All @@ -19,12 +17,10 @@ public interface INotificationContent
/// <returns>The notification Xml content as a string.</returns>
string GetContent();

#if WINDOWS_UWP
/// <summary>
/// Retrieves the notification Xml content as a WinRT Xml document.
/// </summary>
/// <returns>The notification Xml content as a WinRT Xml document.</returns>
XmlDocument GetXml();
#endif
}
}
}
5 changes: 1 addition & 4 deletions components/Notifications/src/Common/LimitedList{T}.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
#if WINDOWS_UWP

#endif

namespace CommunityToolkit.Notifications
{
Expand Down Expand Up @@ -113,4 +110,4 @@ internal interface IElementWithDescendants
{
IEnumerable<object> Descendants();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
// See the LICENSE file in the project root for more information.

using System;
#if WINDOWS_UWP

#endif

namespace CommunityToolkit.Notifications
{
Expand All @@ -19,4 +16,4 @@ public NotificationContentValidationException(string message)
{
}
}
}
}
6 changes: 1 addition & 5 deletions components/Notifications/src/Tiles/TileContent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

#if WINDOWS_UWP
using Windows.Data.Xml.Dom;
using Windows.UI.Notifications;
#endif

namespace CommunityToolkit.Notifications
{
Expand All @@ -28,7 +26,6 @@ public string GetContent()
return ConvertToElement().GetContent();
}

#if WINDOWS_UWP
/// <summary>
/// Retrieves the notification XML content as a WinRT XmlDocument, so that it can be used with a local Tile notification's constructor on either <see cref="TileNotification"/> or <see cref="ScheduledTileNotification"/>.
/// </summary>
Expand All @@ -40,7 +37,6 @@ public XmlDocument GetXml()

return doc;
}
#endif

internal Element_Tile ConvertToElement()
{
Expand All @@ -54,4 +50,4 @@ internal Element_Tile ConvertToElement()
return tile;
}
}
}
}
4 changes: 0 additions & 4 deletions components/Notifications/src/Toasts/Builder/CustomizeToast.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

#if WINDOWS_UWP

using Windows.Foundation;
using Windows.UI.Notifications;

Expand Down Expand Up @@ -35,5 +33,3 @@ namespace CommunityToolkit.Notifications
/// <returns>An operation.</returns>
public delegate IAsyncAction CustomizeScheduledToastAsync(ScheduledToastNotification toast);
}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;

#if WINDOWS_UWP
using Windows.UI.Notifications;
#endif

namespace CommunityToolkit.Notifications
{
Expand Down Expand Up @@ -79,7 +76,6 @@ private IList<IToastBindingGenericChild> VisualChildren
}
}

#if WINDOWS_UWP
/// <summary>
/// Create an instance of NotificationData that can be used to update toast that has a progress bar.
/// </summary>
Expand Down Expand Up @@ -125,7 +121,6 @@ public static NotificationData CreateProgressBarData(ToastContent toast, int ind

return data;
}
#endif

/// <summary>
/// Add an Attribution Text to be displayed on the toast.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,6 @@ public ToastContent GetToastContent()
return Content;
}

#if WINDOWS_UWP
/// <summary>
/// Retrieves the notification XML content as a WinRT XmlDocument, so that it can be used with a local Toast notification's constructor on either <see cref="Windows.UI.Notifications.ToastNotification"/> or <see cref="Windows.UI.Notifications.ScheduledToastNotification"/>.
/// </summary>
Expand Down Expand Up @@ -436,6 +435,5 @@ private async System.Threading.Tasks.Task ScheduleAsyncHelper(DateTimeOffset del

ToastNotificationManagerCompat.CreateToastNotifier().AddToSchedule(notif);
}
#endif
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

#if WINDOWS_UWP

using System.Collections.Generic;
using Windows.UI.Notifications;

Expand Down Expand Up @@ -90,5 +88,3 @@ public void RemoveGroup(string group)
}
}
}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

#if WINDOWS_UWP

using System;
using System.Collections.Generic;
using System.Diagnostics;
Expand Down Expand Up @@ -56,5 +54,3 @@ public static bool CanUseHttpImages
}
}
}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

#if WINDOWS_UWP

using System.Collections.Generic;
using Windows.UI.Notifications;

Expand Down Expand Up @@ -101,5 +99,3 @@ public NotificationSetting Setting
}
}
}

#endif
7 changes: 1 addition & 6 deletions components/Notifications/src/Toasts/ToastContent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@

using System;
using System.Collections.Generic;
#if WINDOWS_UWP
using Windows.Data.Xml.Dom;
using Windows.UI.Notifications;
#endif

namespace CommunityToolkit.Notifications
{
Expand Down Expand Up @@ -100,7 +98,6 @@ public string GetContent()
return ConvertToElement().GetContent();
}

#if WINDOWS_UWP

/// <summary>
/// Retrieves the notification XML content as a WinRT XmlDocument, so that it can be used with a local Toast notification's constructor on either <see cref="ToastNotification"/> or <see cref="ScheduledToastNotification"/>.
Expand All @@ -114,8 +111,6 @@ public XmlDocument GetXml()
return doc;
}

#endif

internal Element_Toast ConvertToElement()
{
if (ActivationOptions != null)
Expand Down Expand Up @@ -189,4 +184,4 @@ private static Element_ToastActions ConvertToActionsElement(IToastActions action
throw new NotImplementedException("Unknown actions type: " + actions.GetType());
}
}
}
}
6 changes: 0 additions & 6 deletions components/Notifications/tests/TestAssertHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -272,20 +272,14 @@ public static void AssertToast(string expected, ToastContent toast)
{
AssertHelper.AssertXml(expected.ToLower(), toast.GetContent().ToLower());

#if WINDOWS_UWP
// For WinRT, we'll test the XmlDocument method too, make sure it works.
AssertHelper.AssertXml(expected, toast.GetXml().GetXml());
#endif
}

public static void AssertTile(string expected, TileContent tile)
{
AssertHelper.AssertXml(expected.ToLower(), tile.GetContent().ToLower());

#if WINDOWS_UWP
// For WinRT, we'll test the XmlDocument method too, make sure it works.
AssertHelper.AssertXml(expected, tile.GetXml().GetXml());
#endif
}

public static void AssertXml(string expected, string actual)
Expand Down
3 changes: 0 additions & 3 deletions components/Notifications/tests/Test_Badge_Xml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,7 @@ private static void AssertPayload(string expectedXml, INotificationContent notif
{
AssertHelper.AssertXml(expectedXml, notificationContent.GetContent());

#if WINDOWS_UWP
// For WinRT, we'll test the XmlDocument method too, make sure it works.
AssertHelper.AssertXml(expectedXml, notificationContent.GetXml().GetXml());
#endif
}
}
}

0 comments on commit d782f50

Please sign in to comment.