You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-dev@logging.apache.org by ni...@apache.org on 2004/06/02 18:22:35 UTC
cvs commit: logging-log4net/src/Util OptionConverter.cs
nicko 2004/06/02 09:22:35
Modified: src/Util OptionConverter.cs
Log:
Updated parameter names in line with guidelines.
Revision Changes Path
1.5 +8 -8 logging-log4net/src/Util/OptionConverter.cs
Index: OptionConverter.cs
===================================================================
RCS file: /home/cvs/logging-log4net/src/Util/OptionConverter.cs,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- OptionConverter.cs 30 May 2004 10:50:09 -0000 1.4
+++ OptionConverter.cs 2 Jun 2004 16:22:35 -0000 1.5
@@ -353,26 +353,26 @@
/// <summary>
/// Converts an object to the target type.
/// </summary>
- /// <param name="sourceObject">The object to convert to the target type.</param>
+ /// <param name="sourceInstance">The object to convert to the target type.</param>
/// <param name="targetType">The type to convert to.</param>
/// <returns>The converted object.</returns>
- public static object ConvertTypeTo(object sourceObject, Type targetType)
+ public static object ConvertTypeTo(object sourceInstance, Type targetType)
{
- Type sourceType = sourceObject.GetType();
+ Type sourceType = sourceInstance.GetType();
// Check if we can assign directly from the source type to the target type
if (targetType.IsAssignableFrom(sourceType))
{
- return sourceObject;
+ return sourceInstance;
}
// Look for a TO converter
- IConvertTo tcSource = ConverterRegistry.GetConvertTo(sourceObject.GetType(), targetType);
+ IConvertTo tcSource = ConverterRegistry.GetConvertTo(sourceType, targetType);
if (tcSource != null)
{
if (tcSource.CanConvertTo(targetType))
{
- return tcSource.ConvertTo(sourceObject, targetType);
+ return tcSource.ConvertTo(sourceInstance, targetType);
}
}
@@ -382,11 +382,11 @@
{
if (tcTarget.CanConvertFrom(sourceType))
{
- return tcTarget.ConvertFrom(sourceObject);
+ return tcTarget.ConvertFrom(sourceInstance);
}
}
- throw new ArgumentException("Cannot convert source object [" + sourceObject.ToString() + "] to target type [" + targetType.Name + "]", "sourceObject");
+ throw new ArgumentException("Cannot convert source object [" + sourceInstance.ToString() + "] to target type [" + targetType.Name + "]", "sourceObject");
}
// /// <summary>