Made Nuclex.Support compileable on the XBox 360; added new XNA 3.0 project to compile Nuclex.Support on the XBox 360; added my own AssemblyLoadEventArgs implementation since the XBox 360 XNA framework doesn't provide it; other minor fixes so Nuclex.Support can cope with the XBox 360 XNA framework

git-svn-id: file:///srv/devel/repo-conversion/nusu@113 d2e56fa2-650e-0410-a79f-9358c0239efd
This commit is contained in:
Markus Ewald 2009-01-13 18:50:52 +00:00
parent 8f6616f79a
commit 0a483b4d44
19 changed files with 473 additions and 28 deletions

View File

@ -0,0 +1,294 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<PropertyGroup>
<ProjectGuid>{DFFEAB70-51B8-4714-BCA6-79B733BBC520}</ProjectGuid>
<ProjectTypeGuids>{2DF5C3F4-5A5F-47a9-8E94-23B4456F55E2};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">Xbox 360</Platform>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Nuclex.Support</RootNamespace>
<AssemblyName>Nuclex.Support</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<XnaFrameworkVersion>v3.0</XnaFrameworkVersion>
<XnaPlatform>Xbox 360</XnaPlatform>
<XnaCrossPlatformGroupID>334850d5-951c-4098-aeed-40d9a06c9df1</XnaCrossPlatformGroupID>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|Xbox 360' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Xbox 360\Debug</OutputPath>
<DefineConstants>TRACE;DEBUG;XBOX;XBOX360;COMPACTFRAMEWORK</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoStdLib>true</NoStdLib>
<UseVSHostingProcess>false</UseVSHostingProcess>
<XnaCompressContent>true</XnaCompressContent>
<DocumentationFile>bin\Xbox 360\Debug\Nuclex.Support.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|Xbox 360' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Xbox 360\Release</OutputPath>
<DefineConstants>TRACE;XBOX;XBOX360;COMPACTFRAMEWORK</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoStdLib>true</NoStdLib>
<UseVSHostingProcess>false</UseVSHostingProcess>
<XnaCompressContent>true</XnaCompressContent>
<DocumentationFile>bin\Xbox 360\Release\Nuclex.Support.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Xna.Framework">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Xna.Framework.Game">
<Private>False</Private>
</Reference>
<Reference Include="mscorlib">
<Private>False</Private>
</Reference>
<Reference Include="System">
<Private>False</Private>
</Reference>
<Reference Include="System.Xml">
<Private>False</Private>
</Reference>
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
<Private>False</Private>
</Reference>
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Source\AssertHelper.cs" />
<Compile Include="Source\AssertHelper.Test.cs">
<DependentUpon>AssertHelper.cs</DependentUpon>
</Compile>
<Compile Include="Source\Collections\ItemEventArgs.cs" />
<Compile Include="Source\Collections\ItemEventArgs.Test.cs">
<DependentUpon>ItemEventArgs.cs</DependentUpon>
</Compile>
<Compile Include="Source\Collections\ObservableCollection.cs" />
<Compile Include="Source\Collections\ObservableCollection.Test.cs">
<DependentUpon>ObservableCollection.cs</DependentUpon>
</Compile>
<Compile Include="Source\Collections\PairPriorityQueue.cs" />
<Compile Include="Source\Collections\PairPriorityQueue.Test.cs">
<DependentUpon>PairPriorityQueue.cs</DependentUpon>
</Compile>
<Compile Include="Source\Collections\Parentable.cs" />
<Compile Include="Source\Collections\Parentable.Test.cs">
<DependentUpon>Parentable.cs</DependentUpon>
</Compile>
<Compile Include="Source\Collections\ParentingCollection.cs" />
<Compile Include="Source\Collections\ParentingCollection.Test.cs">
<DependentUpon>ParentingCollection.cs</DependentUpon>
</Compile>
<Compile Include="Source\Collections\PriorityItemPair.cs" />
<Compile Include="Source\Collections\PriorityItemPair.Test.cs">
<DependentUpon>PriorityItemPair.cs</DependentUpon>
</Compile>
<Compile Include="Source\Collections\PriorityQueue.cs" />
<Compile Include="Source\Collections\PriorityQueue.Test.cs">
<DependentUpon>PriorityQueue.cs</DependentUpon>
</Compile>
<Compile Include="Source\Collections\ReadOnlyCollection.cs" />
<Compile Include="Source\Collections\ReadOnlyCollection.Test.cs">
<DependentUpon>ReadOnlyCollection.cs</DependentUpon>
</Compile>
<Compile Include="Source\Collections\ReadOnlyDictionary.cs" />
<Compile Include="Source\Collections\ReadOnlyDictionary.Test.cs">
<DependentUpon>ReadOnlyDictionary.cs</DependentUpon>
</Compile>
<Compile Include="Source\Collections\ReadOnlyList.cs" />
<Compile Include="Source\Collections\ReadOnlyList.Test.cs">
<DependentUpon>ReadOnlyList.cs</DependentUpon>
</Compile>
<Compile Include="Source\Collections\ReverseComparer.cs" />
<Compile Include="Source\Collections\ReverseComparer.Test.cs">
<DependentUpon>ReverseComparer.cs</DependentUpon>
</Compile>
<Compile Include="Source\Collections\RingMemoryStream.cs" />
<Compile Include="Source\Collections\RingMemoryStream.Test.cs">
<DependentUpon>RingMemoryStream.cs</DependentUpon>
</Compile>
<Compile Include="Source\Collections\TransformingReadOnlyCollection.cs" />
<Compile Include="Source\Collections\TransformingReadOnlyCollection.Interfaces.cs">
<DependentUpon>TransformingReadOnlyCollection.cs</DependentUpon>
</Compile>
<Compile Include="Source\Collections\TransformingReadOnlyCollection.Test.cs">
<DependentUpon>TransformingReadOnlyCollection.cs</DependentUpon>
</Compile>
<Compile Include="Source\FloatHelper.cs" />
<Compile Include="Source\FloatHelper.Test.cs">
<DependentUpon>FloatHelper.cs</DependentUpon>
</Compile>
<Compile Include="Source\IntegerHelper.cs" />
<Compile Include="Source\IntegerHelper.Test.cs">
<DependentUpon>IntegerHelper.cs</DependentUpon>
</Compile>
<Compile Include="Source\Licensing\LicenseKey.cs" />
<Compile Include="Source\Licensing\LicenseKey.Test.cs">
<DependentUpon>LicenseKey.cs</DependentUpon>
</Compile>
<Compile Include="Source\Parsing\CommandLine.Option.cs">
<DependentUpon>CommandLine.cs</DependentUpon>
</Compile>
<Compile Include="Source\Parsing\CommandLine.Formatter.cs">
<DependentUpon>CommandLine.cs</DependentUpon>
</Compile>
<Compile Include="Source\Parsing\CommandLine.Test.cs">
<DependentUpon>CommandLine.cs</DependentUpon>
</Compile>
<Compile Include="Source\Parsing\BrokenCommandLineParser.cs" />
<Compile Include="Source\Parsing\BrokenCommandLineParser.Test.cs">
<DependentUpon>BrokenCommandLineParser.cs</DependentUpon>
</Compile>
<Compile Include="Source\Parsing\CommandLine.cs" />
<Compile Include="Source\Parsing\CommandLine.Parser.cs">
<DependentUpon>CommandLine.cs</DependentUpon>
</Compile>
<Compile Include="Source\PathHelper.cs" />
<Compile Include="Source\PathHelper.Test.cs">
<DependentUpon>PathHelper.cs</DependentUpon>
</Compile>
<Compile Include="Source\Plugins\AssemblyLoadEventArgs.cs" />
<Compile Include="Source\Plugins\AssemblyLoadEventArgs.Test.cs">
<DependentUpon>AssemblyLoadEventArgs.cs</DependentUpon>
</Compile>
<Compile Include="Source\Plugins\IAbstractFactory.cs" />
<Compile Include="Source\Plugins\Employer.Test.cs">
<DependentUpon>Employer.cs</DependentUpon>
</Compile>
<Compile Include="Source\Plugins\FactoryEmployer.Test.cs">
<DependentUpon>FactoryEmployer.cs</DependentUpon>
</Compile>
<Compile Include="Source\Plugins\IAssemblyLoader.cs" />
<Compile Include="Source\Plugins\InstanceEmployer.Test.cs">
<DependentUpon>InstanceEmployer.cs</DependentUpon>
</Compile>
<Compile Include="Source\Plugins\NoPluginAttribute.cs" />
<Compile Include="Source\Plugins\Employer.cs" />
<Compile Include="Source\Plugins\FactoryEmployer.cs" />
<Compile Include="Source\Plugins\InstanceEmployer.cs" />
<Compile Include="Source\Plugins\NoPluginAttribute.Test.cs">
<DependentUpon>NoPluginAttribute.cs</DependentUpon>
</Compile>
<Compile Include="Source\Plugins\PluginHelper.cs" />
<Compile Include="Source\Plugins\PluginHelper.Test.cs">
<DependentUpon>PluginHelper.cs</DependentUpon>
</Compile>
<Compile Include="Source\Plugins\PluginHost.cs" />
<Compile Include="Source\Plugins\PluginHost.Test.cs">
<DependentUpon>PluginHost.cs</DependentUpon>
</Compile>
<Compile Include="Source\Plugins\PluginRepository.cs" />
<Compile Include="Source\Plugins\PluginRepository.Test.cs">
<DependentUpon>PluginRepository.cs</DependentUpon>
</Compile>
<Compile Include="Source\Scheduling\AbortedException.cs" />
<Compile Include="Source\Scheduling\AbortedException.Test.cs">
<DependentUpon>AbortedException.cs</DependentUpon>
</Compile>
<Compile Include="Source\Scheduling\IAbortable.cs" />
<Compile Include="Source\Scheduling\Operation.cs" />
<Compile Include="Source\Scheduling\Operation.Test.cs">
<DependentUpon>Operation.cs</DependentUpon>
</Compile>
<Compile Include="Source\Scheduling\OperationQueue.cs" />
<Compile Include="Source\Scheduling\OperationQueue.Test.cs">
<DependentUpon>OperationQueue.cs</DependentUpon>
</Compile>
<Compile Include="Source\Scheduling\ThreadCallbackOperation.cs" />
<Compile Include="Source\Scheduling\ThreadCallbackOperation.Test.cs">
<DependentUpon>ThreadCallbackOperation.cs</DependentUpon>
</Compile>
<Compile Include="Source\Scheduling\ThreadOperation.cs" />
<Compile Include="Source\Scheduling\ThreadOperation.Test.cs">
<DependentUpon>ThreadOperation.cs</DependentUpon>
</Compile>
<Compile Include="Source\Shared.cs" />
<Compile Include="Source\Shared.Test.cs">
<DependentUpon>Shared.cs</DependentUpon>
</Compile>
<Compile Include="Source\StringHelper.cs" />
<Compile Include="Source\StringHelper.Test.cs">
<DependentUpon>StringHelper.cs</DependentUpon>
</Compile>
<Compile Include="Source\StringSegment.cs" />
<Compile Include="Source\StringSegment.Test.cs">
<DependentUpon>StringSegment.cs</DependentUpon>
</Compile>
<Compile Include="Source\Tracking\IdleStateEventArgs.cs" />
<Compile Include="Source\Tracking\IdleStateEventArgs.Test.cs">
<DependentUpon>IdleStateEventArgs.cs</DependentUpon>
</Compile>
<Compile Include="Source\Tracking\Internal\ObservedWeightedTransaction.cs" />
<Compile Include="Source\Tracking\Internal\ObservedWeightedTransaction.Test.cs">
<DependentUpon>ObservedWeightedTransaction.cs</DependentUpon>
</Compile>
<Compile Include="Source\Tracking\Internal\WeightedTransactionWrapperCollection.cs" />
<Compile Include="Source\Tracking\Internal\WeightedTransactionWrapperCollection.Test.cs">
<DependentUpon>WeightedTransactionWrapperCollection.cs</DependentUpon>
</Compile>
<Compile Include="Source\Tracking\IProgressReporter.cs" />
<Compile Include="Source\Tracking\IStatusReporter.cs" />
<Compile Include="Source\Tracking\ProgressReportEventArgs.cs" />
<Compile Include="Source\Tracking\ProgressReportEventArgs.Test.cs">
<DependentUpon>ProgressReportEventArgs.cs</DependentUpon>
</Compile>
<Compile Include="Source\Tracking\ProgressTracker.cs" />
<Compile Include="Source\Tracking\ProgressTracker.Test.cs">
<DependentUpon>ProgressTracker.cs</DependentUpon>
</Compile>
<Compile Include="Source\Tracking\Request.cs" />
<Compile Include="Source\Tracking\Request.Test.cs">
<DependentUpon>Request.cs</DependentUpon>
</Compile>
<Compile Include="Source\Tracking\StatusReportEventArgs.Test.cs">
<DependentUpon>StatusReportEventArgs.cs</DependentUpon>
</Compile>
<Compile Include="Source\Tracking\Transaction.Test.cs">
<DependentUpon>Transaction.cs</DependentUpon>
</Compile>
<Compile Include="Source\Tracking\TransactionGroup.cs" />
<Compile Include="Source\Tracking\TransactionGroup.Test.cs">
<DependentUpon>TransactionGroup.cs</DependentUpon>
</Compile>
<Compile Include="Source\Tracking\StatusReportEventArgs.cs" />
<Compile Include="Source\Tracking\Transaction.cs" />
<Compile Include="Source\Tracking\WeightedTransaction.cs" />
<Compile Include="Source\Tracking\WeightedTransaction.Test.cs">
<DependentUpon>WeightedTransaction.cs</DependentUpon>
</Compile>
<Compile Include="Source\WeakReference.cs" />
<Compile Include="Source\WeakReference.Test.cs">
<DependentUpon>WeakReference.cs</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Content Include="Documents\CommandLine.txt" />
<Content Include="Documents\Nuclex.Support.txt" />
<Content Include="Documents\Request Framework.txt" />
</ItemGroup>
<ItemGroup>
<NestedContentProject Include="Content\Content.contentproj">
<Project>d5a9e893-70bf-4882-bcbd-c9b6b6054a0e</Project>
<Visible>False</Visible>
</NestedContentProject>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\Microsoft.Xna.GameStudio.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -139,6 +139,10 @@
<Compile Include="Source\PathHelper.Test.cs">
<DependentUpon>PathHelper.cs</DependentUpon>
</Compile>
<Compile Include="Source\Plugins\AssemblyLoadEventArgs.cs" />
<Compile Include="Source\Plugins\AssemblyLoadEventArgs.Test.cs">
<DependentUpon>AssemblyLoadEventArgs.cs</DependentUpon>
</Compile>
<Compile Include="Source\Plugins\IAbstractFactory.cs" />
<Compile Include="Source\Plugins\Employer.Test.cs">
<DependentUpon>Employer.cs</DependentUpon>

