Skip to content

Commit f669779

Browse files
Removed all SL4 & WP7 defines (code cleanup)
1 parent c392767 commit f669779

File tree

23 files changed

+40
-73
lines changed

23 files changed

+40
-73
lines changed

src/Catel.Core/Catel.Core.NET40/Data/ModelBase.cs

-7
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,13 @@ public abstract partial class ModelBase : ObservableObject, IModel
106106
#endif
107107
internal readonly PropertyBag _propertyBag = new PropertyBag();
108108

109-
#if !WP7
110109
/// <summary>
111110
/// The change notification wrappers for all property values.
112111
/// </summary>
113112
#if NET
114113
[field: NonSerialized]
115114
#endif
116115
private readonly Dictionary<string, ChangeNotificationWrapper> _propertyValueChangeNotificationWrappers = new Dictionary<string, ChangeNotificationWrapper>();
117-
#endif
118116

119117
/// <summary>
120118
/// Lock object for the <see cref="_propertyBag"/> field.
@@ -796,7 +794,6 @@ private void HandleObjectEventsSubscription(string propertyName, object property
796794
return;
797795
}
798796

799-
#if !WP7
800797
lock (_propertyValuesLock)
801798
{
802799
if (_propertyValueChangeNotificationWrappers.ContainsKey(propertyName))
@@ -824,10 +821,8 @@ private void HandleObjectEventsSubscription(string propertyName, object property
824821
_propertyValueChangeNotificationWrappers[propertyName] = wrapper;
825822
}
826823
}
827-
#endif
828824
}
829825

830-
#if !WP7
831826
/// <summary>
832827
/// Called when a property that implements <see cref="INotifyPropertyChanged"/> raises the event.
833828
/// </summary>
@@ -869,8 +864,6 @@ protected virtual void OnPropertyObjectCollectionItemPropertyChanged(object send
869864

870865
SetDirtyAndAutomaticallyValidate(string.Empty, true);
871866
}
872-
873-
#endif
874867
#endregion
875868

876869
#region INotifyPropertyChanged Members

src/Catel.Core/Catel.Core.NET40/Messaging/Helpers/MessageMediatorHelper.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public static class MessageMediatorHelper
2828
/// <param name="messageMediator">The message mediator. If <c>null</c>, the default will be used.</param>
2929
/// <exception cref="ArgumentNullException">The <paramref name="instance"/> is <c>null</c>.</exception>
3030
/// <exception cref="NotSupportedException">The object has non-public methods decorated with the <see cref="MessageRecipientAttribute"/>, but the
31-
/// application is not written in .NET (but in SL, WP7 or WinRT).</exception>
31+
/// application is not written in .NET (but in Silverlight, Windows Phone or WinRT).</exception>
3232
/// <exception cref="InvalidCastException">One of the methods cannot be casted to a valid message method.</exception>
3333
public static void SubscribeRecipient(object instance, IMessageMediator messageMediator = null)
3434
{

src/Catel.Core/Catel.Core.NET40/Reflection/Extensions/AssemblyExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public static string Title(this Assembly assembly)
3030
#if NET
3131
return System.IO.Path.GetFileNameWithoutExtension(assembly.CodeBase);
3232
#else
33-
throw new NotSupportedException("Only supported in .NET, not in SL, WP7 or WinRT");
33+
throw new NotSupportedInPlatform();
3434
#endif
3535
}
3636

src/Catel.Core/Catel.Core.NET40/Reflection/Extensions/ReflectionExtensions.type.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,7 @@ public static MethodInfo[] GetMethodsEx(this Type type, BindingFlags bindingFlag
10151015
#endif
10161016
}
10171017

1018-
#if NET40 || SILVERLIGHT || WP7 || PCL
1018+
#if NET40 || SILVERLIGHT || PCL
10191019

10201020
/// <summary>
10211021
/// The type infos cache.

src/Catel.Core/Catel.Core.NET40/Reflection/Helpers/AssemblyHelper.cs

+4-23
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace Catel.Reflection
1818
using System.Windows;
1919
#endif
2020

21-
#if SL4 || SL5
21+
#if SL5
2222
using System.Windows.Resources;
2323
using System.Xml.Linq;
2424
using Threading;
@@ -43,22 +43,7 @@ public static class AssemblyHelper
4343

