Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
7306973
added ifdefs to support model* snippets in UWP
cmurczek Sep 6, 2016
57da373
removed checks for silverlight as support will be dropped in v5
cmurczek Sep 6, 2016
3c1fb5e
[CTL-948] Adding optional status parameter to IPleaseWaitService.Push…
Trezamere Nov 9, 2016
32d5356
CTL-921
szogun1987 Dec 4, 2016
9aa374f
CTL-921
szogun1987 Dec 8, 2016
fcdd12c
CTL-921
szogun1987 Dec 8, 2016
cae7f86
CTL-921 Restore Ef tests
szogun1987 Dec 8, 2016
44410f3
CTL-921
szogun1987 Dec 12, 2016
1047ba5
CTL-921
szogun1987 Dec 12, 2016
2deac7c
CTL-921
szogun1987 Dec 12, 2016
3252bc7
CTL-921
szogun1987 Dec 13, 2016
487e90e
CTL-921
szogun1987 Dec 13, 2016
2f3d3b9
CTL-921
szogun1987 Dec 13, 2016
3e4bb96
CTL-921
szogun1987 Dec 13, 2016
e996ef5
CTL-921
szogun1987 Dec 13, 2016
a59689b
CTL-921
szogun1987 Dec 13, 2016
4bada11
CTL-921
szogun1987 Dec 13, 2016
9c97226
CTL-921
szogun1987 Dec 4, 2016
8e78e47
CTL-921
szogun1987 Dec 8, 2016
3aeeac0
CTL-921
szogun1987 Dec 8, 2016
69f1787
CTL-921 Restore Ef tests
szogun1987 Dec 8, 2016
d746b2b
CTL-921
szogun1987 Dec 12, 2016
7789ad3
CTL-921
szogun1987 Dec 12, 2016
00d2da6
CTL-921
szogun1987 Dec 12, 2016
ebf43bd
CTL-921
szogun1987 Dec 13, 2016
fa518ab
CTL-921
szogun1987 Dec 13, 2016
fabda6b
CTL-921
szogun1987 Dec 13, 2016
b6cdba0
CTL-921
szogun1987 Dec 13, 2016
d22b90b
CTL-921
szogun1987 Dec 13, 2016
aef7cc3
CTL-921
szogun1987 Dec 13, 2016
1a188cd
CTL-921
szogun1987 Dec 13, 2016
8f0f7ad
Merge branch 'bugfix/CTL-921_Thread_management_improvement' of https:…
Dec 14, 2016
3b5d481
CTL-921
szogun1987 Dec 4, 2016
653fe86
CTL-921
szogun1987 Dec 8, 2016
729b804
CTL-921
szogun1987 Dec 8, 2016
06703cb
CTL-921 Restore Ef tests
szogun1987 Dec 8, 2016
e9bb9a7
CTL-921
szogun1987 Dec 12, 2016
f0eb6c1
CTL-921
szogun1987 Dec 12, 2016
bdb52d6
CTL-921
szogun1987 Dec 12, 2016
9d2d172
CTL-921
szogun1987 Dec 13, 2016
1b9a260
CTL-921
szogun1987 Dec 13, 2016
8bf244c
CTL-921
szogun1987 Dec 13, 2016
b4e9a58
CTL-921
szogun1987 Dec 13, 2016
25c8525
CTL-921
szogun1987 Dec 13, 2016
cf10221
CTL-921
szogun1987 Dec 13, 2016
e3ec6f3
CTL-921
szogun1987 Dec 13, 2016
2bea80e
CTL-921
szogun1987 Dec 8, 2016
a15911b
CTL-921 Restore Ef tests
szogun1987 Dec 8, 2016
c9e9bfa
CTL-921
szogun1987 Dec 12, 2016
90d2dda
CTL-921
szogun1987 Dec 13, 2016
a7616f0
CTL-921
szogun1987 Dec 13, 2016
6ac2373
CTL-921
szogun1987 Dec 13, 2016
974bf3c
Merge branch 'bugfix/CTL-921_Thread_management_improvement' of https:…
Dec 14, 2016
eefd18c
CTL-921
szogun1987 Dec 4, 2016
47c0fc2
CTL-921
szogun1987 Dec 8, 2016
c2fcb88
CTL-921
szogun1987 Dec 8, 2016
487ab2d
CTL-921 Restore Ef tests
szogun1987 Dec 8, 2016
02b5ca0
CTL-921
szogun1987 Dec 12, 2016
bedba07
CTL-921
szogun1987 Dec 12, 2016
718810a
CTL-921
szogun1987 Dec 12, 2016
df05ada
CTL-921
szogun1987 Dec 13, 2016
413849c
CTL-921
szogun1987 Dec 13, 2016
8831ee6
CTL-921
szogun1987 Dec 13, 2016
f670196
CTL-921
szogun1987 Dec 13, 2016
adad714
CTL-921
szogun1987 Dec 13, 2016
bb4b93f
CTL-921
szogun1987 Dec 13, 2016
63ce456
CTL-921
szogun1987 Dec 13, 2016
0c1b93b
CTL-921
szogun1987 Dec 8, 2016
c6e118a
CTL-921 Restore Ef tests
szogun1987 Dec 8, 2016
f83311a
CTL-921
szogun1987 Dec 12, 2016
42621fe
CTL-921
szogun1987 Dec 13, 2016
8c681b2
CTL-921
szogun1987 Dec 13, 2016
9af6b1d
CTL-921
szogun1987 Dec 13, 2016
99c903e
CTL-921
szogun1987 Dec 13, 2016
9ac206a
CTL-921
szogun1987 Dec 8, 2016
642528d
CTL-921 Restore Ef tests
szogun1987 Dec 8, 2016
553b950
CTL-921
szogun1987 Dec 12, 2016
34ea3ab
CTL-921
szogun1987 Dec 13, 2016
17355bf
CTL-921
szogun1987 Dec 13, 2016
b2598b6
CTL-921
szogun1987 Dec 13, 2016
d532edc
CTL-921
szogun1987 Dec 8, 2016
314c4bb
CTL-921 Restore Ef tests
szogun1987 Dec 8, 2016
642e5fd
CTL-921
szogun1987 Dec 12, 2016
4a31609
CTL-921
szogun1987 Dec 13, 2016
d13b157
CTL-921
szogun1987 Dec 13, 2016
d322d06
CTL-921
szogun1987 Dec 13, 2016
51ddcde
Merge branch 'bugfix/CTL-921_Thread_management_improvement' of https:…
Dec 14, 2016
76a88e2
Revert ISerializationConfiguration removal
Dec 14, 2016
618da19
CTL-921
Dec 14, 2016
5bb0aee
CTL-921
szogun1987 Dec 18, 2016
36e2c5b
CTL-921
szogun1987 Dec 18, 2016
24b106b
Merge branch 'bugfix/CTL-921_Thread_management_improvement' of https:…
szogun1987 Dec 18, 2016
83164a6
CTL-921
szogun1987 Dec 18, 2016
812029f
CTL-921
szogun1987 Dec 18, 2016
e42f77a
(x) CTL-1000 NumericTextBox behavior doesn't allow some values (e.g. …
GeertvanHorrik Dec 20, 2016
790e016
Merge branch 'develop' into feature/CTL-948
GeertvanHorrik Jan 12, 2017
3cf3b7f
Merge pull request #105 from Trezamere/feature/CTL-948
GeertvanHorrik Jan 12, 2017
f18fc64
Merge pull request #102 from hindsight20-20/CTL-918_CodeSnippets-UWP-…
GeertvanHorrik Jan 12, 2017
af33987
Add MethodTimer
GeertvanHorrik Jan 22, 2017
08e9a65
Allow TypeCache to be queries without the need for full initialization
GeertvanHorrik Jan 22, 2017
6bc848c
Use BeginInvoke instead of Invoke in PleaseWaitHelper to prevent poss…
GeertvanHorrik Jan 23, 2017
c38e0e4
All code in Catel should not cause full AppDomain type initialization…
GeertvanHorrik Jan 23, 2017
79218ac
CTL-921
szogun1987 Jan 27, 2017
3edef97
Merge branch 'develop' into bugfix/CTL-921_Thread_management_improvement
GeertvanHorrik Feb 1, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@