View File

@ -18,14 +18,14 @@ License along with this library
*/
#endregion
#if UNITTEST
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
#if UNITTEST
using NUnit.Framework;
namespace Nuclex.Support.Collections {

View File

@ -31,10 +31,14 @@ namespace Nuclex.Support.Collections {
/// <typeparam name="ValueType">Type of the values used in the Dictionary</typeparam>
[Serializable]
public class ReadOnlyDictionary<KeyType, ValueType> :
IDictionary<KeyType, ValueType>,
IDictionary,
#if !COMPACTFRAMEWORK
ISerializable,
IDeserializationCallback {
IDeserializationCallback,
#endif
IDictionary<KeyType, ValueType>,
IDictionary {
#if !COMPACTFRAMEWORK
#region class SerializedDictionary
@ -65,13 +69,6 @@ namespace Nuclex.Support.Collections {
#endregion // class SerializeDictionary
/// <summary>Initializes a new read-only Dictionary wrapper</summary>
/// <param name="dictionary">Dictionary that will be wrapped</param>
public ReadOnlyDictionary(IDictionary<KeyType, ValueType> dictionary) {
this.typedDictionary = dictionary;
this.objectDictionary = (this.typedDictionary as IDictionary);
}
/// <summary>
/// Initializes a new instance of the System.WeakReference class, using deserialized
/// data from the specified serialization and stream objects.
@ -90,6 +87,16 @@ namespace Nuclex.Support.Collections {
protected ReadOnlyDictionary(SerializationInfo info, StreamingContext context) :
this(new SerializedDictionary(info, context)) { }
#endif // !COMPACTFRAMEWORK
/// <summary>Initializes a new read-only Dictionary wrapper</summary>
/// <param name="dictionary">Dictionary that will be wrapped</param>
public ReadOnlyDictionary(IDictionary<KeyType, ValueType> dictionary) {
this.typedDictionary = dictionary;
this.objectDictionary = (this.typedDictionary as IDictionary);
}
/// <summary>Whether the directory is write-protected</summary>
public bool IsReadOnly {
get { return true; }
@ -360,6 +367,7 @@ namespace Nuclex.Support.Collections {
#endregion
#if !COMPACTFRAMEWORK
#region ISerializable implementation
/// <summary>Serializes the Dictionary</summary>
@ -380,6 +388,7 @@ namespace Nuclex.Support.Collections {
}
#endregion
#endif //!COMPACTFRAMEWORK
/// <summary>The wrapped Dictionary under its type-safe interface</summary>
private IDictionary<KeyType, ValueType> typedDictionary;

View File

@ -18,6 +18,8 @@ License along with this library
*/
#endregion
#if UNITTEST
using System;
using System.Collections.Generic;
@ -99,3 +101,5 @@ namespace Nuclex.Support {
}
} // namespace Nuclex.Support
#endif // UNITTEST

View File

@ -182,10 +182,10 @@ namespace Nuclex.Support.Licensing {
);
// Now build a nice, readable string from the decoded characters
resultBuilder.Insert(5, '-');
resultBuilder.Insert(11, '-');
resultBuilder.Insert(17, '-');
resultBuilder.Insert(23, '-');
resultBuilder.Insert(5, keyDelimiter, 0, 1);
resultBuilder.Insert(11, keyDelimiter, 0, 1);
resultBuilder.Insert(17, keyDelimiter, 0, 1);
resultBuilder.Insert(23, keyDelimiter, 0, 1);
return resultBuilder.ToString();
}
@ -215,6 +215,13 @@ namespace Nuclex.Support.Licensing {
}
}
/// <summary>Character used to delimit each 5 digit group in a license key</summary>
/// <remarks>
/// Required to be a char array because the .NET Compact Framework only provides
/// an overload for char[] in the StringBuilder.Insert() method.
/// </remarks>
private static char[] keyDelimiter = new char[] { '-' };
/// <summary>Table with the individual characters in a key</summary>
private static readonly string codeTable =
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";

View File

@ -0,0 +1,52 @@
#region CPL License
/*
Nuclex Framework
Copyright (C) 2002-2009 Nuclex Development Labs
This library is free software; you can redistribute it and/or
modify it under the terms of the IBM Common Public License as
published by the IBM Corporation; either version 1.0 of the
License, or (at your option) any later version.
This library 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
IBM Common Public License for more details.
You should have received a copy of the IBM Common Public
License along with this library
*/
#endregion
#if UNITTEST
using System;
using System.IO;
using System.Reflection;
using NUnit.Framework;
using NUnit.Framework.SyntaxHelpers;
namespace Nuclex.Support.Plugins {
/// <summary>Unit Test for the assembly load event argument container</summary>
[TestFixture]
public class AssemblyLoadEventArgsTest {
/// <summary>
/// Tests whether the argument container correctly stores an assembly reference
/// </summary>
[Test]
public void TestEmployerDefaultConstructorDetection() {
Assembly assembly = Assembly.GetExecutingAssembly();
AssemblyLoadEventArgs testArguments = new AssemblyLoadEventArgs(assembly);
Assert.AreSame(assembly, testArguments.LoadedAssembly);
}
}
} // namespace Nuclex.Support.Plugins
#endif // UNITTEST

View File

@ -0,0 +1,53 @@
#region CPL License
/*
Nuclex Framework
Copyright (C) 2002-2009 Nuclex Development Labs
This library is free software; you can redistribute it and/or
modify it under the terms of the IBM Common Public License as
published by the IBM Corporation; either version 1.0 of the
License, or (at your option) any later version.
This library 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
IBM Common Public License for more details.
You should have received a copy of the IBM Common Public
License along with this library
*/
#endregion
using System;
using System.Collections.Generic;
using System.Reflection;
namespace Nuclex.Support.Plugins {
/// <summary>Signature for the AssemblyLoad event</summary>
/// <param name="sender">Object that is reporting that an assembly was loaded</param>
/// <param name="arguments">Contains the loaded assembly</param>
public delegate void AssemblyLoadEventHandler(
object sender, AssemblyLoadEventArgs arguments
);
/// <summary>Argument container for the AssemblyLoad event arguments</summary>
public class AssemblyLoadEventArgs : EventArgs {
/// <summary>Initializes a new event argument container</summary>
/// <param name="loadedAssembly">Assembly that has been loaded</param>
public AssemblyLoadEventArgs(Assembly loadedAssembly) {
this.loadedAssembly = loadedAssembly;
}
/// <summary>Assembly that was loaded by the sender of the event</summary>
public Assembly LoadedAssembly {
get { return this.loadedAssembly; }
}
/// <summary>Loaded assembly that will be provided to the event receivers</summary>
private Assembly loadedAssembly;
}
} // namespace Nuclex.Support.Plugins

View File

@ -18,11 +18,11 @@ License along with this library
*/
#endregion
#if UNITTEST
using System;
using System.IO;
#if UNITTEST
using NUnit.Framework;
using NUnit.Framework.SyntaxHelpers;

View File

@ -50,7 +50,7 @@ namespace Nuclex.Support.Plugins {
/// <param name="path">Path the assembly will be loaded from</param>
/// <returns>The loaded assembly</returns>
protected virtual Assembly LoadAssemblyFromFile(string path) {
return Assembly.LoadFile(path);
return Assembly.LoadFrom(path);
}
/// <summary>Tries to loads an assembly from a file</summary>
@ -66,6 +66,7 @@ namespace Nuclex.Support.Plugins {
loadedAssembly = LoadAssemblyFromFile(path);
return true;
}
#if !COMPACTFRAMEWORK
// File not found - Most likely a missing dependency of the assembly we
// attempted to load since the assembly itself has been found by the GetFiles() method
catch(DllNotFoundException) {
@ -73,6 +74,7 @@ namespace Nuclex.Support.Plugins {
"Assembly '" + path + "' or one of its dependencies is missing"
);
}
#endif // !COMPACTFRAMEWORK
// Unauthorized acccess - Either the assembly is not trusted because it contains
// code that imposes a security risk on the system or a user rights problem
catch(UnauthorizedAccessException) {

View File

@ -18,12 +18,13 @@ License along with this library
*/
#endregion
#if UNITTEST
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
#if UNITTEST
using NUnit.Framework;
using NMock2;

View File

@ -43,6 +43,8 @@ namespace Nuclex.Support.Scheduling {
/// <param name="inner">Preceding exception that has caused this exception</param>
public AbortedException(string message, Exception inner) : base(message, inner) { }
#if !COMPACTFRAMEWORK
/// <summary>Initializes the exception from its serialized state</summary>
/// <param name="info">Contains the serialized fields of the exception</param>
/// <param name="context">Additional environmental informations</param>
@ -52,6 +54,8 @@ namespace Nuclex.Support.Scheduling {
)
: base(info, context) { }
#endif // !COMPACTFRAMEWORK
}
} // namespace Nuclex.Support.Scheduling

View File

@ -18,12 +18,13 @@ License along with this library
*/
#endregion
#if UNITTEST
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
#if UNITTEST
using NUnit.Framework;
using NMock2;

View File

@ -18,14 +18,14 @@ License along with this library
*/
#endregion
#if UNITTEST
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using System.Threading;
#if UNITTEST
using NUnit.Framework;
using NMock2;

View File

@ -18,12 +18,13 @@ License along with this library
*/
#endregion
#if UNITTEST
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
#if UNITTEST
using NUnit.Framework;
using NMock2;

View File

@ -57,9 +57,9 @@ namespace Nuclex.Support.Scheduling {
"Operations cannot be re-run"
);
if(useThreadPool) {
ThreadPool.QueueUserWorkItem(callMethod);
ThreadPool.QueueUserWorkItem(new WaitCallback(callMethod));
} else {
Thread thread = new Thread(callMethod);
Thread thread = new Thread(new ThreadStart(callMethod));
thread.Name = "Nuclex.Support.Scheduling.ThreadOperation";
thread.IsBackground = true;
thread.Start();
@ -72,6 +72,11 @@ namespace Nuclex.Support.Scheduling {
/// <summary>Invokes the delegate passed as an argument</summary>
/// <param name="state">Not used</param>
private void callMethod(object state) {
callMethod();
}
/// <summary>Invokes the delegate passed as an argument</summary>
private void callMethod() {
try {
Execute();
Debug.Assert(

View File

@ -127,6 +127,8 @@ namespace Nuclex.Support.Tracking {
WaitHandle.WaitOne();
}
#if !COMPACTFRAMEWORK
/// <summary>Waits until the background process finishes or a timeout occurs</summary>
/// <param name="timeout">
/// Time span after which to stop waiting and return immediately
@ -138,6 +140,8 @@ namespace Nuclex.Support.Tracking {
return WaitHandle.WaitOne(timeout, false);
}
#endif // !COMPACTFRAMEWORK
/// <summary>Waits until the background process finishes or a timeout occurs</summary>
/// <param name="timeoutMilliseconds">
/// Number of milliseconds after which to stop waiting and return immediately

View File

@ -18,12 +18,12 @@ License along with this library
*/
#endregion
#if UNITTEST
using System;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
#if UNITTEST
using NUnit.Framework;
using NUnit.Framework.SyntaxHelpers;

View File

@ -52,6 +52,8 @@ namespace Nuclex.Support {
public WeakReference(ReferencedType target, bool trackResurrection)
: base(target, trackResurrection) { }
#if !COMPACTFRAMEWORK
/// <summary>
/// Initializes a new instance of the WeakReference class, using deserialized
/// data from the specified serialization and stream objects.
@ -70,6 +72,8 @@ namespace Nuclex.Support {
protected WeakReference(SerializationInfo info, StreamingContext context)
: base(info, context) { }
#endif // !COMPACTFRAMEWORK
/// <summary>
/// Gets or sets the object (the target) referenced by the current WeakReference
/// object.