[Roam-commit] SF.net SVN: roam: [68] Trunk/Source
Status: Alpha
Brought to you by:
jonfroehlich
|
From: <jon...@us...> - 2007-03-21 07:24:51
|
Revision: 68
http://roam.svn.sourceforge.net/roam/?rev=68&view=rev
Author: jonfroehlich
Date: 2007-03-21 00:24:49 -0700 (Wed, 21 Mar 2007)
Log Message:
-----------
1. added some indexer helper functions to TypeUtils
2. added a todo comment to SmartListBox
Modified Paths:
--------------
Trunk/Source/Roam.Common/Utils/TypeUtils.cs
Trunk/Source/Roam.UI/Controls/SmartListBox.cs
Trunk/Source/Roam.suo
Modified: Trunk/Source/Roam.Common/Utils/TypeUtils.cs
===================================================================
--- Trunk/Source/Roam.Common/Utils/TypeUtils.cs 2007-03-12 09:27:15 UTC (rev 67)
+++ Trunk/Source/Roam.Common/Utils/TypeUtils.cs 2007-03-21 07:24:49 UTC (rev 68)
@@ -15,6 +15,7 @@
using System;
using System.Collections.Generic;
using System.Text;
+using System.Reflection;
namespace Roam.Common.Utils
{
@@ -102,5 +103,41 @@
/// <author>Jon Froehlich</author>
return strReturn + className;
}
+
+ public static IList<PropertyInfo> GetIndexerProperties(Type t)
+ {
+ List<PropertyInfo> indexerProperties = new List<PropertyInfo>();
+ foreach (PropertyInfo pi in t.GetProperties())
+ {
+ if (pi.GetIndexParameters().Length > 0)
+ {
+ indexerProperties.Add(pi);
+ }
+ }
+ return indexerProperties;
+ }
+
+ public static PropertyInfo GetIndexProperty(Type t, Type parameterType)
+ {
+ PropertyInfo bestMatch = null;
+ ParameterInfo[] bestMatchParams = null;
+ foreach (PropertyInfo pi in t.GetProperties())
+ {
+ ParameterInfo[] paramInfos = pi.GetIndexParameters();
+ if (paramInfos.Length == 1 &&
+ (paramInfos[0].ParameterType == parameterType ||
+ parameterType.IsSubclassOf(paramInfos[0].ParameterType)))
+ {
+ if (bestMatch == null || bestMatchParams[0].ParameterType != parameterType)
+ {
+ bestMatch = pi;
+ bestMatchParams = paramInfos;
+
+ if (bestMatchParams[0].ParameterType == parameterType) { break; }
+ }
+ }
+ }
+ return bestMatch;
+ }
}
}
Modified: Trunk/Source/Roam.UI/Controls/SmartListBox.cs
===================================================================
--- Trunk/Source/Roam.UI/Controls/SmartListBox.cs 2007-03-12 09:27:15 UTC (rev 67)
+++ Trunk/Source/Roam.UI/Controls/SmartListBox.cs 2007-03-21 07:24:49 UTC (rev 68)
@@ -892,6 +892,7 @@
}
}
+ //jeffixme : change the 0,0 to ClientRectangle.X and ClientRectangle.Y?
pe.Graphics.DrawImage(_bmpOffScreen, 0, 0);
g.Dispose();
Modified: Trunk/Source/Roam.suo
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|