Geert van Horrik <geert@catenalogic.com>
Daniel Kühner <daniel.kuehner@gmail.com>
Trezamere <trezamere@outlook.com>
Wojciech Gomoła <szogun1987@gmail.com>
11 changes: 7 additions & 4 deletions doc/history.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,21 @@ Added/fixed:
(*) CTL-905 Always log Argument logging (even when Catel logging is being ignored)
(*) CTL-911 Refactor UrlHelper to extension methods
(*) CTL-919 Replace parameters in ServiceLocator.ResolveTypeFromKnownContainer by ServiceInfo
(*) CTL-921 TypeFactory optimizations for multi-thread usage
(*) CTL-922 Don't cache RootFrame in NavigationService to allow dynamic navigation frames
(*) CTL-941 Update to json.net 9.x
(*) CTL-948 Allow setting the status in IPleaseWaitServiceExtensions.PushInScope
(*) CTL-988 Allow view models without model injection to stay alive on DataContext changes
(x) CTL-899 Navigation in WPF is not working when using custom frame
(x) CTL-906 Clear current navigation context when (re)navigating to the same view in WPF
(x) CTL-910 Introduce special lock for null keys in CacheStorage to prevent ArgumentNullException
(x) CTL-925 LanguageBinding markup now uses weak events to allow specific controls (such as the ComboBox with ComboBoxItem
elements) to be updated after they have been collapsed
(x) CTL-991 Equals method in ServiceLocator.ServiceInfo class returns false positives
(-) CTL-935 Remove InterestedIn attributes because services are a better way to communicate
(-) CTL-975 Remove EventHandlerExtensions.SplitInvoke and use regular event invocation
(-) CTL-987 Delete MVVM logic behaviors (should only be available as logic)
(x) CTL-991 Equals method in ServiceLocator.ServiceInfo class returns false positives
(x) CTL-1000 NumericTextBox behavior doesn't allow some values (e.g. 2.05)
(-) CTL-935 Remove InterestedIn attributes because services are a better way to communicate
(-) CTL-975 Remove EventHandlerExtensions.SplitInvoke and use regular event invocation
(-) CTL-987 Delete MVVM logic behaviors (should only be available as logic)
(-) Removed test implementations of services