4444
private static readonly Dictionary<string, string> _assemblyMappings = new Dictionary<string, string>();
4545

46-
#if SL4
47-
private static readonly List<Assembly> _frameworkAssemblies = new List<Assembly>();
48-
#endif
49-
50-
/// <summary>
51-
/// Initializes static members of the <see cref="AssemblyHelper"/> class.
52-
/// </summary>
53-
static AssemblyHelper()
54-
{
55-
#if SL4
56-
_frameworkAssemblies.Add(Assembly.Load("mscorlib"));
57-
_frameworkAssemblies.Add(typeof(Uri).Assembly); // system
58-
#endif
59-
}
60-
61-
#if SL4 || SL5
46+
#if SL5
6247
private static readonly List<Assembly> _externalAssemblies = new List<Assembly>();
6348

6449
/// <summary>
@@ -255,11 +240,7 @@ public static List<Assembly> GetLoadedAssemblies(this AppDomain appDomain)
255240
{
256241
var assemblies = new List<Assembly>();
257242

258-
#if SL4
259-
assemblies.AddRange(_frameworkAssemblies);
260-
#else
261243
assemblies.AddRange(appDomain.GetAssemblies());
262-
#endif
263244

264245
#if SILVERLIGHT
265246
try
@@ -271,7 +252,7 @@ public static List<Assembly> GetLoadedAssemblies(this AppDomain appDomain)
271252
#if WINDOWS_PHONE
272253
try
273254
{
274-
// It's not much, but it's the best we could do for WP7
255+
// It's not much, but it's the best we could do for Windows Phone
275256
assemblies.Add(Assembly.Load(assemblyPart.Source.Replace(".dll", string.Empty)));
276257
}
277258
catch (Exception)
@@ -294,7 +275,7 @@ public static List<Assembly> GetLoadedAssemblies(this AppDomain appDomain)
294275
Log.Error(ex, "Failed to load Deployment.Current.Parts");
295276
}
296277

297-
#if SL4 || SL5
278+
#if SL5
298279
// Add the loaded xap cache
299280
assemblies.AddRange(_externalAssemblies);
300281
#endif

src/Catel.Core/Catel.Core.NET40/SupportedPlatforms.cs

+14-9
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ private static SupportedPlatforms DeterminePlatform()
3838
return SupportedPlatforms.NET45;
3939
#elif NET50
4040
return SupportedPlatforms.NET50;
41-
#elif SL4
42-
throw new System.NotSupportedException("SL4 is not supported");
4341
#elif SL5
4442
return SupportedPlatforms.Silverlight5;
45-
#elif WP7
46-
throw new System.NotSupportedException("WP7 is not supported");
4743
#elif WP80
4844
return SupportedPlatforms.WindowsPhone80;
45+
#elif WP81 && SILVERLIGHT
46+
return SupportedPlatforms.WindowsPhone81Silverlight;
47+
#elif WP81 && NETFX_CORE
48+
return SupportedPlatforms.WindowsPhone81Runtime;
4949
#elif WIN80
5050
return SupportedPlatforms.Windows80;
5151
#elif WIN81
@@ -90,6 +90,16 @@ public enum SupportedPlatforms
9090
/// </summary>
9191
WindowsPhone80,
9292

93+
/// <summary>
94+
/// Windows Phone 8.1 (Silverlight).
95+
/// </summary>
96+
WindowsPhone81Silverlight,
97+
98+
/// <summary>
99+
/// Windows Phone 8.1 (Runtime).
100+
/// </summary>
101+
WindowsPhone81Runtime,
102+
93103
/// <summary>
94104
/// Windows Runtime 8.0.
95105
/// </summary>
@@ -100,11 +110,6 @@ public enum SupportedPlatforms
100110
/// </summary>
101111
Windows81,
102112

103-
/// <summary>
104-
/// The portable class libraries (PCL).
105-
/// </summary>
106-
PCL,
107-
108113
/// <summary>
109114
/// The Android platform.
110115
/// </summary>

