Improved documentation

git-svn-id: file:///srv/devel/repo-conversion/nusu@14 d2e56fa2-650e-0410-a79f-9358c0239efd
This commit is contained in:
Markus Ewald 2007-05-02 19:25:21 +00:00
parent 0008304d64
commit 88390bc38d
4 changed files with 47 additions and 19 deletions

View File

@ -144,6 +144,10 @@
<XNAUseContentPipeline>false</XNAUseContentPipeline> <XNAUseContentPipeline>false</XNAUseContentPipeline>
<Name>ObservedProgression</Name> <Name>ObservedProgression</Name>
</Compile> </Compile>
<Compile Include="Source\Tracking\ProgressionTracker.cs">
<XNAUseContentPipeline>false</XNAUseContentPipeline>
<Name>ProgressionTracker</Name>
</Compile>
<Compile Include="Source\Tracking\SetProgression.cs"> <Compile Include="Source\Tracking\SetProgression.cs">
<XNAUseContentPipeline>false</XNAUseContentPipeline> <XNAUseContentPipeline>false</XNAUseContentPipeline>
<Name>SetProgression</Name> <Name>SetProgression</Name>

View File

@ -6,13 +6,29 @@ using System.Threading;
namespace Nuclex.Support.Collections { namespace Nuclex.Support.Collections {
/// <summary>Collection transforming the contents of another collection.</summary> /// <summary>Collection that transforms the contents of another collection.</summary>
/// <typeparam name="ContainedItemType"> /// <typeparam name="ContainedItemType">
/// Type of the items contained in the wrapped collection. /// Type of the items contained in the wrapped collection.
/// </typeparam> /// </typeparam>
/// <typeparam name="ExposedItemType"> /// <typeparam name="ExposedItemType">
/// Type this collection exposes its items as. /// Type this collection exposes its items as.
/// </typeparam> /// </typeparam>
/// <remarks>
/// <para>
/// This collection is useful if you want to expose the objects of an arbitrary
/// collection under a different type. It can be used, for example, to construct
/// wrappers for the items in a collection on-the-fly, eliminating the need to
/// manage the wrappers in parallel to the real items and improving performance
/// by only constructing a wrapper when an item is actually requested.
/// </para>
/// <para>
/// Another common use would be if you have a private collection of a non-public
/// type that's derived from some publicly visible type. By using this collection,
/// you can return the items under the publicly visible type while still having
/// your private collection under the non-public type, eliminating the need to
/// downcast each time you need to access elements of the non-public type.
/// </para>
/// </remarks>
public abstract class TransformingReadOnlyCollection<ContainedItemType, ExposedItemType> : public abstract class TransformingReadOnlyCollection<ContainedItemType, ExposedItemType> :
IList<ExposedItemType>, IList { IList<ExposedItemType>, IList {
@ -241,23 +257,6 @@ namespace Nuclex.Support.Collections {
/// </remarks> /// </remarks>
protected abstract ExposedItemType Transform(ContainedItemType item); protected abstract ExposedItemType Transform(ContainedItemType item);
/// <summary>
/// Determines whether the object is compatible to the collection's data type.
/// </summary>
/// <param name="value">Object to check for compatibility.</param>
/// <returns>
/// True if the object is compatible to the collection's data type;
/// otherwise false.
/// </returns>
private static bool IsCompatibleObject(object value) {
if(!(value is ExposedItemType)) {
if((value != null) || typeof(ExposedItemType).IsValueType) {
return false;
}
}
return true;
}
#region IList<ExposedItemType> Members #region IList<ExposedItemType> Members
/// <summary> /// <summary>

View File

@ -8,7 +8,15 @@ namespace Nuclex.Support.Tracking {
public abstract class Operation : Progression { public abstract class Operation : Progression {
/// <summary>Executes the operation</summary> /// <summary>Executes the operation</summary>
public abstract void Execute(); public abstract void Start();
/// <summary>
/// Executes the operation synchronously, blocking the calling thread
/// </summary>
public virtual void Execute() {
Start();
WaitHandle.WaitOne();
}
} }

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Nuclex.Support.Tracking {
/*
public abstract class ProgressionTracker {
public void Track() {}
protected virtual void OnStartTracking();
protected virtual void OnEndTracking();
protected virtual void OnProgressUpdated();
}
*/
} // namespace Nuclex.Support.Tracking