Roadmap:
Expand Down
6 changes: 4 additions & 2 deletions snippets/C#/model.snippet
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
/// $name$ model which fully supports serialization, property changed notifications,
/// backwards compatibility and error checking.
/// </summary>
#if !SILVERLIGHT
#if NETFX_CORE
[DataContract]
#else
[Serializable]
#endif
public class $name$ : ModelBase
Expand All @@ -37,7 +39,7 @@ public class $name$ : ModelBase
/// </summary>
public $name$() { }

#if !SILVERLIGHT
#if !NETFX_CORE
/// <summary>
/// Initializes a new object based on <see cref="SerializationInfo"/>.
/// </summary>
Expand Down
5 changes: 5 additions & 0 deletions snippets/C#/modelprop.snippet
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
<![CDATA[/// <summary>
/// $description$.
/// </summary>
#if NETFX_CORE
[DataMember]
// TODO: use the following line instead of the one above, if you want to ignore the property for (de)serialization
//[IgnoreDataMember]
#endif
public $type$ $name$
{
get { return GetValue<$type$>($name$Property); }
Expand Down
5 changes: 5 additions & 0 deletions snippets/C#/modelpropchanged.snippet
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@
<![CDATA[/// <summary>
/// $description$.
/// </summary>
#if NETFX_CORE
[DataMember]
// TODO: use the following line instead of the one above, if you want to ignore the property for (de)serialization
//[IgnoreDataMember]
#endif
public $type$ $name$
{
get { return GetValue<$type$>($name$Property); }
Expand Down
4 changes: 4 additions & 0 deletions src/Catel.Core/Catel.Core.NET40/Catel.Core.NET40.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
<HintPath>..\..\..\lib\Catel.Fody.2.14.0\lib\portable-net4+sl4+wp7+win8+wpa81+MonoAndroid14+MonoTouch40\Catel.Fody.Attributes.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MethodTimer, Version=1.16.0.0, Culture=neutral, PublicKeyToken=cb1364609f40a1dc, processorArchitecture=MSIL">
<HintPath>..\..\..\lib\MethodTimer.Fody.1.16.0.0\Lib\portable-net4+sl5+wp8+win8+wpa81+MonoAndroid16+MonoTouch40\MethodTimer.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Threading.Tasks">
<HintPath>..\..\..\lib\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll</HintPath>
</Reference>
Expand Down
7 changes: 4 additions & 3 deletions src/Catel.Core/Catel.Core.NET40/FodyWeavers.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Weavers VerifyAssembly="true">
<ModuleInit/>
<Obsolete/>
<ModuleInit />
<Obsolete />
<Catel WeaveProperties="false" />
<MethodTimer />
</Weavers>
1 change: 1 addition & 0 deletions src/Catel.Core/Catel.Core.NET40/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<package id="AsyncUsageAnalyzers" version="1.0.0-alpha003" targetFramework="net40-client" developmentDependency="true" />
<package id="Catel.Fody" version="2.14.0" targetFramework="net40-client" developmentDependency="true" />
<package id="Fody" version="1.29.4" targetFramework="net40-client" developmentDependency="true" />
<package id="MethodTimer.Fody" version="1.16.0.0" targetFramework="net40-client" developmentDependency="true" />
<package id="Microsoft.Bcl" version="1.1.10" targetFramework="net4-client" />
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net4-client" />
<package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="net4-client" />
Expand Down
4 changes: 4 additions & 0 deletions src/Catel.Core/Catel.Core.NET45/Catel.Core.NET45.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
<HintPath>..\..\..\lib\Catel.Fody.2.14.0\lib\portable-net4+sl4+wp7+win8+wpa81+MonoAndroid14+MonoTouch40\Catel.Fody.Attributes.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MethodTimer, Version=1.16.0.0, Culture=neutral, PublicKeyToken=cb1364609f40a1dc, processorArchitecture=MSIL">
<HintPath>..\..\..\lib\MethodTimer.Fody.1.16.0.0\Lib\dotnet\MethodTimer.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Obsolete, Version=4.1.0.0, Culture=neutral, PublicKeyToken=1ca091877d12ca03, processorArchitecture=MSIL">
<HintPath>..\..\..\lib\Obsolete.Fody.4.1.0\Lib\dotnet\Obsolete.dll</HintPath>
<Private>False</Private>
Expand Down
3 changes: 2 additions & 1 deletion src/Catel.Core/Catel.Core.NET45/FodyWeavers.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Weavers VerifyAssembly="true">
<Obsolete />
<ModuleInit />
<Catel WeaveProperties="false" />
<MethodTimer />
</Weavers>
1 change: 1 addition & 0 deletions src/Catel.Core/Catel.Core.NET45/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<package id="AsyncUsageAnalyzers" version="1.0.0-alpha003" targetFramework="net45" developmentDependency="true" />
<package id="Catel.Fody" version="2.14.0" targetFramework="net45" developmentDependency="true" />
<package id="Fody" version="1.29.4" targetFramework="net45" developmentDependency="true" />
<package id="MethodTimer.Fody" version="1.16.0.0" targetFramework="net45" developmentDependency="true" />
<package id="ModuleInit.Fody" version="1.5.9.0" targetFramework="net45" developmentDependency="true" />
<package id="Obsolete.Fody" version="4.1.0" targetFramework="net45" developmentDependency="true" />
<package id="WpfAnalyzers" version="0.2.4.0-dev" targetFramework="net45" developmentDependency="true" />
Expand Down
4 changes: 4 additions & 0 deletions src/Catel.Core/Catel.Core.NET46/Catel.Core.NET46.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
<HintPath>..\..\..\lib\Catel.Fody.2.14.0\lib\portable-net4+sl4+wp7+win8+wpa81+MonoAndroid14+MonoTouch40\Catel.Fody.Attributes.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MethodTimer, Version=1.16.0.0, Culture=neutral, PublicKeyToken=cb1364609f40a1dc, processorArchitecture=MSIL">
<HintPath>..\..\..\lib\MethodTimer.Fody.1.16.0.0\Lib\dotnet\MethodTimer.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Obsolete, Version=4.1.0.0, Culture=neutral, PublicKeyToken=1ca091877d12ca03, processorArchitecture=MSIL">
<HintPath>..\..\..\lib\Obsolete.Fody.4.1.0\Lib\dotnet\Obsolete.dll</HintPath>
<Private>False</Private>
Expand Down
3 changes: 2 additions & 1 deletion src/Catel.Core/Catel.Core.NET46/FodyWeavers.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Weavers VerifyAssembly="true">
<Obsolete />
<ModuleInit />
<Catel WeaveProperties="false" />
<MethodTimer />
</Weavers>
1 change: 1 addition & 0 deletions src/Catel.Core/Catel.Core.NET46/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<package id="AsyncUsageAnalyzers" version="1.0.0-alpha003" targetFramework="net46" developmentDependency="true" />
<package id="Catel.Fody" version="2.14.0" targetFramework="net46" developmentDependency="true" />
<package id="Fody" version="1.29.4" targetFramework="net46" developmentDependency="true" />
<package id="MethodTimer.Fody" version="1.16.0.0" targetFramework="net46" developmentDependency="true" />
<package id="ModuleInit.Fody" version="1.5.9.0" targetFramework="net46" developmentDependency="true" />
<package id="Obsolete.Fody" version="4.1.0" targetFramework="net46" developmentDependency="true" />
<package id="WpfAnalyzers" version="0.2.4.0-dev" targetFramework="net46" developmentDependency="true" />
Expand Down
4 changes: 4 additions & 0 deletions src/Catel.Core/Catel.Core.PCL/Catel.Core.PCL.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
<HintPath>..\..\..\lib\Catel.Fody.2.14.0\lib\portable-net4+sl4+wp7+win8+wpa81+MonoAndroid14+MonoTouch40\Catel.Fody.Attributes.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MethodTimer, Version=1.16.0.0, Culture=neutral, PublicKeyToken=cb1364609f40a1dc, processorArchitecture=MSIL">
<HintPath>..\..\..\lib\MethodTimer.Fody.1.16.0.0\Lib\portable-net4+sl5+wp8+win8+wpa81+MonoAndroid16+MonoTouch40\MethodTimer.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Obsolete, Version=4.1.0.0, Culture=neutral, PublicKeyToken=1ca091877d12ca03, processorArchitecture=MSIL">
<HintPath>..\..\..\lib\Obsolete.Fody.4.1.0\Lib\portable-net4+sl5+wp8+win8+wpa81+MonoAndroid16+MonoTouch40\Obsolete.dll</HintPath>
<Private>False</Private>
Expand Down
3 changes: 2 additions & 1 deletion src/Catel.Core/Catel.Core.PCL/FodyWeavers.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Weavers VerifyAssembly="true">
<Obsolete />
<ModuleInit />
<Catel WeaveProperties="false" />
<MethodTimer />
</Weavers>
1 change: 1 addition & 0 deletions src/Catel.Core/Catel.Core.PCL/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<package id="AsyncUsageAnalyzers" version="1.0.0-alpha003" targetFramework="portable45-net45+win8+wp8+wpa81" developmentDependency="true" />
<package id="Catel.Fody" version="2.14.0" targetFramework="portable45-net45+win8+wp8+wpa81" developmentDependency="true" />
<package id="Fody" version="1.29.4" targetFramework="portable45-net45+win8+wp8+wpa81" developmentDependency="true" />
<package id="MethodTimer.Fody" version="1.16.0.0" targetFramework="portable45-net45+win8+wp8+wpa81" developmentDependency="true" />
<package id="ModuleInit.Fody" version="1.5.9.0" targetFramework="portable45-net45+win8+wp8+wpa81" developmentDependency="true" />
<package id="Obsolete.Fody" version="4.1.0" targetFramework="portable45-net45+win8+wp8+wpa81" developmentDependency="true" />
<package id="WpfAnalyzers" version="0.2.4.0-dev" targetFramework="portable45-net45+win8+wp8+wpa81" developmentDependency="true" />
Expand Down
76 changes: 58 additions & 18 deletions src/Catel.Core/Catel.Core.Shared/AppDomain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ namespace System
using Collections.Generic;
using Reflection;
using System.Linq;

using Catel.Reflection;
using MethodTimer;
#if NETFX_CORE
using global::Windows.ApplicationModel;
using global::Windows.Storage.Search;
Expand Down Expand Up @@ -61,6 +62,7 @@ static AppDomain()
/// Gets the assemblies in the current application domain.
/// </summary>
/// <returns></returns>
[Time]
public Assembly[] GetAssemblies()
{
lock (_lock)
Expand All @@ -74,7 +76,7 @@ public Assembly[] GetAssemblies()

// Note: normally it's bad practice to use task.Wait(), but GetAssemblies must be blocking to cache it all

var queryOptions = new QueryOptions(CommonFileQuery.OrderByName, new[] { ".dll", ".exe" });
var queryOptions = new QueryOptions(CommonFileQuery.OrderByName, new[] { ".dll", ".exe", ".winmd" });
queryOptions.FolderDepth = FolderDepth.Shallow;

var queryResult = folder.CreateFileQueryWithOptions(queryOptions);
Expand All @@ -88,25 +90,15 @@ public Assembly[] GetAssemblies()

foreach (var file in files)
{
try
if (file.Name.StartsWithAnyIgnoreCase(arrayToIgnore))
{
if (file.Name.StartsWithAnyIgnoreCase(arrayToIgnore))
{
continue;
}

var filename = file.Name.Substring(0, file.Name.Length - file.FileType.Length);
var name = new AssemblyName
{
Name = filename
};

var assembly = Assembly.Load(name);
loadedAssemblies.Add(assembly);
continue;
}
catch (Exception ex)

var assembly = LoadAssemblyFromFile(file);
if (assembly != null)
{
Log.Warning(ex, $"Failed to load assembly '{file.Name}'");
loadedAssemblies.Add(assembly);
}
}
#else
Expand All @@ -122,6 +114,54 @@ public Assembly[] GetAssemblies()
return _loadedAssemblies;
}
}

#if NETFX_CORE
//[Time]
private Assembly LoadAssemblyFromFile(global::Windows.Storage.StorageFile file)
{
try
{
var assemblyName = file.Name.Substring(0, file.Name.Length - file.FileType.Length);
var name = new AssemblyName
{
Name = assemblyName
};

Assembly assembly = null;

//// Step 1: try to fast load if already in memory via Fody type
//var expectedTypeName = $"ProcessedByFody, {assemblyName}";
//var expectedType = Type.GetType(expectedTypeName);
//if (expectedType != null)
//{
// assembly = expectedType.GetAssemblyEx();
//}
//else
//{
// // Step 2: try different type
// expectedTypeName = $"<Module>, {assemblyName}";
// expectedType = Type.GetType(expectedTypeName);
// if (expectedType != null)
// {
// assembly = expectedType.GetAssemblyEx();
// }
//}

// Step 3: load the assembly from file (slowest)
if (assembly == null)
{
assembly = Assembly.Load(name);
}

return assembly;
}
catch (Exception ex)
{
Log.Warning(ex, $"Failed to load assembly '{file.Name}'");
return null;
}
}
#endif
#endregion
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@
<Compile Include="$(MSBuildThisFileDirectory)Helpers\TagHelper.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Helpers\UniqueIdentifierHelper.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Interfaces\IDisposableToken.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Interfaces\ILockable.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Interfaces\IUniqueIdentifyable.cs" />
<Compile Include="$(MSBuildThisFileDirectory)IoC\Attributes\InjectAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)IoC\Attributes\InjectionConstructorAttribute.cs" />
Expand Down Expand Up @@ -294,6 +293,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Pooling\PoolManager.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Properties\AssemblyInfo.cs" />
<Compile Include="$(MSBuildThisFileDirectory)..\..\SolutionAssemblyInfo.cs" />
<Compile Include="$(MSBuildThisFileDirectory)..\..\MethodTimeLogger.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Reflection\BindingFlags.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Reflection\CachedPropertyInfo.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Reflection\EventArgs\AssemblyLoadedEventArgs.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static bool HasHttpContext()

public static object GetHttpContext()
{
var httpContextType = TypeCache.GetTypeWithoutAssembly("System.Web.HttpContext");
var httpContextType = TypeCache.GetTypeWithoutAssembly("System.Web.HttpContext", allowInitialization: false);
if (httpContextType != null)
{
var currentPropertyInfo = httpContextType.GetProperty("Current", BindingFlags.Public | BindingFlags.Static);
Expand Down
23 changes: 0 additions & 23 deletions src/Catel.Core/Catel.Core.Shared/Interfaces/ILockable.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ public string Tag
/// </summary>
public Type InterfaceType
{
get { return TypeCache.GetType(InterfaceTypeName); }
get { return TypeCache.GetType(InterfaceTypeName, allowInitialization: false); }
}

/// <summary>
/// Gets the implementation type.
/// </summary>
public Type ImplementationType
{
get { return TypeCache.GetType(ImplementationTypeName); }
get { return TypeCache.GetType(ImplementationTypeName, allowInitialization: false); }
}
#endregion
}
Expand Down
Loading