src/Catel.MVVM/Catel.MVVM.NET40/CatelEnvironment.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public static void RegisterDefaultViewModelServices()
9999
#if !WINDOWS_PHONE && !PCL && !XAMARIN
100100
/// <summary>
101101
/// Gets the main window of the application. This is a convenience call to easily allow the retrieval of the main window
102-
/// for each target framework (WPF, SL, WP7).
102+
/// for each target framework (WPF, Silverlight, Windows Phone, etc).
103103
/// </summary>
104104
public static Window MainWindow
105105
{

src/Catel.MVVM/Catel.MVVM.NET40/MVVM/Commands/AsynchronousCommand.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ protected override void Execute(TExecuteParameter parameter, bool ignoreCanExecu
173173

174174
RaiseCanExecuteChanged();
175175

176-
// Run the action on a new thread from the thread pool (this will therefore work in SL and WP7 as well)
176+
// Run the action on a new thread from the thread pool (this will therefore work in Silverlight and Windows Phone as well)
177177
#if NETFX_CORE
178178
ThreadPool.RunAsync(state =>
179179
#else

src/Catel.MVVM/Catel.MVVM.NET40/MVVM/Commands/EventArgs/CommandProgressChangedEventArgs.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// </copyright>
55
// --------------------------------------------------------------------------------------------------------------------
66

7-
#if !NET40 && !SILVERLIGHT && !WP7
7+
#if !NET40 && !SILVERLIGHT
88

99
namespace Catel.MVVM
1010
{

src/Catel.MVVM/Catel.MVVM.NET40/MVVM/Commands/Interfaces/ICatelTaskCommand.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// </copyright>
55
// --------------------------------------------------------------------------------------------------------------------
66

7-
#if !NET40 && !SILVERLIGHT && !WP7
7+
#if !NET40 && !SILVERLIGHT
88

99
namespace Catel.MVVM
1010
{

src/Catel.MVVM/Catel.MVVM.NET40/MVVM/Commands/Interfaces/ITaskProgressReport.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// </copyright>
55
// --------------------------------------------------------------------------------------------------------------------
66

7-
#if !NET40 && !SILVERLIGHT && !WP7
7+
#if !NET40 && !SILVERLIGHT
88

99
namespace Catel.MVVM
1010
{

src/Catel.MVVM/Catel.MVVM.NET40/MVVM/Commands/TaskCommand.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// </copyright>
55
// --------------------------------------------------------------------------------------------------------------------
66

7-
#if !NET40 && !SILVERLIGHT && !WP7
7+
#if !NET40 && !SILVERLIGHT
88

99
namespace Catel.MVVM
1010
{

src/Catel.MVVM/Catel.MVVM.NET40/MVVM/Providers/UserControlLogic.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public class UserControlLogic : LogicBase
4545
private IViewModelContainer _parentViewModelContainer;
4646
private IViewModel _parentViewModel;
4747

48-
#if NET || SL4 || SL5
48+
#if NET ||SL5
4949
private InfoBarMessageControl _infoBarMessageControl;
5050
#endif
5151
#endregion
@@ -860,7 +860,7 @@ private void ClearWarningsAndErrorsForObject(object obj)
860860
return;
861861
}
862862

863-
#if NET || SL4 || SL5
863+
#if NET || SL5
864864
if (_infoBarMessageControl != null)
865865
{
866866
_infoBarMessageControl.ClearObjectMessages(obj);

src/Catel.MVVM/Catel.MVVM.NET40/Properties/Exceptions.SL5.Designer.cs

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Catel.MVVM/Catel.MVVM.NET40/Services/NavigationService.xaml.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ private NavigationWindow RootFrame
9191
#region Methods
9292
partial void Initialize()
9393
{
94-
#if NET || SL4 || SL5
94+
#if NET || SL5
9595
var mainWindow = CatelEnvironment.MainWindow;
9696
if (mainWindow != null)
9797
{

src/Catel.MVVM/Catel.MVVM.NET40/Services/StartUpInfoProvider.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public string[] Arguments
5050
}
5151
#endif
5252

53-
#if SL4 || SL5
53+
#if SL5
5454
/// <summary>
5555
/// Gets the silverlight application initialization parameters.
5656
/// </summary>

src/Catel.MVVM/Catel.MVVM.NET40/Windows/Controls/UserControl.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ public static bool DefaultTransferStylesAndTransitionsToViewModelGridValue
297297
set { UserControlLogic.DefaultTransferStylesAndTransitionsToViewModelGridValue = value; }
298298
}
299299

300-
#if NET || SL4 || SL5
300+
#if NET || SL5
301301
/// <summary>
302302
/// Gets or sets a value indicating whether to skip the search for an info bar message control. If not skipped,
303303
/// the user control will search for a the first <see cref="InfoBarMessageControl"/> that can be found.

src/Catel.MVVM/Catel.MVVM.NET40/Windows/Data/Helpers/DependencyPropertyHelper.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public static class DependencyPropertyHelper
4040

4141
/// <summary>
4242
/// Cache containing the names of all found dependency properties, required because it is not possible to get the name of a
43-
/// dependency property in Silverlight and WP7.
43+
/// dependency property in Silverlight and Windows Phone.
4444
/// </summary>
4545
private static readonly Dictionary<DependencyProperty, string> _cacheByDependencyProperty = new Dictionary<DependencyProperty, string>();
4646

src/Catel.MVVM/Catel.MVVM.NET40/Windows/Interactivity/Focus.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ private void OnTimerTick(object sender, TimerTickEventArgs e)
340340
/// </summary>
341341
private bool SetFocus()
342342
{
343-
#if SL4 || SL5
343+
#if SL5
344344
System.Windows.Browser.HtmlPage.Plugin.Focus();
345345
#endif
346346

src/Catel.MVVM/Catel.MVVM.NET40/Windows/Threading/Helpers/Dispatcherhelper.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ private static object ExitFrame(object state)
9898
#endif
9999

100100
/// <summary>
101-
/// Gets the current dispatcher. This property is compatible with WPF, SL and WP7, and also works
101+
/// Gets the current dispatcher. This property is compatible with WPF, Silverlight, Windows Phone, etc, and also works
102102
/// when there is no application object (for example, during unit tests).
103103
/// </summary>
104104
/// <value>The current dispatcher.</value>

src/Catel.MVVM/Catel.MVVM.NET45/MVVM/Commands/EventArgs/CommandProgressChangedEventArgs.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// </copyright>
55
// --------------------------------------------------------------------------------------------------------------------
66

7-
#if !NET40 && !SILVERLIGHT && !WP7
7+
#if !NET40 && !SILVERLIGHT
88

99
namespace Catel.MVVM
1010
{

src/Catel.Test/Catel.Test.NET40/Data/ModelBaseTest.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ public void NotifyPropertyChangingPreventsSetValue()
444444
#endregion
445445

446446
#region Attribute validation
447-
#if NET || SL4 || SL5
447+
#if NET || SL5
448448
[TestMethod]
449449
public void AttributeValidation_DoNotValidate()
450450
{

src/SolutionAssemblyInfo.cs

+2-14
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,14 @@
4040

4141
#if DEBUG
4242

43-
#if NET35
44-
[assembly: AssemblyConfiguration("NET35, Debug")]
45-
#elif NET40
43+
#if NET40
4644
[assembly: AssemblyConfiguration("NET40, Debug")]
4745
#elif NET45
4846
[assembly: AssemblyConfiguration("NET45, Debug")]
4947
#elif NET50
5048
[assembly: AssemblyConfiguration("NET50, Debug")]
51-
#elif SL4
52-
[assembly: AssemblyConfiguration("Silverlight 4, Debug")]
5349
#elif SL5
5450
[assembly: AssemblyConfiguration("Silverlight 5, Debug")]
55-
#elif WP7
56-
[assembly: AssemblyConfiguration("Windows Phone 7.x, Debug")]
5751
#elif WP80
5852
[assembly: AssemblyConfiguration("Windows Phone 8.0, Debug")]
5953
#elif WPSL81
@@ -76,20 +70,14 @@
7670

7771
#else
7872

79-
#if NET35
80-
[assembly: AssemblyConfiguration("NET35, Release")]
81-
#elif NET40
73+
#if NET40
8274
[assembly: AssemblyConfiguration("NET40, Release")]
8375
#elif NET45
8476
[assembly: AssemblyConfiguration("NET45, Release")]
8577
#elif NET50
8678
[assembly: AssemblyConfiguration("NET50, Release")]
87-
#elif SL4
88-
[assembly: AssemblyConfiguration("Silverlight 4, Release")]
8979
#elif SL5
9080
[assembly: AssemblyConfiguration("Silverlight 5, Release")]
91-
#elif WP7
92-
[assembly: AssemblyConfiguration("Windows Phone 7.x, Release")]
9381
#elif WP80
9482
[assembly: AssemblyConfiguration("Windows Phone 8.0, Release")]
9583
#elif WPSL81

0 commit comments

Comments
 (0)