springnet-commits Mailing List for Spring Framework .NET (Page 53)
Brought to you by:
aseovic,
markpollack
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(33) |
Aug
(163) |
Sep
(491) |
Oct
(289) |
Nov
(336) |
Dec
(84) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(227) |
Feb
(413) |
Mar
(128) |
Apr
(232) |
May
(92) |
Jun
(299) |
Jul
(386) |
Aug
(228) |
Sep
(237) |
Oct
(426) |
Nov
(325) |
Dec
(405) |
2006 |
Jan
(315) |
Feb
(311) |
Mar
(152) |
Apr
(177) |
May
(443) |
Jun
(92) |
Jul
(88) |
Aug
(80) |
Sep
(288) |
Oct
(515) |
Nov
(1049) |
Dec
(440) |
2007 |
Jan
(179) |
Feb
(406) |
Mar
(294) |
Apr
(80) |
May
(432) |
Jun
(242) |
Jul
(452) |
Aug
(710) |
Sep
(206) |
Oct
(240) |
Nov
(65) |
Dec
(227) |
2008 |
Jan
(80) |
Feb
(90) |
Mar
(98) |
Apr
(136) |
May
(101) |
Jun
(12) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Erich E. <oak...@us...> - 2007-08-27 13:57:54
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Objects/Factory/Xml In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv9622/Xml Modified Files: DefaultObjectDefinitionDocumentReader.cs XmlObjectDefinitionReader.cs XmlReaderContext.cs Log Message: added xml doc comments Index: DefaultObjectDefinitionDocumentReader.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Objects/Factory/Xml/DefaultObjectDefinitionDocumentReader.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** DefaultObjectDefinitionDocumentReader.cs 8 Aug 2007 17:47:13 -0000 1.7 --- DefaultObjectDefinitionDocumentReader.cs 27 Aug 2007 13:57:43 -0000 1.8 *************** *** 25,31 **** using System.IO; using System.Xml; - using Common.Logging; - using Spring.Core.IO; using Spring.Objects.Factory.Config; --- 25,29 ---- *************** *** 53,57 **** #region Constants - /// <summary> /// The shared <see cref="Common.Logging.ILog"/> instance for this class (and derived classes). --- 51,54 ---- *************** *** 94,98 **** #region Methods - /// <summary> /// Read object definitions from the given DOM element, and register --- 91,94 ---- *************** *** 116,124 **** --- 112,123 ---- #region Instrumentation + if (log.IsDebugEnabled) { log.Debug("Loading object definitions."); } + #endregion + XmlElement root = doc.DocumentElement; *************** *** 144,163 **** #endregion - } protected virtual void ParseObjectDefinitions(XmlElement root, ObjectDefinitionParserHelper helper) { ! foreach (XmlNode node in root.ChildNodes) { ! if (node.NodeType == XmlNodeType.Element) ! { ! XmlElement element = (XmlElement) node; ! INamespaceParser parser = GetNamespaceParser(element, helper); ! ParserContext parserContext = new ParserContext(helper.ReaderContext, helper); ! parser.ParseElement(element, parserContext); ! } } ! } --- 143,160 ---- #endregion } protected virtual void ParseObjectDefinitions(XmlElement root, ObjectDefinitionParserHelper helper) { ! foreach (XmlNode node in root.ChildNodes) ! { ! if (node.NodeType == XmlNodeType.Element) { ! XmlElement element = (XmlElement) node; ! INamespaceParser parser = GetNamespaceParser(element, helper); ! ParserContext parserContext = new ParserContext(helper.ReaderContext, helper); ! parser.ParseElement(element, parserContext); } ! } } *************** *** 201,206 **** { log.Debug(string.Format( ! CultureInfo.InvariantCulture, ! "Attempting to import object definitions from '{0}'.", location)); } --- 198,203 ---- { log.Debug(string.Format( ! CultureInfo.InvariantCulture, ! "Attempting to import object definitions from '{0}'.", location)); } *************** *** 213,219 **** { ReaderContext.ReportException(resource, null, string.Format( ! CultureInfo.InvariantCulture, ! "Invalid relative resource location '{0}' to import object definitions from.", ! location), ex); } } --- 210,216 ---- { ReaderContext.ReportException(resource, null, string.Format( ! CultureInfo.InvariantCulture, ! "Invalid relative resource location '{0}' to import object definitions from.", ! location), ex); } } *************** *** 239,243 **** protected virtual void RegisterObjectDefinition(XmlElement element, ObjectDefinitionParserHelper helper) { - ObjectDefinitionHolder holder = null; try --- 236,239 ---- *************** *** 254,258 **** catch (Exception ex) { ! throw new ObjectDefinitionStoreException(string.Format("Failed parsing object definition '{0}'", element.OuterXml), ex); } --- 250,255 ---- catch (Exception ex) { ! throw new ObjectDefinitionStoreException( ! string.Format("Failed parsing object definition '{0}'", element.OuterXml), ex); } *************** *** 287,291 **** protected virtual void PostProcessXml(XmlElement root) { - } --- 284,287 ---- *************** *** 305,311 **** protected virtual void PreProcessXml(XmlElement root) { - } protected virtual ObjectDefinitionParserHelper CreateHelper(XmlReaderContext readerContext, XmlElement root) { --- 301,312 ---- protected virtual void PreProcessXml(XmlElement root) { } + /// <summary> + /// Creates an <see cref="ObjectDefinitionParserHelper"/> instance for the given <paramref name="readerContext"/> and <paramref name="root"/> element. + /// </summary> + /// <param name="readerContext">the <see cref="XmlReaderContext"/> to create the <see cref="ObjectDefinitionParserHelper"/> </param> + /// <param name="root">the root <see cref="XmlElement"/> to start reading from</param> + /// <returns>a new <see cref="ObjectDefinitionParserHelper"/> instance</returns> protected virtual ObjectDefinitionParserHelper CreateHelper(XmlReaderContext readerContext, XmlElement root) { *************** *** 330,335 **** } - - #endregion } --- 331,334 ---- Index: XmlObjectDefinitionReader.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Objects/Factory/Xml/XmlObjectDefinitionReader.cs,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** XmlObjectDefinitionReader.cs 8 Aug 2007 17:47:13 -0000 1.31 --- XmlObjectDefinitionReader.cs 27 Aug 2007 13:57:43 -0000 1.32 *************** *** 311,314 **** --- 311,320 ---- } + /// <summary> + /// Creates the <see cref="XmlReaderContext"/> to be passed along + /// during the object definition reading process. + /// </summary> + /// <param name="resource">The underlying <see cref="IResource"/> that is currently processed.</param> + /// <returns>A new <see cref="XmlReaderContext"/></returns> protected virtual XmlReaderContext CreateReaderContext(IResource resource) { Index: XmlReaderContext.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Objects/Factory/Xml/XmlReaderContext.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** XmlReaderContext.cs 8 Aug 2007 17:47:13 -0000 1.5 --- XmlReaderContext.cs 27 Aug 2007 13:57:43 -0000 1.6 *************** *** 30,37 **** { /// <summary> ! /// Extenstion of <see cref="ReaderContext"/> specific to use with an /// XmlObjectDefinitionReader. /// </summary> /// <remarks>In future will contain access to IXmlParserRegistry</remarks> public class XmlReaderContext : ReaderContext { --- 30,38 ---- { /// <summary> ! /// Extension of <see cref="ReaderContext"/> specific to use with an /// XmlObjectDefinitionReader. /// </summary> /// <remarks>In future will contain access to IXmlParserRegistry</remarks> + /// <version>$Id$</version> public class XmlReaderContext : ReaderContext { |
From: Erich E. <oak...@us...> - 2007-08-27 13:57:37
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Core/TypeConversion In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv9586 Modified Files: ResourceManagerConverter.cs Log Message: added xml doc comments Index: ResourceManagerConverter.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Core/TypeConversion/ResourceManagerConverter.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ResourceManagerConverter.cs 25 Aug 2007 10:53:25 -0000 1.3 --- ResourceManagerConverter.cs 27 Aug 2007 13:57:34 -0000 1.4 *************** *** 38,41 **** --- 38,44 ---- public class ResourceManagerConverter : TypeConverter { + /// <summary> + /// This constant represents the name of the folder/assembly containing global resources. + /// </summary> public static readonly string APP_GLOBALRESOURCES_ASSEMBLYNAME = "App_GlobalResources"; |
From: Erich E. <oak...@us...> - 2007-08-27 13:57:33
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Context/Support In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv9550 Modified Files: StaticMessageSource.cs Log Message: added xml doc comments Index: StaticMessageSource.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Context/Support/StaticMessageSource.cs,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** StaticMessageSource.cs 27 Aug 2007 09:38:31 -0000 1.15 --- StaticMessageSource.cs 27 Aug 2007 13:57:27 -0000 1.16 *************** *** 136,140 **** } #else ! throw new NotSupportedException("Operation not supported in .NET 1.0 Release."); #endif } --- 136,140 ---- } #else ! throw new System.NotSupportedException("Operation not supported in .NET 1.0 Release."); #endif } |
From: Erich E. <oak...@us...> - 2007-08-27 13:57:24
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Util In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv9486/Util Modified Files: ReflectionUtils.cs Log Message: added xml doc comments Index: ReflectionUtils.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Util/ReflectionUtils.cs,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** ReflectionUtils.cs 22 Aug 2007 08:49:46 -0000 1.48 --- ReflectionUtils.cs 27 Aug 2007 13:57:18 -0000 1.49 *************** *** 48,53 **** /// </summary> public const BindingFlags AllMembersCaseInsensitiveFlags = BindingFlags.Public | ! BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static ! | BindingFlags.IgnoreCase; /// <summary> --- 48,54 ---- /// </summary> public const BindingFlags AllMembersCaseInsensitiveFlags = BindingFlags.Public | ! BindingFlags.NonPublic | BindingFlags.Instance ! | BindingFlags.Static ! | BindingFlags.IgnoreCase; /// <summary> *************** *** 97,102 **** method, ReflectionUtils.AllMembersCaseInsensitiveFlags, ! null, argumentTypes == null ? ! Type.EmptyTypes : argumentTypes , null); if (retMethod == null) { --- 98,105 ---- method, ReflectionUtils.AllMembersCaseInsensitiveFlags, ! null, ! argumentTypes == null ? Type.EmptyTypes : argumentTypes, ! null); ! if (retMethod == null) { *************** *** 149,187 **** #if NET_2_0 ! /// <summary> ! /// Returns an array of <see langword="string"/>s that represent ! /// the names of the generic type parameter. ! /// </summary> ! /// <param name="method">The method.</param> ! /// <returns>An array containing the parameter names.</returns> ! /// <exception cref="System.ArgumentNullException"> ! /// If <paramref name="method"/> is <see langword="null"/>. ! /// </exception> ! public static string[] GetGenericParameterNames(MethodInfo method) ! { ! AssertUtils.ArgumentNotNull(method, "method"); ! return GetGenericParameterNames(method.GetGenericArguments()); ! } ! /// <summary> ! /// Returns an array of <see langword="string"/>s that represent ! /// the names of the generic type parameter. ! /// </summary> ! /// <param name="args">The parameter info array.</param> ! /// <returns>An array containing parameter names.</returns> ! /// <exception cref="System.ArgumentNullException"> ! /// If <paramref name="args"/> is <see langword="null"/> or any of the ! /// elements <paramref name="args"/> is <see langword="null"/>. ! /// </exception> ! public static string[] GetGenericParameterNames(Type[] args) ! { ! AssertUtils.ArgumentNotNull(args, "args"); ! string[] names = new string[args.Length]; ! for (int i = 0; i < args.Length; i++) ! { ! names[i] = args[i].Name; ! } ! return names; ! } #endif --- 152,190 ---- #if NET_2_0 ! /// <summary> ! /// Returns an array of <see langword="string"/>s that represent ! /// the names of the generic type parameter. ! /// </summary> ! /// <param name="method">The method.</param> ! /// <returns>An array containing the parameter names.</returns> ! /// <exception cref="System.ArgumentNullException"> ! /// If <paramref name="method"/> is <see langword="null"/>. ! /// </exception> ! public static string[] GetGenericParameterNames(MethodInfo method) ! { ! AssertUtils.ArgumentNotNull(method, "method"); ! return GetGenericParameterNames(method.GetGenericArguments()); ! } ! /// <summary> ! /// Returns an array of <see langword="string"/>s that represent ! /// the names of the generic type parameter. ! /// </summary> ! /// <param name="args">The parameter info array.</param> ! /// <returns>An array containing parameter names.</returns> ! /// <exception cref="System.ArgumentNullException"> ! /// If <paramref name="args"/> is <see langword="null"/> or any of the ! /// elements <paramref name="args"/> is <see langword="null"/>. ! /// </exception> ! public static string[] GetGenericParameterNames(Type[] args) ! { ! AssertUtils.ArgumentNotNull(args, "args"); ! string[] names = new string[args.Length]; ! for (int i = 0; i < args.Length; i++) ! { ! names[i] = args[i].Name; ! } ! return names; ! } #endif *************** *** 236,377 **** } ! public static MethodInfo GetMethodByArgumentValues(MethodInfo[] methods, object[] argValues) ! { ! return (MethodInfo) GetMethodBaseByArgumentValues("method", methods, argValues); ! } ! public static ConstructorInfo GetConstructorByArgumentValues(ConstructorInfo[] methods, object[] argValues) ! { ! return (ConstructorInfo)GetMethodBaseByArgumentValues("constructr", methods, argValues); ! } - private static MethodBase GetMethodBaseByArgumentValues(string methodTypeName, MethodBase[] methods, object[] argValues) - { - MethodBase match = null; - int matchCount = 0; ! foreach (MethodBase m in methods) ! { ! ParameterInfo[] parameters = m.GetParameters(); ! bool isMatch = true; ! bool isExactMatch = true; ! object[] paramValues = argValues; ! try ! { ! if (parameters.Length > 0) ! { ! ParameterInfo lastParameter = parameters[parameters.Length - 1]; ! if (lastParameter.GetCustomAttributes(typeof(ParamArrayAttribute), false).Length > 0) ! { ! paramValues = ! PackageParamArray(argValues, parameters.Length, ! lastParameter.ParameterType.GetElementType()); ! } ! } ! for (int i = 0; i < parameters.Length; i++) ! { ! Type paramType = parameters[i].ParameterType; ! object paramValue = paramValues[i]; ! if ( (paramValue == null && paramType.IsValueType) ! || (paramValue != null && !paramType.IsAssignableFrom(paramValue.GetType())) ) ! { ! isMatch = false; ! break; ! } ! if ( paramValue == null || paramType != paramValue.GetType()) ! { ! isExactMatch = false; ! } ! } ! } ! catch (InvalidCastException) ! { ! isMatch = false; ! } ! if (isMatch) ! { ! if (isExactMatch) ! { ! return m; ! } ! matchCount++; ! if (matchCount == 1) ! { ! match = m; ! } ! else ! { ! throw new AmbiguousMatchException(string.Format("Ambiguous match for {0} '{1}' for the specified number and types of arguments.", methodTypeName, m.Name)); ! } ! } ! } ! return match; ! } ! /// <summary> ! /// Packages arguments into argument list containing parameter array as a last argument. ! /// </summary> ! /// <param name="argValues">Argument vaklues to package.</param> ! /// <param name="argCount">Total number of oarameters.</param> ! /// <param name="elementType">Type of the param array element.</param> ! /// <returns>Packaged arguments.</returns> ! public static object[] PackageParamArray(object[] argValues, int argCount, Type elementType) ! { ! object[] values = new object[argCount]; ! int i = 0; ! // copy regular arguments ! while (i < argCount - 1) ! { ! values[i] = argValues[i]; ! i++; ! } ! // package param array into last argument ! Array paramArray = Array.CreateInstance(elementType, argValues.Length - i); ! int j = 0; ! while (i < argValues.Length) ! { ! paramArray.SetValue(argValues[i++], j++); ! } ! values[values.Length - 1] = paramArray; ! return values; ! } ! /// <summary> ! /// Convenience method to convert an interface <see cref="System.Type"/> ! /// to a <see cref="System.Type"/> array that contains ! /// all the interfaces inherited and the specified interface. ! /// </summary> ! /// <param name="intf">The interface to convert.</param> ! /// <returns>An array of interface <see cref="System.Type"/>s.</returns> ! /// <exception cref="System.ArgumentException"> ! /// If the <see cref="System.Type"/> specified is not an interface. ! /// </exception> ! /// <exception cref="System.ArgumentNullException"> ! /// If <paramref name="intf"/> is <see langword="null"/>. ! /// </exception> ! public static Type[] ToInterfaceArray(Type intf) ! { ! AssertUtils.ArgumentNotNull(intf, "intf"); ! if (!intf.IsInterface) ! { ! throw new ArgumentException( ! string.Format(CultureInfo.InvariantCulture, ! "[{0}] is a class.", ! intf.FullName)); ! } ! ArrayList interfaces = new ArrayList(intf.GetInterfaces()); ! interfaces.Add(intf); ! return (Type[])interfaces.ToArray(typeof(Type)); ! } /// <summary> --- 239,413 ---- } ! /// <summary> ! /// From a given list of methods, selects the method having an exact match on the given <paramref name="argValues"/>' types. ! /// </summary> ! /// <param name="methods">the list of methods to choose from</param> ! /// <param name="argValues">the arguments to the method</param> ! /// <returns>the method matching exactly the passed <paramref name="argValues"/>' types</returns> ! /// <exception cref="AmbiguousMatchException"> ! /// If more than 1 matching methods are found in the <paramref name="methods"/> list. ! /// </exception> ! public static MethodInfo GetMethodByArgumentValues(MethodInfo[] methods, object[] argValues) ! { ! return (MethodInfo) GetMethodBaseByArgumentValues("method", methods, argValues); ! } ! /// <summary> ! /// From a given list of constructors, selects the constructor having an exact match on the given <paramref name="argValues"/>' types. ! /// </summary> ! /// <param name="methods">the list of constructors to choose from</param> ! /// <param name="argValues">the arguments to the method</param> ! /// <returns>the constructor matching exactly the passed <paramref name="argValues"/>' types</returns> ! /// <exception cref="AmbiguousMatchException"> ! /// If more than 1 matching methods are found in the <paramref name="methods"/> list. ! /// </exception> ! public static ConstructorInfo GetConstructorByArgumentValues(ConstructorInfo[] methods, object[] argValues) ! { ! return (ConstructorInfo) GetMethodBaseByArgumentValues("constructor", methods, argValues); ! } ! /// <summary> ! /// From a given list of methods, selects the method having an exact match on the given <paramref name="argValues"/>' types. ! /// </summary> ! /// <param name="methodTypeName">the type of method (used for exception reporting only)</param> ! /// <param name="methods">the list of methods to choose from</param> ! /// <param name="argValues">the arguments to the method</param> ! /// <returns>the method matching exactly the passed <paramref name="argValues"/>' types</returns> ! /// <exception cref="AmbiguousMatchException"> ! /// If more than 1 matching methods are found in the <paramref name="methods"/> list. ! /// </exception> ! private static MethodBase GetMethodBaseByArgumentValues(string methodTypeName, MethodBase[] methods, ! object[] argValues) ! { ! MethodBase match = null; ! int matchCount = 0; ! foreach (MethodBase m in methods) ! { ! ParameterInfo[] parameters = m.GetParameters(); ! bool isMatch = true; ! bool isExactMatch = true; ! object[] paramValues = argValues; ! try ! { ! if (parameters.Length > 0) ! { ! ParameterInfo lastParameter = parameters[parameters.Length - 1]; ! if (lastParameter.GetCustomAttributes(typeof(ParamArrayAttribute), false).Length > 0) ! { ! paramValues = ! PackageParamArray(argValues, parameters.Length, ! lastParameter.ParameterType.GetElementType()); ! } ! } ! for (int i = 0; i < parameters.Length; i++) ! { ! Type paramType = parameters[i].ParameterType; ! object paramValue = paramValues[i]; ! if ((paramValue == null && paramType.IsValueType) ! || (paramValue != null && !paramType.IsAssignableFrom(paramValue.GetType()))) ! { ! isMatch = false; ! break; ! } ! if (paramValue == null || paramType != paramValue.GetType()) ! { ! isExactMatch = false; ! } ! } ! } ! catch (InvalidCastException) ! { ! isMatch = false; ! } ! if (isMatch) ! { ! if (isExactMatch) ! { ! return m; ! } ! matchCount++; ! if (matchCount == 1) ! { ! match = m; ! } ! else ! { ! throw new AmbiguousMatchException( ! string.Format("Ambiguous match for {0} '{1}' for the specified number and types of arguments.", methodTypeName, ! m.Name)); ! } ! } ! } ! return match; ! } ! /// <summary> ! /// Packages arguments into argument list containing parameter array as a last argument. ! /// </summary> ! /// <param name="argValues">Argument vaklues to package.</param> ! /// <param name="argCount">Total number of oarameters.</param> ! /// <param name="elementType">Type of the param array element.</param> ! /// <returns>Packaged arguments.</returns> ! public static object[] PackageParamArray(object[] argValues, int argCount, Type elementType) ! { ! object[] values = new object[argCount]; ! int i = 0; ! // copy regular arguments ! while (i < argCount - 1) ! { ! values[i] = argValues[i]; ! i++; ! } ! // package param array into last argument ! Array paramArray = Array.CreateInstance(elementType, argValues.Length - i); ! int j = 0; ! while (i < argValues.Length) ! { ! paramArray.SetValue(argValues[i++], j++); ! } ! values[values.Length - 1] = paramArray; ! return values; ! } ! /// <summary> ! /// Convenience method to convert an interface <see cref="System.Type"/> ! /// to a <see cref="System.Type"/> array that contains ! /// all the interfaces inherited and the specified interface. ! /// </summary> ! /// <param name="intf">The interface to convert.</param> ! /// <returns>An array of interface <see cref="System.Type"/>s.</returns> ! /// <exception cref="System.ArgumentException"> ! /// If the <see cref="System.Type"/> specified is not an interface. ! /// </exception> ! /// <exception cref="System.ArgumentNullException"> ! /// If <paramref name="intf"/> is <see langword="null"/>. ! /// </exception> ! public static Type[] ToInterfaceArray(Type intf) ! { ! AssertUtils.ArgumentNotNull(intf, "intf"); ! if (!intf.IsInterface) ! { ! throw new ArgumentException( ! string.Format(CultureInfo.InvariantCulture, ! "[{0}] is a class.", ! intf.FullName)); ! } ! ! ArrayList interfaces = new ArrayList(intf.GetInterfaces()); ! interfaces.Add(intf); ! ! return (Type[]) interfaces.ToArray(typeof(Type)); ! } /// <summary> *************** *** 394,410 **** public static bool PropertyIsIndexer(string propertyName, Type type) { ! DefaultMemberAttribute[] attribs = (DefaultMemberAttribute[]) type.GetCustomAttributes(typeof(DefaultMemberAttribute), true); ! if (attribs.Length != 0) ! { ! foreach (DefaultMemberAttribute attrib in attribs) ! { ! if (attrib.MemberName.Equals(propertyName)) ! { ! return true; ! } ! } ! } ! return false; ! } /// <summary> --- 430,447 ---- public static bool PropertyIsIndexer(string propertyName, Type type) { ! DefaultMemberAttribute[] attribs = ! (DefaultMemberAttribute[]) type.GetCustomAttributes(typeof(DefaultMemberAttribute), true); ! if (attribs.Length != 0) ! { ! foreach (DefaultMemberAttribute attrib in attribs) ! { ! if (attrib.MemberName.Equals(propertyName)) ! { ! return true; ! } ! } ! } ! return false; ! } /// <summary> *************** *** 485,497 **** return null; } ! if (type == typeof (Boolean)) { return false; } ! if (type == typeof (DateTime)) { return DateTime.MinValue; } ! if (type == typeof (Char)) { return Char.MinValue; --- 522,534 ---- return null; } ! if (type == typeof(Boolean)) { return false; } ! if (type == typeof(DateTime)) { return DateTime.MinValue; } ! if (type == typeof(Char)) { return Char.MinValue; *************** *** 609,613 **** { object arg = args[i]; ! paramsType[i] = (arg != null) ? args[i].GetType() : typeof (object); } return paramsType; --- 646,650 ---- { object arg = args[i]; ! paramsType[i] = (arg != null) ? args[i].GetType() : typeof(object); } return paramsType; *************** *** 637,658 **** public static bool HasAtLeastOneMethodWithName(Type type, string name) { ! if (type == null || StringUtils.IsNullOrEmpty(name)) ! { ! return false; ! } return MethodCountForName(type, name) > 0; } ! public static int MethodCountForName(Type type, string name) ! { ! AssertUtils.ArgumentNotNull(type, "type", "Type must not be null"); ! AssertUtils.ArgumentNotNull(name, "name", "Method name must not be null"); ! MemberInfo[] methods = type.FindMembers( ! MemberTypes.Method, ! ReflectionUtils.AllMembersCaseInsensitiveFlags, ! new MemberFilter(ReflectionUtils.MethodNameFilter), ! name); ! return methods.Length; ! } private static bool MethodNameFilter(MemberInfo member, object criteria) --- 674,701 ---- public static bool HasAtLeastOneMethodWithName(Type type, string name) { ! if (type == null || StringUtils.IsNullOrEmpty(name)) ! { ! return false; ! } return MethodCountForName(type, name) > 0; } ! /// <summary> ! /// Within <paramref name="type"/>, counts the number of overloads for the method with the given (case-insensitive!) <paramref name="name"/> ! /// </summary> ! /// <param name="type">The type to be searched</param> ! /// <param name="name">the name of the method for which overloads shall be counted</param> ! /// <returns>The number of overloads for method <paramref name="name"/> within type <paramref name="type"/></returns> ! public static int MethodCountForName(Type type, string name) ! { ! AssertUtils.ArgumentNotNull(type, "type", "Type must not be null"); ! AssertUtils.ArgumentNotNull(name, "name", "Method name must not be null"); ! MemberInfo[] methods = type.FindMembers( ! MemberTypes.Method, ! ReflectionUtils.AllMembersCaseInsensitiveFlags, ! new MemberFilter(ReflectionUtils.MethodNameFilter), ! name); ! return methods.Length; ! } private static bool MethodNameFilter(MemberInfo member, object criteria) *************** *** 701,705 **** AssertUtils.ArgumentNotNull(type, "type"); ! if (!typeof (Attribute).IsAssignableFrom(type)) { throw new ArgumentException( --- 744,748 ---- AssertUtils.ArgumentNotNull(type, "type"); ! if (!typeof(Attribute).IsAssignableFrom(type)) { throw new ArgumentException( *************** *** 710,777 **** #endregion ! ConstructorInfo ci = type.GetConstructor(ReflectionUtils.GetTypes(ctorArgs)); ! if (ci == null && ctorArgs.Length == 0) ! { ! ci = type.GetConstructors()[0]; ! ctorArgs = GetDefaultValues(GetParameterTypes(ci.GetParameters())); ! } if (sourceAttribute != null) { ! object defaultAttribute = null; ! try ! { ! defaultAttribute = ci.Invoke(ctorArgs); ! } ! catch { } ! ! IList getSetProps = new ArrayList(); ! IList getSetValues = new ArrayList(); ! IList readOnlyProps = new ArrayList(); foreach (PropertyInfo pi in type.GetProperties(BindingFlags.Instance | BindingFlags.Public)) { ! if (pi.DeclaringType == typeof(Attribute)) ! continue; if (pi.CanRead) { ! if (pi.CanWrite) ! { ! object propValue = pi.GetValue(sourceAttribute, null); ! if (defaultAttribute != null) ! { ! object defaultValue = pi.GetValue(defaultAttribute, null); ! if ((propValue == null && defaultValue == null) || ! (propValue != null && propValue.Equals(defaultValue))) ! continue; ! } ! getSetProps.Add(pi); ! getSetValues.Add(propValue); ! } ! else ! { ! readOnlyProps.Add(pi); ! } } } ! if (readOnlyProps.Count == 1) ! { ! PropertyInfo pi = readOnlyProps[0] as PropertyInfo; ! ConstructorInfo ciTemp = type.GetConstructor(new Type[1] { pi.PropertyType }); ! if (ciTemp != null) ! { ! ci = ciTemp; ! ctorArgs = new object[1] { pi.GetValue(sourceAttribute, null) }; ! } ! } ! PropertyInfo[] propertyInfos = new PropertyInfo[getSetProps.Count]; ! getSetProps.CopyTo(propertyInfos, 0); object[] propertyValues = new object[getSetValues.Count]; ! getSetValues.CopyTo(propertyValues, 0); ! return new CustomAttributeBuilder(ci, ctorArgs, propertyInfos, propertyValues); } else --- 753,822 ---- #endregion ! ConstructorInfo ci = type.GetConstructor(ReflectionUtils.GetTypes(ctorArgs)); ! if (ci == null && ctorArgs.Length == 0) ! { ! ci = type.GetConstructors()[0]; ! ctorArgs = GetDefaultValues(GetParameterTypes(ci.GetParameters())); ! } if (sourceAttribute != null) { ! object defaultAttribute = null; ! try ! { ! defaultAttribute = ci.Invoke(ctorArgs); ! } ! catch ! { ! } ! ! IList getSetProps = new ArrayList(); ! IList getSetValues = new ArrayList(); ! IList readOnlyProps = new ArrayList(); foreach (PropertyInfo pi in type.GetProperties(BindingFlags.Instance | BindingFlags.Public)) { ! if (pi.DeclaringType == typeof(Attribute)) ! continue; if (pi.CanRead) { ! if (pi.CanWrite) ! { ! object propValue = pi.GetValue(sourceAttribute, null); ! if (defaultAttribute != null) ! { ! object defaultValue = pi.GetValue(defaultAttribute, null); ! if ((propValue == null && defaultValue == null) || ! (propValue != null && propValue.Equals(defaultValue))) ! continue; ! } ! getSetProps.Add(pi); ! getSetValues.Add(propValue); ! } ! else ! { ! readOnlyProps.Add(pi); ! } } } ! if (readOnlyProps.Count == 1) ! { ! PropertyInfo pi = readOnlyProps[0] as PropertyInfo; ! ConstructorInfo ciTemp = type.GetConstructor(new Type[1] {pi.PropertyType}); ! if (ciTemp != null) ! { ! ci = ciTemp; ! ctorArgs = new object[1] {pi.GetValue(sourceAttribute, null)}; ! } ! } ! PropertyInfo[] propertyInfos = new PropertyInfo[getSetProps.Count]; ! getSetProps.CopyTo(propertyInfos, 0); object[] propertyValues = new object[getSetValues.Count]; ! getSetValues.CopyTo(propertyValues, 0); ! return new CustomAttributeBuilder(ci, ctorArgs, propertyInfos, propertyValues); } else *************** *** 916,921 **** #if NET_2_0 ! private static readonly MethodInfo Exception_InternalPreserveStackTrace = ! typeof(Exception).GetMethod("InternalPreserveStackTrace", BindingFlags.Instance | BindingFlags.NonPublic); #else private static readonly FieldInfo Exception_RemoteStackTraceString = --- 961,966 ---- #if NET_2_0 ! private static readonly MethodInfo Exception_InternalPreserveStackTrace = ! typeof(Exception).GetMethod("InternalPreserveStackTrace", BindingFlags.Instance | BindingFlags.NonPublic); #else private static readonly FieldInfo Exception_RemoteStackTraceString = *************** *** 923,990 **** #endif ! /// <summary> ! /// Unwraps the supplied <see cref="System.Reflection.TargetInvocationException"/> ! /// and returns the inner exception preserving the stack trace. ! /// </summary> ! /// <param name="ex"> ! /// The <see cref="System.Reflection.TargetInvocationException"/> to unwrap. ! /// </param> ! /// <returns>The unwrapped exception.</returns> ! public static Exception UnwrapTargetInvocationException(TargetInvocationException ex) ! { #if NET_2_0 ! Exception_InternalPreserveStackTrace.Invoke(ex.InnerException, new Object[] { }); #else Exception_RemoteStackTraceString.SetValue(ex.InnerException, ex.InnerException.StackTrace + Environment.NewLine); #endif ! return ex.InnerException; ! } ! /// <summary> ! /// Is the supplied <paramref name="type"/> can be accessed outside the assembly ? ! /// </summary> ! /// <param name="type">The type to check.</param> ! /// <returns> ! /// <see langword="true"/> if the type can be accessed outside the assembly; ! /// Otherwise <see langword="false"/>. ! /// </returns> ! public static bool IsTypeVisible(Type type) ! { ! return IsTypeVisible(type, null); ! } ! /// <summary> ! /// Is the supplied <paramref name="type"/> can be accessed ! /// from the supplied friendly assembly ? ! /// </summary> ! /// <param name="type">The type to check.</param> ! /// <param name="friendlyAssemblyName">The friendly assembly name.</param> ! /// <returns> ! /// <see langword="true"/> if the type can be accessed ! /// from the supplied friendly assembly; Otherwise <see langword="false"/>. ! /// </returns> ! public static bool IsTypeVisible(Type type, string friendlyAssemblyName) ! { #if NET_2_0 ! if (type.IsVisible) ! { ! return true; ! } ! else ! { ! if (!StringUtils.IsNullOrEmpty(friendlyAssemblyName) && ! (!type.IsNested || type.IsNestedPublic || ! (!type.IsNestedPrivate && (type.IsNestedAssembly || type.IsNestedFamORAssem)))) ! { ! object[] attrs = type.Assembly.GetCustomAttributes(typeof(InternalsVisibleToAttribute), false); ! foreach(InternalsVisibleToAttribute ivta in attrs) ! { ! if (ivta.AssemblyName == friendlyAssemblyName) ! { ! return true; ! } ! } ! } ! } #else if (type.IsPublic || (type.IsNestedPublic && type.DeclaringType.IsPublic)) --- 968,1035 ---- #endif ! /// <summary> ! /// Unwraps the supplied <see cref="System.Reflection.TargetInvocationException"/> ! /// and returns the inner exception preserving the stack trace. ! /// </summary> ! /// <param name="ex"> ! /// The <see cref="System.Reflection.TargetInvocationException"/> to unwrap. ! /// </param> ! /// <returns>The unwrapped exception.</returns> ! public static Exception UnwrapTargetInvocationException(TargetInvocationException ex) ! { #if NET_2_0 ! Exception_InternalPreserveStackTrace.Invoke(ex.InnerException, new Object[] {}); #else Exception_RemoteStackTraceString.SetValue(ex.InnerException, ex.InnerException.StackTrace + Environment.NewLine); #endif ! return ex.InnerException; ! } ! /// <summary> ! /// Is the supplied <paramref name="type"/> can be accessed outside the assembly ? ! /// </summary> ! /// <param name="type">The type to check.</param> ! /// <returns> ! /// <see langword="true"/> if the type can be accessed outside the assembly; ! /// Otherwise <see langword="false"/>. ! /// </returns> ! public static bool IsTypeVisible(Type type) ! { ! return IsTypeVisible(type, null); ! } ! /// <summary> ! /// Is the supplied <paramref name="type"/> can be accessed ! /// from the supplied friendly assembly ? ! /// </summary> ! /// <param name="type">The type to check.</param> ! /// <param name="friendlyAssemblyName">The friendly assembly name.</param> ! /// <returns> ! /// <see langword="true"/> if the type can be accessed ! /// from the supplied friendly assembly; Otherwise <see langword="false"/>. ! /// </returns> ! public static bool IsTypeVisible(Type type, string friendlyAssemblyName) ! { #if NET_2_0 ! if (type.IsVisible) ! { ! return true; ! } ! else ! { ! if (!StringUtils.IsNullOrEmpty(friendlyAssemblyName) && ! (!type.IsNested || type.IsNestedPublic || ! (!type.IsNestedPrivate && (type.IsNestedAssembly || type.IsNestedFamORAssem)))) ! { ! object[] attrs = type.Assembly.GetCustomAttributes(typeof(InternalsVisibleToAttribute), false); ! foreach (InternalsVisibleToAttribute ivta in attrs) ! { ! if (ivta.AssemblyName == friendlyAssemblyName) ! { ! return true; ! } ! } ! } ! } #else if (type.IsPublic || (type.IsNestedPublic && type.DeclaringType.IsPublic)) *************** *** 993,999 **** } #endif ! return false; ! } ! /// <summary> /// Copies all fields from one object to another. --- 1038,1044 ---- } #endif ! return false; ! } ! /// <summary> /// Copies all fields from one object to another. *************** *** 1054,1058 **** ArrayList fieldList = new ArrayList(); CollectFieldsRecursive(type, fieldList); ! fields = (FieldInfo[]) fieldList.ToArray(typeof (FieldInfo)); s_fieldCache[type] = fields; } --- 1099,1103 ---- ArrayList fieldList = new ArrayList(); CollectFieldsRecursive(type, fieldList); ! fields = (FieldInfo[]) fieldList.ToArray(typeof(FieldInfo)); s_fieldCache[type] = fields; } *************** *** 1063,1067 **** private static void CollectFieldsRecursive(Type type, ArrayList fieldList) { ! if (type == typeof (object)) return; FieldInfo[] fields = type.GetFields(FIELDBINDINGS); --- 1108,1112 ---- private static void CollectFieldsRecursive(Type type, ArrayList fieldList) { ! if (type == typeof(object)) return; FieldInfo[] fields = type.GetFields(FIELDBINDINGS); *************** *** 1072,1102 **** #endregion Field Cache Management for "MemberwiseCopy" ! private static MethodInfo[] GetCandidateMethods(Type type, string methodName, BindingFlags bindingFlags, int argCount) ! { ! MethodInfo[] methods = type.GetMethods(bindingFlags); ! ArrayList matches = new ArrayList(); ! foreach (MethodInfo method in methods) ! { ! if (method.Name == methodName) ! { ! ParameterInfo[] parameters = method.GetParameters(); ! if (parameters.Length == argCount) ! { ! matches.Add(method); ! } ! else if (parameters.Length > 0) ! { ! ParameterInfo lastParameter = parameters[parameters.Length - 1]; ! if (lastParameter.GetCustomAttributes(typeof (ParamArrayAttribute), false).Length > 0) ! { ! matches.Add(method); ! } ! } ! } ! } ! return (MethodInfo[]) matches.ToArray(typeof(MethodInfo)); ! } } } \ No newline at end of file --- 1117,1147 ---- #endregion Field Cache Management for "MemberwiseCopy" ! private static MethodInfo[] GetCandidateMethods(Type type, string methodName, BindingFlags bindingFlags, int argCount) ! { ! MethodInfo[] methods = type.GetMethods(bindingFlags); ! ArrayList matches = new ArrayList(); ! foreach (MethodInfo method in methods) ! { ! if (method.Name == methodName) ! { ! ParameterInfo[] parameters = method.GetParameters(); ! if (parameters.Length == argCount) ! { ! matches.Add(method); ! } ! else if (parameters.Length > 0) ! { ! ParameterInfo lastParameter = parameters[parameters.Length - 1]; ! if (lastParameter.GetCustomAttributes(typeof(ParamArrayAttribute), false).Length > 0) ! { ! matches.Add(method); ! } ! } ! } ! } ! return (MethodInfo[]) matches.ToArray(typeof(MethodInfo)); ! } } } \ No newline at end of file |
From: Erich E. <oak...@us...> - 2007-08-27 13:57:22
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv9486 Modified Files: Spring.Core.2005.csproj Log Message: added xml doc comments Index: Spring.Core.2005.csproj =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Spring.Core.2005.csproj,v retrieving revision 1.106 retrieving revision 1.107 diff -C2 -d -r1.106 -r1.107 *** Spring.Core.2005.csproj 27 Aug 2007 09:38:12 -0000 1.106 --- Spring.Core.2005.csproj 27 Aug 2007 13:57:18 -0000 1.107 *************** *** 40,44 **** <FileAlignment>4096</FileAlignment> <NoStdLib>false</NoStdLib> ! <NoWarn>1587, 219, 162, 618</NoWarn> <Optimize>false</Optimize> <RegisterForComInterop>false</RegisterForComInterop> --- 40,44 ---- <FileAlignment>4096</FileAlignment> <NoStdLib>false</NoStdLib> ! <NoWarn>219, 162, 618</NoWarn> <Optimize>false</Optimize> <RegisterForComInterop>false</RegisterForComInterop> |
From: Erich E. <oak...@us...> - 2007-08-27 13:57:21
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Collections In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv9486/Collections Modified Files: SynchronizedHashtable.cs Log Message: added xml doc comments Index: SynchronizedHashtable.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Collections/SynchronizedHashtable.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SynchronizedHashtable.cs 3 May 2006 01:13:41 -0000 1.1 --- SynchronizedHashtable.cs 27 Aug 2007 13:57:17 -0000 1.2 *************** *** 21,245 **** using System; using System.Collections; namespace Spring.Collections { ! /// <summary> ! /// Synchronized <see cref="Hashtable"/> that, unlike hashtable created ! /// using <see cref="Hashtable.Synchronized"/> method, synchronizes ! /// reads from the underlying hashtable in addition to writes. ! /// </summary> ! /// <remarks> ! /// <p> ! /// In addition to synchronizing reads, this implementation also fixes ! /// IEnumerator/ICollection issue described at ! /// http://msdn.microsoft.com/netframework/programming/breakingchanges/runtime/clr.aspx ! /// (search for SynchronizedHashtable for issue description), by implementing ! /// <see cref="IEnumerator"/> interface explicitly, and returns thread safe enumerator ! /// implementations as well. ! /// </p> ! /// <p> ! /// This class should be used whenever a truly synchronized <see cref="Hashtable"/> ! /// is needed. ! /// </p> ! /// </remarks> ! /// <author>Aleksandar Seovic</author> ! /// <version>$Id$</version> ! [Serializable] ! public class SynchronizedHashtable : IDictionary, ICollection, IEnumerable, ICloneable ! { ! private Hashtable _table; ! #region Constructors ! public SynchronizedHashtable() ! { ! this._table = new Hashtable(); ! } ! public SynchronizedHashtable(Hashtable table) ! { ! this._table = table; ! } ! #endregion ! #region Properties ! public bool IsReadOnly ! { ! get ! { ! lock (SyncRoot) ! { ! return _table.IsReadOnly; ! } ! } ! } ! public bool IsFixedSize ! { ! get ! { ! lock (SyncRoot) ! { ! return _table.IsFixedSize; ! } ! } ! } ! public bool IsSynchronized ! { ! get { return true; } ! } ! public ICollection Keys ! { ! get ! { ! lock (SyncRoot) ! { ! return _table.Keys; ! } ! } ! } ! public ICollection Values ! { ! get ! { ! lock (SyncRoot) ! { ! return _table.Values; ! } ! } ! } ! public object SyncRoot ! { ! get { return _table.SyncRoot; } ! } ! public int Count ! { ! get ! { ! lock (SyncRoot) ! { ! return _table.Count; ! } ! } ! } ! #endregion ! #region Methods ! public void Add(object key, object value) ! { ! lock (SyncRoot) ! { ! _table.Add(key, value); ! } ! } ! public void Clear() ! { ! lock (SyncRoot) ! { ! _table.Clear(); ! } ! } ! public object Clone() ! { ! lock (SyncRoot) ! { ! return new SynchronizedHashtable((Hashtable) _table.Clone()); ! } ! } ! public bool Contains(object key) ! { ! lock (SyncRoot) ! { ! return _table.Contains(key); ! } ! } ! public bool ContainsKey(object key) ! { ! lock (SyncRoot) ! { ! return _table.ContainsKey(key); ! } ! } ! public bool ContainsValue(object value) ! { ! lock (SyncRoot) ! { ! return _table.ContainsValue(value); ! } ! } ! public void CopyTo(Array array, int arrayIndex) ! { ! lock (SyncRoot) ! { ! _table.CopyTo(array, arrayIndex); ! } ! } ! public IDictionaryEnumerator GetEnumerator() ! { ! lock (SyncRoot) ! { ! return new SynchronizedDictionaryEnumerator(SyncRoot, _table.GetEnumerator()); ! } ! } ! public void Remove(object key) ! { ! lock (SyncRoot) ! { ! _table.Remove(key); ! } ! } ! #endregion ! #region IEnumerable implementation ! IEnumerator IEnumerable.GetEnumerator() ! { ! lock (SyncRoot) ! { ! return new SynchronizedEnumerator(SyncRoot, ((IEnumerable) _table).GetEnumerator()); ! } ! } ! #endregion ! #region Indexer ! public object this[object key] ! { ! get ! { ! lock (SyncRoot) ! { ! return _table[key]; ! } ! } ! set ! { ! lock (SyncRoot) ! { ! _table[key] = value; ! } ! } ! } ! #endregion ! } } \ No newline at end of file --- 21,367 ---- using System; using System.Collections; + using Spring.Util; namespace Spring.Collections { ! /// <summary> ! /// Synchronized <see cref="Hashtable"/> that, unlike hashtable created ! /// using <see cref="Hashtable.Synchronized"/> method, synchronizes ! /// reads from the underlying hashtable in addition to writes. ! /// </summary> ! /// <remarks> ! /// <p> ! /// In addition to synchronizing reads, this implementation also fixes ! /// IEnumerator/ICollection issue described at ! /// http://msdn.microsoft.com/netframework/programming/breakingchanges/runtime/clr.aspx ! /// (search for SynchronizedHashtable for issue description), by implementing ! /// <see cref="IEnumerator"/> interface explicitly, and returns thread safe enumerator ! /// implementations as well. ! /// </p> ! /// <p> ! /// This class should be used whenever a truly synchronized <see cref="Hashtable"/> ! /// is needed. ! /// </p> ! /// </remarks> ! /// <author>Aleksandar Seovic</author> ! /// <version>$Id$</version> ! [Serializable] ! public class SynchronizedHashtable : IDictionary, ICollection, IEnumerable, ICloneable ! { ! private readonly Hashtable _table; ! #region Constructors ! /// <summary> ! /// Initializes a new instance of <see cref="SynchronizedHashtable"/> ! /// </summary> ! public SynchronizedHashtable() ! { ! this._table = new Hashtable(); ! } ! /// <summary> ! /// Initializes a new instance of <see cref="SynchronizedHashtable"/>, copying inital entries from <param name="dictionary"/>. ! /// </summary> ! public SynchronizedHashtable(IDictionary dictionary) ! { ! AssertUtils.ArgumentNotNull(dictionary, "dictionary"); ! this._table = new Hashtable(dictionary); ! } ! #endregion ! #region Properties ! ///<summary> ! ///Gets a value indicating whether the <see cref="T:System.Collections.IDictionary"></see> object is read-only. ! ///</summary> ! ///<returns> ! ///true if the <see cref="T:System.Collections.IDictionary"></see> object is read-only; otherwise, false. ! ///</returns> ! public bool IsReadOnly ! { ! get ! { ! lock (SyncRoot) ! { ! return _table.IsReadOnly; ! } ! } ! } ! ///<summary> ! ///Gets a value indicating whether the <see cref="T:System.Collections.IDictionary"></see> object has a fixed size. ! ///</summary> ! ///<returns> ! ///true if the <see cref="T:System.Collections.IDictionary"></see> object has a fixed size; otherwise, false. ! ///</returns> ! public bool IsFixedSize ! { ! get ! { ! lock (SyncRoot) ! { ! return _table.IsFixedSize; ! } ! } ! } ! ///<summary> ! ///Gets a value indicating whether access to the <see cref="T:System.Collections.ICollection"></see> is synchronized (thread safe). ! ///</summary> ! ///<returns> ! ///true if access to the <see cref="T:System.Collections.ICollection"></see> is synchronized (thread safe); otherwise, false. ! ///</returns> ! public bool IsSynchronized ! { ! get { return true; } ! } ! ///<summary> ! ///Gets an <see cref="T:System.Collections.ICollection"></see> object containing the keys of the <see cref="T:System.Collections.IDictionary"></see> object. ! ///</summary> ! ///<returns> ! ///An <see cref="T:System.Collections.ICollection"></see> object containing the keys of the <see cref="T:System.Collections.IDictionary"></see> object. ! ///</returns> ! public ICollection Keys ! { ! get ! { ! lock (SyncRoot) ! { ! return _table.Keys; ! } ! } ! } ! ///<summary> ! ///Gets an <see cref="T:System.Collections.ICollection"></see> object containing the values in the <see cref="T:System.Collections.IDictionary"></see> object. ! ///</summary> ! ///<returns> ! ///An <see cref="T:System.Collections.ICollection"></see> object containing the values in the <see cref="T:System.Collections.IDictionary"></see> object. ! ///</returns> ! public ICollection Values ! { ! get ! { ! lock (SyncRoot) ! { ! return _table.Values; ! } ! } ! } ! ///<summary> ! ///Gets an object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection"></see>. ! ///</summary> ! ///<returns> ! ///An object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection"></see>. ! ///</returns> ! public object SyncRoot ! { ! get { return _table.SyncRoot; } ! } ! ///<summary> ! ///Gets the number of elements contained in the <see cref="T:System.Collections.ICollection"></see>. ! ///</summary> ! ///<returns> ! ///The number of elements contained in the <see cref="T:System.Collections.ICollection"></see>. ! ///</returns> ! public int Count ! { ! get ! { ! lock (SyncRoot) ! { ! return _table.Count; ! } ! } ! } ! #endregion ! #region Methods ! ///<summary> ! ///Adds an element with the provided key and value to the <see cref="T:System.Collections.IDictionary"></see> object. ! ///</summary> ! ///<param name="value">The <see cref="T:System.Object"></see> to use as the value of the element to add. </param> ! ///<param name="key">The <see cref="T:System.Object"></see> to use as the key of the element to add. </param> ! ///<exception cref="T:System.ArgumentException">An element with the same key already exists in the <see cref="T:System.Collections.IDictionary"></see> object. </exception> ! ///<exception cref="T:System.ArgumentNullException">key is null. </exception> ! ///<exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.IDictionary"></see> is read-only.-or- The <see cref="T:System.Collections.IDictionary"></see> has a fixed size. </exception><filterpriority>2</filterpriority> ! public void Add(object key, object value) ! { ! lock (SyncRoot) ! { ! _table.Add(key, value); ! } ! } ! ///<summary> ! ///Removes all elements from the <see cref="T:System.Collections.IDictionary"></see> object. ! ///</summary> ! ///<exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.IDictionary"></see> object is read-only. </exception><filterpriority>2</filterpriority> ! public void Clear() ! { ! lock (SyncRoot) ! { ! _table.Clear(); ! } ! } ! ///<summary> ! ///Creates a new object that is a copy of the current instance. ! ///</summary> ! ///<returns> ! ///A new object that is a copy of this instance. ! ///</returns> ! public object Clone() ! { ! lock (SyncRoot) ! { ! return new SynchronizedHashtable(this); ! } ! } ! ///<summary> ! ///Determines whether the <see cref="T:System.Collections.IDictionary"></see> object contains an element with the specified key. ! ///</summary> ! ///<returns> ! ///true if the <see cref="T:System.Collections.IDictionary"></see> contains an element with the key; otherwise, false. ! ///</returns> ! ///<param name="key">The key to locate in the <see cref="T:System.Collections.IDictionary"></see> object.</param> ! ///<exception cref="T:System.ArgumentNullException">key is null. </exception><filterpriority>2</filterpriority> ! public bool Contains(object key) ! { ! lock (SyncRoot) ! { ! return _table.Contains(key); ! } ! } ! ///<summary> ! /// Returns, whether this <see cref="IDictionary"/> contains an entry with the specified <paramref name="key"/>. ! ///</summary> ! ///<param name="key">The key to look for</param> ! ///<returns><see lang="true"/>, if this <see cref="IDictionary"/> contains an entry with this <paramref name="key"/></returns> ! public bool ContainsKey(object key) ! { ! lock (SyncRoot) ! { ! return _table.ContainsKey(key); ! } ! } ! ///<summary> ! /// Returns, whether this <see cref="IDictionary"/> contains an entry with the specified <paramref name="value"/>. ! ///</summary> ! ///<param name="value">The valúe to look for</param> ! ///<returns><see lang="true"/>, if this <see cref="IDictionary"/> contains an entry with this <paramref name="value"/></returns> ! public bool ContainsValue(object value) ! { ! lock (SyncRoot) ! { ! return _table.ContainsValue(value); ! } ! } ! ///<summary> ! ///Copies the elements of the <see cref="T:System.Collections.ICollection"></see> to an <see cref="T:System.Array"></see>, starting at a particular <see cref="T:System.Array"></see> index. ! ///</summary> ! ///<param name="array">The one-dimensional <see cref="T:System.Array"></see> that is the destination of the elements copied from <see cref="T:System.Collections.ICollection"></see>. The <see cref="T:System.Array"></see> must have zero-based indexing. </param> ! ///<param name="index">The zero-based index in array at which copying begins. </param> ! ///<exception cref="T:System.ArgumentNullException">array is null. </exception> ! ///<exception cref="T:System.ArgumentException">The type of the source <see cref="T:System.Collections.ICollection"></see> cannot be cast automatically to the type of the destination array. </exception> ! ///<exception cref="T:System.ArgumentOutOfRangeException">index is less than zero. </exception> ! ///<exception cref="T:System.ArgumentException">array is multidimensional.-or- index is equal to or greater than the length of array.-or- The number of elements in the source <see cref="T:System.Collections.ICollection"></see> is greater than the available space from index to the end of the destination array. </exception><filterpriority>2</filterpriority> ! public void CopyTo(Array array, int index) ! { ! lock (SyncRoot) ! { ! _table.CopyTo(array, index); ! } ! } ! ///<summary> ! ///Returns an <see cref="T:System.Collections.IDictionaryEnumerator"></see> object for the <see cref="T:System.Collections.IDictionary"></see> object. ! ///</summary> ! ///<returns> ! ///An <see cref="T:System.Collections.IDictionaryEnumerator"></see> object for the <see cref="T:System.Collections.IDictionary"></see> object. ! ///</returns> ! public IDictionaryEnumerator GetEnumerator() ! { ! lock (SyncRoot) ! { ! return new SynchronizedDictionaryEnumerator(SyncRoot, _table.GetEnumerator()); ! } ! } ! ///<summary> ! ///Removes the element with the specified key from the <see cref="T:System.Collections.IDictionary"></see> object. ! ///</summary> ! ///<param name="key">The key of the element to remove. </param> ! ///<exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.IDictionary"></see> object is read-only.-or- The <see cref="T:System.Collections.IDictionary"></see> has a fixed size. </exception> ! ///<exception cref="T:System.ArgumentNullException">key is null. </exception><filterpriority>2</filterpriority> ! public void Remove(object key) ! { ! lock (SyncRoot) ! { ! _table.Remove(key); ! } ! } ! #endregion ! #region IEnumerable implementation ! ///<summary> ! ///Returns an enumerator that iterates through a collection. ! ///</summary> ! ///<returns> ! ///An <see cref="T:System.Collections.IEnumerator"></see> object that can be used to iterate through the collection. ! ///</returns> ! IEnumerator IEnumerable.GetEnumerator() ! { ! lock (SyncRoot) ! { ! return new SynchronizedEnumerator(SyncRoot, ((IEnumerable) _table).GetEnumerator()); ! } ! } ! #endregion ! #region Indexer ! ///<summary> ! ///Gets or sets the element with the specified key. ! ///</summary> ! ///<returns> ! ///The element with the specified key. ! ///</returns> ! ///<param name="key">The key of the element to get or set. </param> ! ///<exception cref="T:System.NotSupportedException">The property is set and the <see cref="T:System.Collections.IDictionary"></see> object is read-only.-or- The property is set, key does not exist in the collection, and the <see cref="T:System.Collections.IDictionary"></see> has a fixed size. </exception> ! ///<exception cref="T:System.ArgumentNullException">key is null. </exception><filterpriority>2</filterpriority> ! public object this[object key] ! { ! get ! { ! lock (SyncRoot) ! { ! return _table[key]; ! } ! } ! set ! { ! lock (SyncRoot) ! { ! _table[key] = value; ! } ! } ! } ! #endregion ! } } \ No newline at end of file |
From: Erich E. <oak...@us...> - 2007-08-27 13:57:21
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/DataBinding In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv9486/DataBinding Modified Files: AbstractSimpleBinding.cs Log Message: added xml doc comments Index: AbstractSimpleBinding.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/DataBinding/AbstractSimpleBinding.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AbstractSimpleBinding.cs 19 Mar 2007 16:05:52 -0000 1.2 --- AbstractSimpleBinding.cs 27 Aug 2007 13:57:18 -0000 1.3 *************** *** 7,12 **** { /// <summary> ! /// Abstract base class for simple, one-to-one ! /// <see cref="IBinding"/> implementations. /// </summary> /// <author>Aleksandar Seovic</author> --- 7,11 ---- { /// <summary> ! /// Abstract base class for simple, one-to-one <see cref="IBinding"/> implementations. /// </summary> /// <author>Aleksandar Seovic</author> *************** *** 22,29 **** --- 21,35 ---- #region Constructor(s) + /// <summary> + /// Initialize a new instance of <see cref="AbstractSimpleBinding"/> without any <see cref="IFormatter"/> + /// </summary> protected AbstractSimpleBinding() { } + /// <summary> + /// Initialize a new instance of <see cref="AbstractSimpleBinding"/> with the + /// specified <see cref="IFormatter"/>. + /// </summary> protected AbstractSimpleBinding(IFormatter formatter) { *************** *** 64,70 **** /// Variables that should be used during expression evaluation. /// </param> ! public override void BindSourceToTarget(object source, object target, ValidationErrors validationErrors, IDictionary variables) { ! if (this.IsValid && (this.Direction == BindingDirection.Bidirectional || this.Direction == BindingDirection.SourceToTarget)) { try --- 70,79 ---- /// Variables that should be used during expression evaluation. /// </param> ! public override void BindSourceToTarget(object source, object target, ValidationErrors validationErrors, ! IDictionary variables) { ! if (this.IsValid ! && ! (this.Direction == BindingDirection.Bidirectional || this.Direction == BindingDirection.SourceToTarget)) { try *************** *** 108,112 **** if (this.Formatter != null && value is string) { ! value = this.Formatter.Parse((string)value); } this.SetTargetValue(target, value, variables); --- 117,121 ---- if (this.Formatter != null && value is string) { ! value = this.Formatter.Parse((string) value); } this.SetTargetValue(target, value, variables); *************** *** 128,134 **** /// Variables that should be used during expression evaluation. /// </param> ! public override void BindTargetToSource(object source, object target, ValidationErrors validationErrors, IDictionary variables) { ! if (this.IsValid && (this.Direction == BindingDirection.Bidirectional || this.Direction == BindingDirection.TargetToSource)) { try --- 137,146 ---- /// Variables that should be used during expression evaluation. /// </param> ! public override void BindTargetToSource(object source, object target, ValidationErrors validationErrors, ! IDictionary variables) { ! if (this.IsValid ! && ! (this.Direction == BindingDirection.Bidirectional || this.Direction == BindingDirection.TargetToSource)) { try |
From: Erich E. <oak...@us...> - 2007-08-27 13:44:42
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Web.Tests In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv14160 Modified Files: Spring.Web.Tests.2003.csproj Log Message: reactivated warning 1591 "missing XML doc comment" excluded unused Spring.Core/Spring.Expressions.Parser/ExpressionParserTokenTypes..cs from builds Index: Spring.Web.Tests.2003.csproj =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Web.Tests/Spring.Web.Tests.2003.csproj,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** Spring.Web.Tests.2003.csproj 25 Aug 2007 14:26:36 -0000 1.32 --- Spring.Web.Tests.2003.csproj 27 Aug 2007 09:39:04 -0000 1.33 *************** *** 164,168 **** RelPath = "Data\Spring\Objects\Factory\Support\TestForm.aspx.cs" DependentUpon = "TestForm.aspx" ! SubType = "ASPXCodeBehind" BuildAction = "Compile" /> --- 164,168 ---- RelPath = "Data\Spring\Objects\Factory\Support\TestForm.aspx.cs" DependentUpon = "TestForm.aspx" ! SubType = "Code" BuildAction = "Compile" /> *************** *** 179,183 **** <File RelPath = "TestSupport\PageTestObject.cs" ! SubType = "ASPXCodeBehind" BuildAction = "Compile" /> --- 179,183 ---- <File RelPath = "TestSupport\PageTestObject.cs" ! SubType = "Code" BuildAction = "Compile" /> *************** *** 204,208 **** <File RelPath = "Util\ControlInterceptionTests.cs" ! SubType = "Code" BuildAction = "Compile" /> --- 204,208 ---- <File RelPath = "Util\ControlInterceptionTests.cs" ! SubType = "ASPXCodeBehind" BuildAction = "Compile" /> |
From: Erich E. <oak...@us...> - 2007-08-27 13:44:42
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Web.Tests/Caching In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv15042 Modified Files: AspNetCacheTests.cs Log Message: added test for AbstractCache and AspNetCache Index: AspNetCacheTests.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Web.Tests/Caching/AspNetCacheTests.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AspNetCacheTests.cs 24 Aug 2007 22:44:35 -0000 1.1 --- AspNetCacheTests.cs 25 Aug 2007 10:22:13 -0000 1.2 *************** *** 34,38 **** { /// <summary> ! /// /// </summary> /// <author>Erich Eichinger</author> --- 34,38 ---- { /// <summary> ! /// Test AspNetCache behaviour. /// </summary> /// <author>Erich Eichinger</author> *************** *** 46,49 **** --- 46,53 ---- private readonly TimeSpan ttl10Seconds = new TimeSpan(0, 0, 10); + MockRepository mocks; + AspNetCache.IRuntimeCache mockedRuntimeCache; + AspNetCache mockedCache; + [SetUp] public void SetUp() *************** *** 57,60 **** --- 61,129 ---- thisCache = new AspNetCache(); otherCache = new AspNetCache(); + + mocks = new MockRepository(); + mockedRuntimeCache = (AspNetCache.IRuntimeCache)mocks.CreateMock(typeof(AspNetCache.IRuntimeCache)); + mockedCache = new AspNetCache(mockedRuntimeCache); + } + + [Test] + public void Get() + { + // set expectations + Expect.Call(mockedRuntimeCache.Get(mockedCache.GenerateKey("key"))).Return(null); + mocks.ReplayAll(); + // verify + mockedCache.Get("key"); + mocks.VerifyAll(); + } + + [Test] + public void Remove() + { + // set expectations + Expect.Call(mockedRuntimeCache.Remove(mockedCache.GenerateKey("key"))).Return(null); + mocks.ReplayAll(); + // verify + mockedCache.Remove("key"); + mocks.VerifyAll(); + } + + [Test] + [ExpectedException(typeof(ArgumentNullException))] + public void DoesNotAcceptNullKeysOnInsert() + { + thisCache.Insert(null, "value", TimeSpan.Zero, true); + } + + [Test] + public void GetNullKeysReturnsNull() + { + Assert.IsNull(thisCache.Get(null)); + } + + [Test] + public void IgnoreNullKeysOnRemove() + { + thisCache.Remove(null); + } + + [Test] + public void ReturnsOnlyKeysOwnedByCache() + { + DictionaryEntry[] mockedRuntimeCacheEntries = + { + new DictionaryEntry(mockedCache.GenerateKey("keyA"), null) + , new DictionaryEntry(mockedCache.GenerateKey("keyB"), null) + , new DictionaryEntry(thisCache.GenerateKey("keyC"), null) + , new DictionaryEntry(otherCache.GenerateKey("keyD"), null) + }; + + // set expectations + Expect.Call(mockedRuntimeCache.GetEnumerator()).Return(mockedRuntimeCacheEntries.GetEnumerator()); + mocks.ReplayAll(); + // verify + ICollection keys = mockedCache.Keys; + Assert.AreEqual( new string[] { "keyA", "keyB" }, new ArrayList(keys).ToArray(typeof(string)) ); + mocks.VerifyAll(); } *************** *** 103,116 **** [Test] ! public void HandlesTTLAndSlidingExpiration() { MockRepository mocks = new MockRepository(); ! AspNetCache.IRuntimeCache runtimeCache = (AspNetCache.IRuntimeCache) mocks.CreateMock(typeof(AspNetCache.IRuntimeCache)); ! AspNetCache cache = new AspNetCache(runtimeCache); - runtimeCache.Insert(cache.GenerateKey("key"), "value", null, Cache.NoAbsoluteExpiration, Cache.NoSlidingExpiration, CacheItemPriority.Default, null); mocks.ReplayAll(); ! cache.Insert( "key", "value" ); mocks.VerifyAll(); --- 172,213 ---- [Test] ! public void PassesParametersToRuntimeCache() { MockRepository mocks = new MockRepository(); ! AspNetCache.IRuntimeCache runtimeCache = (AspNetCache.IRuntimeCache) mocks.CreateMock(typeof(AspNetCache.IRuntimeCache)); ! AspNetCache cache = new AspNetCache(runtimeCache); ! ! DateTime expectedAbsoluteExpiration = DateTime.Now; ! TimeSpan expectedSlidingExpiration = ttl10Seconds; ! CacheItemPriority expectedPriority = CacheItemPriority.Low; ! ! // TODO: find way to test non-sliding expiration case ! // runtimeCache.Insert(cache.GenerateKey("key"), "value", null, DateTime.Now.Add(ttl10Seconds), Cache.NoSlidingExpiration, expectedPriority, null); ! runtimeCache.Insert(cache.GenerateKey("key"), "value", null, Cache.NoAbsoluteExpiration, ttl10Seconds, expectedPriority, null); mocks.ReplayAll(); ! // cache.Insert( "key", "value", ttl10Seconds, false, expectedPriority ); ! cache.Insert("key", "value", ttl10Seconds, true, expectedPriority); ! ! mocks.VerifyAll(); ! } ! ! [Test] ! public void ZeroTTLCausesNoExpiration() ! { ! MockRepository mocks = new MockRepository(); ! AspNetCache.IRuntimeCache runtimeCache = (AspNetCache.IRuntimeCache)mocks.CreateMock(typeof(AspNetCache.IRuntimeCache)); ! AspNetCache cache = new AspNetCache(runtimeCache); ! ! CacheItemPriority expectedPriority = CacheItemPriority.Low; ! ! runtimeCache.Insert(cache.GenerateKey("key"), "value", null, Cache.NoAbsoluteExpiration, Cache.NoSlidingExpiration, expectedPriority, null); ! runtimeCache.Insert(cache.GenerateKey("key"), "value", null, Cache.NoAbsoluteExpiration, Cache.NoSlidingExpiration, expectedPriority, null); ! ! mocks.ReplayAll(); ! ! cache.Insert("key", "value", TimeSpan.Zero, true, expectedPriority); ! cache.Insert("key", "value", TimeSpan.Zero, false, expectedPriority); mocks.VerifyAll(); |
From: Erich E. <oak...@us...> - 2007-08-27 13:44:42
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Util In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv13657/Util Modified Files: UniqueKey.cs Log Message: reactivated warning 1591 "missing XML doc comment" excluded unused Spring.Core/Spring.Expressions.Parser/ExpressionParserTokenTypes..cs from builds Index: UniqueKey.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Util/UniqueKey.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** UniqueKey.cs 22 Aug 2007 20:16:20 -0000 1.1 --- UniqueKey.cs 27 Aug 2007 09:38:12 -0000 1.2 *************** *** 22,25 **** --- 22,26 ---- using System; + using System.Collections; using System.ComponentModel; using System.Text; *************** *** 30,33 **** --- 31,51 ---- namespace Spring.Util { + /// <summary> + /// UniqueKey allows for generating keys unique to a type or particular instance and a partial name, + /// that can e.g. be used as keys in <see cref="Hashtable"/>. + /// </summary> + /// <example> + /// // shows usage type-scoped keys + /// UniqueKey classAKey = UniqueKey.GetTypeScoped(typeof(ClassA), "myKey"); + /// UniqueKey classBKey = UniqueKey.GetTypeScoped(typeof(ClassB), "myKey"); + /// + /// HttpContext.Current.Items.Add( classAKey, "some value unqiue for class A having key 'myKey'"); + /// object value = HttpContext.Current.Items[ UniqueKey.GetTypeScoped(typeof(ClassA), "myKey") ]; + /// Assert.AreEqual( "some value unique for class A having key 'myKey'", value); + /// + /// HttpContext.Current.Items.Add( classBKey, "some value unqiue for class B having key 'myKey'"); + /// object value = HttpContext.Current.Items[ UniqueKey.GetTypeScoped(typeof(ClassB), "myKey") ]; + /// Assert.AreEqual( "some value unique for class B having key 'myKey'", value); + /// </example> [Serializable] [TypeConverter(typeof(UniqueKeyConverter))] |
From: Erich E. <oak...@us...> - 2007-08-27 13:44:41
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv14656/Spring.Core.Tests Modified Files: Spring.Core.Tests.2003.csproj Spring.Core.Tests.2005.csproj Log Message: added test for AbstractCache and AspNetCache Index: Spring.Core.Tests.2005.csproj =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Spring.Core.Tests.2005.csproj,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** Spring.Core.Tests.2005.csproj 22 Aug 2007 20:17:04 -0000 1.61 --- Spring.Core.Tests.2005.csproj 25 Aug 2007 10:21:59 -0000 1.62 *************** *** 105,108 **** --- 105,109 ---- </Reference> <Reference Include="System.EnterpriseServices" /> + <Reference Include="System.Web" /> <Reference Include="System.Web.Services" /> <Reference Include="System.Xml"> *************** *** 114,117 **** --- 115,119 ---- <SubType>Code</SubType> </Compile> + <Compile Include="Caching\AbstractCacheTests.cs" /> <Compile Include="Collections\AbstractQueueTests.cs"> <SubType>Code</SubType> Index: Spring.Core.Tests.2003.csproj =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Spring.Core.Tests.2003.csproj,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** Spring.Core.Tests.2003.csproj 24 Aug 2007 22:48:59 -0000 1.35 --- Spring.Core.Tests.2003.csproj 25 Aug 2007 10:21:59 -0000 1.36 *************** *** 174,177 **** --- 174,182 ---- /> <File + RelPath = "Caching\AbstractCacheTests.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Collections\AbstractQueueTests.cs" SubType = "Code" |
From: Erich E. <oak...@us...> - 2007-08-27 13:44:41
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Core/TypeConversion In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv13869 Modified Files: TypeConversionUtils.cs Log Message: reactivated warning 1591 "missing XML doc comment" excluded unused Spring.Core/Spring.Expressions.Parser/ExpressionParserTokenTypes..cs from builds Index: TypeConversionUtils.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Core/TypeConversion/TypeConversionUtils.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TypeConversionUtils.cs 25 Aug 2007 16:07:35 -0000 1.2 --- TypeConversionUtils.cs 27 Aug 2007 09:38:38 -0000 1.3 *************** *** 101,105 **** newValue = typeConverter.ConvertFrom(newValue); } ! catch (Exception e) { if (newValue is string) --- 101,105 ---- newValue = typeConverter.ConvertFrom(newValue); } ! catch { if (newValue is string) |
From: Erich E. <oak...@us...> - 2007-08-27 13:44:31
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Expressions In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv13657/Expressions Modified Files: Expression.g Log Message: reactivated warning 1591 "missing XML doc comment" excluded unused Spring.Core/Spring.Expressions.Parser/ExpressionParserTokenTypes..cs from builds Index: Expression.g =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Expressions/Expression.g,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** Expression.g 31 Jul 2007 21:43:52 -0000 1.23 --- Expression.g 27 Aug 2007 09:38:11 -0000 1.24 *************** *** 12,15 **** --- 12,16 ---- classHeaderPrefix = "internal"; buildAST=true; + ASTLabelType = "Spring.Expressions.SpringAST"; k = 2; } *************** *** 315,318 **** --- 316,320 ---- ; + class ExpressionLexer extends Lexer; |
From: Erich E. <oak...@us...> - 2007-08-27 13:44:27
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Caching In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv14622/Caching Modified Files: AbstractCache.cs ICache.cs Log Message: added test for AbstractCache and AspNetCache Index: ICache.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Caching/ICache.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ICache.cs 24 Aug 2007 22:43:55 -0000 1.3 --- ICache.cs 25 Aug 2007 10:21:22 -0000 1.4 *************** *** 28,32 **** /// </summary> /// <author>Aleksandar Seovic</author> ! /// <version>$Id$</version> public interface ICache { --- 28,33 ---- /// </summary> /// <author>Aleksandar Seovic</author> ! /// <author>Erich Eichinger</author> ! /// <version>$Id$</version> public interface ICache { Index: AbstractCache.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Caching/AbstractCache.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AbstractCache.cs 24 Aug 2007 22:43:55 -0000 1.4 --- AbstractCache.cs 25 Aug 2007 10:21:21 -0000 1.5 *************** *** 29,32 **** --- 29,33 ---- /// </summary> /// <author>Aleksandar Seovic</author> + /// <author>Erich Eichinger</author> /// <version>$Id$</version> public abstract class AbstractCache : ICache *************** *** 113,119 **** public virtual void Clear() { ! object[] keys = new object[Keys.Count]; ! Keys.CopyTo(keys, 0); ! RemoveAll(keys); } --- 114,118 ---- public virtual void Clear() { ! RemoveAll(this.Keys); } *************** *** 155,159 **** public virtual void Insert(object key, object value, TimeSpan timeToLive) { ! if (TimeSpan.MinValue.Equals(timeToLive) || _enforceTimeToLive) { timeToLive = _timeToLive; --- 154,158 ---- public virtual void Insert(object key, object value, TimeSpan timeToLive) { ! if (_enforceTimeToLive || (timeToLive < TimeSpan.Zero)) { timeToLive = _timeToLive; |
From: Erich E. <oak...@us...> - 2007-08-27 13:44:22
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Collections In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv13657/Collections Modified Files: AbstractQueue.cs PriorityQueue.cs Log Message: reactivated warning 1591 "missing XML doc comment" excluded unused Spring.Core/Spring.Expressions.Parser/ExpressionParserTokenTypes..cs from builds Index: AbstractQueue.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Collections/AbstractQueue.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** AbstractQueue.cs 30 Sep 2006 18:39:24 -0000 1.7 --- AbstractQueue.cs 27 Aug 2007 09:38:11 -0000 1.8 *************** *** 72,77 **** /// </remarks> protected AbstractQueue() ! { ! } /// <summary> --- 72,76 ---- /// </remarks> protected AbstractQueue() ! {} /// <summary> *************** *** 90,94 **** public virtual bool Add(object objectToAdd) { ! if (Offer(objectToAdd)) { return true; --- 89,93 ---- public virtual bool Add(object objectToAdd) { ! if(Offer(objectToAdd)) { return true; *************** *** 119,123 **** { object element = Poll(); ! if (element != null) { return element; --- 118,122 ---- { object element = Poll(); ! if(element != null) { return element; *************** *** 151,155 **** { object element = Peek(); ! if (element != null) { return element; --- 150,154 ---- { object element = Peek(); ! if(element != null) { return element; *************** *** 160,163 **** --- 159,163 ---- } } + /// <summary> /// Removes all of the elements from this queue. *************** *** 175,179 **** public virtual void Clear() { ! while (Poll() != null) { ; --- 175,179 ---- public virtual void Clear() { ! while(Poll() != null) { ; *************** *** 217,240 **** public virtual bool AddAll(ICollection collection) { ! if (collection == null) { throw new ArgumentNullException("Collection cannot be null."); } ! if (collection == this) { throw new ArgumentException(); } ! if ( collection.Count > Capacity ) { throw new ArgumentException("Collcation size greater than queue capacity."); } bool modified = false; ! foreach (object element in collection) { ! if ( element == null ) { throw new ArgumentNullException("Cannot add null elements to this queue."); } ! else if (Add(element)) { modified = true; --- 217,240 ---- public virtual bool AddAll(ICollection collection) { ! if(collection == null) { throw new ArgumentNullException("Collection cannot be null."); } ! if(collection == this) { throw new ArgumentException(); } ! if(collection.Count > Capacity) { throw new ArgumentException("Collcation size greater than queue capacity."); } bool modified = false; ! foreach(object element in collection) { ! if(element == null) { throw new ArgumentNullException("Cannot add null elements to this queue."); } ! else if(Add(element)) { modified = true; *************** *** 244,258 **** } public abstract bool Offer(object objectToAdd); public abstract object Peek(); public abstract object Poll(); public abstract void CopyTo(Array array, int index); ! ! public abstract bool IsEmpty {get;} ! public abstract int Capacity {get;} public abstract int Count { get; } public abstract object SyncRoot { get; } public abstract bool IsSynchronized { get; } public abstract IEnumerator GetEnumerator(); } --- 244,346 ---- } + /// <summary> + /// Inserts the specified element into this queue if it is possible to do + /// so immediately without violating capacity restrictions. + /// </summary> + /// <remarks> + /// <p> + /// When using a capacity-restricted queue, this method is generally + /// preferable to <see cref="Spring.Collections.IQueue.Add(object)"/>, + /// which can fail to insert an element only by throwing an exception. + /// </p> + /// </remarks> + /// <param name="objectToAdd"> + /// The element to add. + /// </param> + /// <returns> + /// <see lang="true"/> if the element was added to this queue. + /// </returns> + /// <exception cref="System.InvalidOperationException"> + /// If the element cannot be added at this time due to capacity restrictions. + /// </exception> + /// <exception cref="System.ArgumentNullException"> + /// If the supplied <paramref name="objectToAdd"/> is + /// <see lang="null"/>. + /// </exception> + /// <exception cref="System.ArgumentException"> + /// If some property of the supplied <paramref name="objectToAdd"/> prevents + /// it from being added to this queue. + /// </exception> public abstract bool Offer(object objectToAdd); + + /// <summary> + /// Retrieves, but does not remove, the head of this queue, + /// or returns <see lang="null"/> if this queue is empty. + /// </summary> + /// <returns> + /// The head of this queue, or <see lang="null"/> if this queue is empty. + /// </returns> public abstract object Peek(); + + /// <summary> + /// Retrieves and removes the head of this queue, + /// or returns <see lang="null"/> if this queue is empty. + /// </summary> + /// <returns> + /// The head of this queue, or <see lang="null"/> if this queue is empty. + /// </returns> public abstract object Poll(); + /// <summary> + /// Returns <see lang="true"/> if there are no elements in the <see cref="IQueue"/>, <see lang="false"/> otherwise. + /// </summary> + public abstract bool IsEmpty { get; } + + /// <summary> + /// Returns the current capacity of this queue. + /// </summary> + public abstract int Capacity { get; } + + ///<summary> + ///Copies the elements of the <see cref="T:System.Collections.ICollection"></see> to an <see cref="T:System.Array"></see>, starting at a particular <see cref="T:System.Array"></see> index. + ///</summary> + ///<param name="array">The one-dimensional <see cref="T:System.Array"></see> that is the destination of the elements copied from <see cref="T:System.Collections.ICollection"></see>. The <see cref="T:System.Array"></see> must have zero-based indexing. </param> + ///<param name="index">The zero-based index in array at which copying begins. </param> + ///<exception cref="T:System.ArgumentNullException">array is null. </exception> + ///<exception cref="T:System.ArgumentOutOfRangeException">index is less than zero. </exception> + ///<exception cref="T:System.ArgumentException">array is multidimensional.-or- index is equal to or greater than the length of array.-or- The number of elements in the source <see cref="T:System.Collections.ICollection"></see> is greater than the available space from index to the end of the destination array. </exception> + ///<exception cref="T:System.InvalidCastException">The type of the source <see cref="T:System.Collections.ICollection"></see> cannot be cast automatically to the type of the destination array. </exception><filterpriority>2</filterpriority> public abstract void CopyTo(Array array, int index); ! ! ///<summary> ! ///Gets the number of elements contained in the <see cref="T:System.Collections.ICollection"></see>. ! ///</summary> ! ///<returns> ! ///The number of elements contained in the <see cref="T:System.Collections.ICollection"></see>. ! ///</returns> public abstract int Count { get; } + + ///<summary> + ///Gets an object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection"></see>. + ///</summary> + ///<returns> + ///An object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection"></see>. + ///</returns> public abstract object SyncRoot { get; } + + ///<summary> + ///Gets a value indicating whether access to the <see cref="T:System.Collections.ICollection"></see> is synchronized (thread safe). + ///</summary> + ///<returns> + ///true if access to the <see cref="T:System.Collections.ICollection"></see> is synchronized (thread safe); otherwise, false. + ///</returns> public abstract bool IsSynchronized { get; } + + ///<summary> + ///Returns an enumerator that iterates through a collection. + ///</summary> + ///<returns> + ///An <see cref="T:System.Collections.IEnumerator"></see> object that can be used to iterate through the collection. + ///</returns> public abstract IEnumerator GetEnumerator(); } Index: PriorityQueue.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Collections/PriorityQueue.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PriorityQueue.cs 30 Sep 2006 18:39:24 -0000 1.5 --- PriorityQueue.cs 27 Aug 2007 09:38:11 -0000 1.6 *************** *** 760,764 **** #region ICollection Implementation ! public override void CopyTo(Array array, Int32 index) { if ( _priorityQueueSize > array.Length ) throw new ArgumentException("Destination array too small.", "array"); --- 760,774 ---- #region ICollection Implementation ! ! ///<summary> ! ///Copies the elements of the <see cref="T:System.Collections.ICollection"></see> to an <see cref="T:System.Array"></see>, starting at a particular <see cref="T:System.Array"></see> index. ! ///</summary> ! ///<param name="array">The one-dimensional <see cref="T:System.Array"></see> that is the destination of the elements copied from <see cref="T:System.Collections.ICollection"></see>. The <see cref="T:System.Array"></see> must have zero-based indexing. </param> ! ///<param name="index">The zero-based index in array at which copying begins. </param> ! ///<exception cref="T:System.ArgumentNullException">array is null. </exception> ! ///<exception cref="T:System.ArgumentOutOfRangeException">index is less than zero. </exception> ! ///<exception cref="T:System.ArgumentException">array is multidimensional.-or- index is equal to or greater than the length of array.-or- The number of elements in the source <see cref="T:System.Collections.ICollection"></see> is greater than the available space from index to the end of the destination array. </exception> ! ///<exception cref="T:System.InvalidCastException">The type of the source <see cref="T:System.Collections.ICollection"></see> cannot be cast automatically to the type of the destination array. </exception><filterpriority>2</filterpriority> ! public override void CopyTo(Array array,Int32 index) { if ( _priorityQueueSize > array.Length ) throw new ArgumentException("Destination array too small.", "array"); *************** *** 774,781 **** --- 784,806 ---- } + ///<summary> + ///Copies the elements of the <see cref="T:System.Collections.ICollection"></see> to an <see cref="T:System.Array"></see>, starting at index 0. + ///</summary> + ///<param name="array">The one-dimensional <see cref="T:System.Array"></see> that is the destination of the elements copied from <see cref="T:System.Collections.ICollection"></see>. The <see cref="T:System.Array"></see> must have zero-based indexing. </param> + ///<exception cref="T:System.ArgumentNullException">array is null. </exception> + ///<exception cref="T:System.ArgumentOutOfRangeException">index is less than zero. </exception> + ///<exception cref="T:System.ArgumentException">array is multidimensional.-or- index is equal to or greater than the length of array.-or- The number of elements in the source <see cref="T:System.Collections.ICollection"></see> is greater than the available space from index to the end of the destination array. </exception> + ///<exception cref="T:System.InvalidCastException">The type of the source <see cref="T:System.Collections.ICollection"></see> cannot be cast automatically to the type of the destination array. </exception><filterpriority>2</filterpriority> public void CopyTo(Array array) { CopyTo(array, 0); } + + ///<summary> + ///Gets an object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection"></see>. + ///</summary> + ///<returns> + ///An object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection"></see>. + ///</returns> public override Object SyncRoot { *************** *** 784,787 **** --- 809,818 ---- } + ///<summary> + ///Gets a value indicating whether access to the <see cref="T:System.Collections.ICollection"></see> is synchronized (thread safe). + ///</summary> + ///<returns> + ///true if access to the <see cref="T:System.Collections.ICollection"></see> is synchronized (thread safe); otherwise, false. + ///</returns> public override Boolean IsSynchronized { *************** *** 790,793 **** --- 821,827 ---- } + /// <summary> + /// Returns <see lang="true"/> if there are no elements in the <see cref="IQueue"/>, <see lang="false"/> otherwise. + /// </summary> public override bool IsEmpty { |
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Context/Support In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv13850 Modified Files: AbstractApplicationContext.cs AbstractMessageSource.cs NullMessageSource.cs StaticMessageSource.cs Log Message: reactivated warning 1591 "missing XML doc comment" excluded unused Spring.Core/Spring.Expressions.Parser/ExpressionParserTokenTypes..cs from builds Index: AbstractMessageSource.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Context/Support/AbstractMessageSource.cs,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** AbstractMessageSource.cs 23 Aug 2007 10:38:02 -0000 1.21 --- AbstractMessageSource.cs 27 Aug 2007 09:38:28 -0000 1.22 *************** *** 547,558 **** /// The base name of the object to use for key lookup. /// </param> ! /// <param name="culture"> /// The <see cref="System.Globalization.CultureInfo"/> with which the /// resource is associated. /// </param> ! protected void ApplyResourcesInternal(object value, string name, CultureInfo cultureInfo) { if (cultureInfo == null) cultureInfo = CultureInfo.CurrentUICulture; ! ApplyResourcesToObject(value, name, cultureInfo); } --- 547,558 ---- /// The base name of the object to use for key lookup. /// </param> ! /// <param name="cultureInfo"> /// The <see cref="System.Globalization.CultureInfo"/> with which the /// resource is associated. /// </param> ! protected void ApplyResourcesInternal(object value, string objectName, CultureInfo cultureInfo) { if (cultureInfo == null) cultureInfo = CultureInfo.CurrentUICulture; ! ApplyResourcesToObject(value, objectName, cultureInfo); } *************** *** 565,572 **** /// </summary> /// <param name="code">The code to lookup up, such as 'calculator.noRateSet'.</param> ! /// <param name="culture">The <see cref="System.Globalization.CultureInfo"/> with which the /// resource is associated.</param> /// <returns>The resolved message from the backing store of message data.</returns> ! protected abstract string ResolveMessage(string code, CultureInfo culture); /// <summary> --- 565,572 ---- /// </summary> /// <param name="code">The code to lookup up, such as 'calculator.noRateSet'.</param> ! /// <param name="cultureInfo">The <see cref="System.Globalization.CultureInfo"/> with which the /// resource is associated.</param> /// <returns>The resolved message from the backing store of message data.</returns> ! protected abstract string ResolveMessage(string code, CultureInfo cultureInfo); /// <summary> *************** *** 579,583 **** /// </remarks> /// <param name="code">The code of the object to resolve.</param> ! /// <param name="culture"> /// The <see cref="System.Globalization.CultureInfo"/> to resolve the /// code for. --- 579,583 ---- /// </remarks> /// <param name="code">The code of the object to resolve.</param> ! /// <param name="cultureInfo"> /// The <see cref="System.Globalization.CultureInfo"/> to resolve the /// code for. *************** *** 586,590 **** /// The resolved object or <see langword="null"/> if not found. /// </returns> ! protected abstract object ResolveObject(string code, CultureInfo culture); /// <summary> --- 586,590 ---- /// The resolved object or <see langword="null"/> if not found. /// </returns> ! protected abstract object ResolveObject(string code, CultureInfo cultureInfo); /// <summary> *************** *** 603,611 **** /// The base name of the object to use for key lookup. /// </param> ! /// <param name="culture"> /// The <see cref="System.Globalization.CultureInfo"/> with which the /// resource is associated. /// </param> ! protected abstract void ApplyResourcesToObject(object value, string objectName, CultureInfo culture); --- 603,611 ---- /// The base name of the object to use for key lookup. /// </param> ! /// <param name="cultureInfo"> /// The <see cref="System.Globalization.CultureInfo"/> with which the /// resource is associated. /// </param> ! protected abstract void ApplyResourcesToObject(object value, string objectName, CultureInfo cultureInfo); Index: AbstractApplicationContext.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Context/Support/AbstractApplicationContext.cs,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** AbstractApplicationContext.cs 22 Aug 2007 08:49:26 -0000 1.73 --- AbstractApplicationContext.cs 27 Aug 2007 09:38:28 -0000 1.74 *************** *** 818,821 **** --- 818,825 ---- } + /// <summary> + /// Ensures, that predefined ObjectPostProcessors are registered with this ObjectFactory + /// </summary> + /// <param name="objectFactory"></param> protected void EnsureKnownObjectPostProcessors(IConfigurableListableObjectFactory objectFactory) { Index: NullMessageSource.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Context/Support/NullMessageSource.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** NullMessageSource.cs 9 Apr 2006 07:18:38 -0000 1.4 --- NullMessageSource.cs 27 Aug 2007 09:38:29 -0000 1.5 *************** *** 70,74 **** /// </summary> /// <param name="code">The code of the message to resolve.</param> ! /// <param name="culture"> /// The <see cref="System.Globalization.CultureInfo"/> to resolve the /// code for. --- 70,74 ---- /// </summary> /// <param name="code">The code of the message to resolve.</param> ! /// <param name="cultureInfo"> /// The <see cref="System.Globalization.CultureInfo"/> to resolve the /// code for. *************** *** 77,81 **** /// The supplied message <paramref name="code"/> as-is. /// </returns> ! protected override string ResolveMessage(string code, CultureInfo culture) { return code; --- 77,81 ---- /// The supplied message <paramref name="code"/> as-is. /// </returns> ! protected override string ResolveMessage(string code, CultureInfo cultureInfo) { return code; *************** *** 86,90 **** /// </summary> /// <param name="code">The code of the object to resolve.</param> ! /// <param name="culture"> /// The <see cref="System.Globalization.CultureInfo"/> to resolve the /// code for. --- 86,90 ---- /// </summary> /// <param name="code">The code of the object to resolve.</param> ! /// <param name="cultureInfo"> /// The <see cref="System.Globalization.CultureInfo"/> to resolve the /// code for. *************** *** 93,97 **** /// <see lang="null"/> (always). /// </returns> ! protected override object ResolveObject(string code, CultureInfo culture) { return null; --- 93,97 ---- /// <see lang="null"/> (always). /// </returns> ! protected override object ResolveObject(string code, CultureInfo cultureInfo) { return null; *************** *** 107,116 **** /// The base name of the object to use for key lookup. /// </param> ! /// <param name="culture"> /// The <see cref="System.Globalization.CultureInfo"/> with which the /// resource is associated. /// </param> protected override void ApplyResourcesToObject( ! object value, string objectName, CultureInfo culture) {} } --- 107,116 ---- /// The base name of the object to use for key lookup. /// </param> ! /// <param name="cultureInfo"> /// The <see cref="System.Globalization.CultureInfo"/> with which the /// resource is associated. /// </param> protected override void ApplyResourcesToObject( ! object value, string objectName, CultureInfo cultureInfo) {} } Index: StaticMessageSource.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Context/Support/StaticMessageSource.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** StaticMessageSource.cs 9 Apr 2006 07:18:38 -0000 1.14 --- StaticMessageSource.cs 27 Aug 2007 09:38:31 -0000 1.15 *************** *** 21,25 **** #region Imports - using System; using System.Collections; using System.ComponentModel; --- 21,24 ---- *************** *** 67,71 **** /// </summary> /// <param name="code">The code of the message to resolve.</param> ! /// <param name="culture"> /// The <see cref="System.Globalization.CultureInfo"/> to resolve the /// code for. --- 66,70 ---- /// </summary> /// <param name="code">The code of the message to resolve.</param> ! /// <param name="cultureInfo"> /// The <see cref="System.Globalization.CultureInfo"/> to resolve the /// code for. *************** *** 75,81 **** /// </returns> /// <seealso cref="Spring.Context.Support.AbstractMessageSource.ResolveMessage(string, CultureInfo)"/> ! protected override string ResolveMessage(string code, CultureInfo culture) { ! return (string) _messages[GetLookupKey(code, culture)]; } --- 74,80 ---- /// </returns> /// <seealso cref="Spring.Context.Support.AbstractMessageSource.ResolveMessage(string, CultureInfo)"/> ! protected override string ResolveMessage(string code, CultureInfo cultureInfo) { ! return (string) _messages[GetLookupKey(code, cultureInfo)]; } *************** *** 84,88 **** /// </summary> /// <param name="code">The code of the object to resolve.</param> ! /// <param name="culture"> /// The <see cref="System.Globalization.CultureInfo"/> to resolve the /// code for. --- 83,87 ---- /// </summary> /// <param name="code">The code of the object to resolve.</param> ! /// <param name="cultureInfo"> /// The <see cref="System.Globalization.CultureInfo"/> to resolve the /// code for. *************** *** 92,98 **** /// </returns> /// <seealso cref="Spring.Context.Support.AbstractMessageSource.ResolveObject(string, CultureInfo)"/> ! protected override object ResolveObject(string code, CultureInfo culture) { ! return _objects[GetLookupKey(code, culture)]; } --- 91,97 ---- /// </returns> /// <seealso cref="Spring.Context.Support.AbstractMessageSource.ResolveObject(string, CultureInfo)"/> ! protected override object ResolveObject(string code, CultureInfo cultureInfo) { ! return _objects[GetLookupKey(code, cultureInfo)]; } *************** *** 121,125 **** /// The base name of the object to use for key lookup. /// </param> ! /// <param name="culture"> /// The <see cref="System.Globalization.CultureInfo"/> with which the /// resource is associated. --- 120,124 ---- /// The base name of the object to use for key lookup. /// </param> ! /// <param name="cultureInfo"> /// The <see cref="System.Globalization.CultureInfo"/> with which the /// resource is associated. *************** *** 129,139 **** /// </exception> /// <seealso cref="Spring.Context.Support.AbstractMessageSource.ApplyResourcesToObject(object, string, CultureInfo)"/> ! protected override void ApplyResourcesToObject( ! object value, string objectName, CultureInfo culture) { #if !NET_1_0 if(value != null) { ! new ComponentResourceManager(value.GetType()).ApplyResources(value, objectName, culture); } #else --- 128,137 ---- /// </exception> /// <seealso cref="Spring.Context.Support.AbstractMessageSource.ApplyResourcesToObject(object, string, CultureInfo)"/> ! protected override void ApplyResourcesToObject(object value, string objectName, CultureInfo cultureInfo) { #if !NET_1_0 if(value != null) { ! new ComponentResourceManager(value.GetType()).ApplyResources(value, objectName, cultureInfo); } #else *************** *** 165,169 **** /// </summary> /// <param name="code">The lookup code.</param> ! /// <param name="culture"> /// The <see cref="System.Globalization.CultureInfo"/> to resolve the /// code for. --- 163,167 ---- /// </summary> /// <param name="code">The lookup code.</param> ! /// <param name="cultureInfo"> /// The <see cref="System.Globalization.CultureInfo"/> to resolve the /// code for. *************** *** 172,178 **** /// The object associated with this lookup code. /// </param> ! public void AddObject(string code, CultureInfo culture, object value) { ! _objects.Add(GetLookupKey(code, culture), value); } --- 170,176 ---- /// The object associated with this lookup code. /// </param> ! public void AddObject(string code, CultureInfo cultureInfo, object value) { ! _objects.Add(GetLookupKey(code, cultureInfo), value); } |
From: Erich E. <oak...@us...> - 2007-08-27 13:44:22
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Caching In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv13657/Caching Modified Files: AbstractCache.cs ICache.cs Log Message: reactivated warning 1591 "missing XML doc comment" excluded unused Spring.Core/Spring.Expressions.Parser/ExpressionParserTokenTypes..cs from builds Index: ICache.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Caching/ICache.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ICache.cs 25 Aug 2007 10:21:22 -0000 1.4 --- ICache.cs 27 Aug 2007 09:38:11 -0000 1.5 *************** *** 104,111 **** /// Item's time-to-live. /// </param> - /// <param name="slidingExpiration"> - /// Flag specifying whether the item's time-to-live should be reset - /// when the item is accessed. - /// </param> void Insert(object key, object value, TimeSpan timeToLive); } --- 104,107 ---- Index: AbstractCache.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Caching/AbstractCache.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** AbstractCache.cs 25 Aug 2007 10:21:21 -0000 1.5 --- AbstractCache.cs 27 Aug 2007 09:38:11 -0000 1.6 *************** *** 49,53 **** /// Gets/Sets a value, whether the this cache instance's <see cref="TimeToLive"/> /// shall be applied to all items, regardless of their individual TTL ! /// when <see cref="Insert(object,object,TimeSpan"/> is called. /// </summary> public bool EnforceTimeToLive --- 49,53 ---- /// Gets/Sets a value, whether the this cache instance's <see cref="TimeToLive"/> /// shall be applied to all items, regardless of their individual TTL ! /// when <see cref="Insert(object,object,TimeSpan)"/> is called. /// </summary> public bool EnforceTimeToLive |
From: Erich E. <oak...@us...> - 2007-08-27 13:44:13
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv13657 Modified Files: Spring.Core.2003.csproj Spring.Core.2005.csproj Spring.Core.build Log Message: reactivated warning 1591 "missing XML doc comment" excluded unused Spring.Core/Spring.Expressions.Parser/ExpressionParserTokenTypes..cs from builds Index: Spring.Core.2005.csproj =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Spring.Core.2005.csproj,v retrieving revision 1.105 retrieving revision 1.106 diff -C2 -d -r1.105 -r1.106 *** Spring.Core.2005.csproj 25 Aug 2007 14:26:34 -0000 1.105 --- Spring.Core.2005.csproj 27 Aug 2007 09:38:12 -0000 1.106 *************** *** 342,354 **** <Compile Include="Expressions\DefaultNode.cs" /> <Compile Include="Expressions\ExpressionConverter.cs" /> ! <Compile Include="Expressions\Parser\ExpressionLexer.cs"> ! <SubType>Code</SubType> ! </Compile> ! <Compile Include="Expressions\Parser\ExpressionParser.cs"> ! <SubType>Code</SubType> ! </Compile> ! <Compile Include="Expressions\Parser\ExpressionParserTokenTypes.cs"> ! <SubType>Code</SubType> ! </Compile> <Compile Include="Expressions\Processors\AverageAggregator.cs" /> <Compile Include="Expressions\Processors\NonNullProcessor.cs" /> --- 342,347 ---- <Compile Include="Expressions\DefaultNode.cs" /> <Compile Include="Expressions\ExpressionConverter.cs" /> ! <Compile Include="Expressions\Parser\ExpressionLexer.cs" /> ! <Compile Include="Expressions\Parser\ExpressionParser.cs" /> <Compile Include="Expressions\Processors\AverageAggregator.cs" /> <Compile Include="Expressions\Processors\NonNullProcessor.cs" /> *************** *** 1054,1059 **** <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <PropertyGroup> ! <PreBuildEvent> ! </PreBuildEvent> <PostBuildEvent> </PostBuildEvent> --- 1047,1052 ---- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <PropertyGroup> ! <PreBuildEvent>$(SolutionDir)\tools\antlr-2.7.6\antlr-2.7.6.exe -o $(ProjectDir)\Expressions\Parser $(ProjectDir)\Expressions\Expression.g ! </PreBuildEvent> <PostBuildEvent> </PostBuildEvent> Index: Spring.Core.build =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Spring.Core.build,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** Spring.Core.build 7 Aug 2007 23:21:46 -0000 1.31 --- Spring.Core.build 27 Aug 2007 09:38:12 -0000 1.32 *************** *** 8,16 **** --> <target name="build" depends="compileGrammar"> ! <csc target="library" define="${current.build.defines.csc}" ! warnaserror="false" ! debug="${current.build.debug}" ! output="${current.bin.dir}/${project::get-name()}.dll" ! doc="${current.bin.dir}/${project::get-name()}.xml" > <arg line="${compiler.args}"/> --- 8,18 ---- --> <target name="build" depends="compileGrammar"> ! <echo message="Compiling with args ${compiler.args}" /> ! <csc target="library" ! define="${current.build.defines.csc}" ! warnaserror="true" ! debug="${current.build.debug}" ! output="${current.bin.dir}/${project::get-name()}.dll" ! doc="${current.bin.dir}/${project::get-name()}.xml" > <arg line="${compiler.args}"/> *************** *** 18,26 **** <warning number="219" /> <warning number="162" /> ! <warning number="1591" /> </nowarn> <sources failonempty="true"> <include name="**/*.cs" /> <include name="../CommonAssemblyInfo.cs" /> </sources> <resources basedir="." prefix="Spring.Objects.Factory.Xml"> --- 20,31 ---- <warning number="219" /> <warning number="162" /> ! <warning number="618" /> <!-- disable deprecation warnings (due to deprecated code generated by antlr ) --> ! <!-- warning number="1591" / --> </nowarn> <sources failonempty="true"> <include name="**/*.cs" /> <include name="../CommonAssemblyInfo.cs" /> + <!-- not needed, but produces a lot of 1591 warnings: exclude it --> + <exclude name="Expressions/Parser/ExpressionParserTokenTypes.cs" /> </sources> <resources basedir="." prefix="Spring.Objects.Factory.Xml"> Index: Spring.Core.2003.csproj =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Spring.Core.2003.csproj,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** Spring.Core.2003.csproj 24 Aug 2007 22:48:49 -0000 1.46 --- Spring.Core.2003.csproj 27 Aug 2007 09:38:12 -0000 1.47 *************** *** 17,21 **** DelaySign = "false" OutputType = "Library" ! PreBuildEvent = "" PostBuildEvent = "" RootNamespace = "Spring" --- 17,21 ---- DelaySign = "false" OutputType = "Library" ! PreBuildEvent = "$(SolutionDir)\tools\antlr-2.7.6\antlr-2.7.6.exe -o $(ProjectDir)\Expressions\Parser $(ProjectDir)\Expressions\Expression.g" PostBuildEvent = "" RootNamespace = "Spring" *************** *** 1128,1136 **** /> <File - RelPath = "Expressions\Parser\ExpressionParserTokenTypes.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File RelPath = "Expressions\Parser\ExpressionParserTokenTypes.txt" BuildAction = "None" --- 1128,1131 ---- |
From: Erich E. <oak...@us...> - 2007-08-27 13:44:13
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Validation/Validators In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv13916 Modified Files: CreditCardValidator.cs Log Message: reactivated warning 1591 "missing XML doc comment" excluded unused Spring.Core/Spring.Expressions.Parser/ExpressionParserTokenTypes..cs from builds Index: CreditCardValidator.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Validation/Validators/CreditCardValidator.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CreditCardValidator.cs 8 Feb 2007 02:18:58 -0000 1.1 --- CreditCardValidator.cs 27 Aug 2007 09:38:56 -0000 1.2 *************** *** 258,261 **** --- 258,265 ---- { private static readonly String PREFIX = "4"; + + /// <summary> + /// Indicates, wheter the given credit card number matches a visa number. + /// </summary> public bool Matches(String card) { *************** *** 270,273 **** --- 274,281 ---- { private static readonly String PREFIX = "34,37,"; + + /// <summary> + /// Indicates, wheter the given credit card number matches an amex number. + /// </summary> public bool Matches(String card) { *************** *** 283,286 **** --- 291,298 ---- { private static readonly String PREFIX = "6011"; + + /// <summary> + /// Indicates, wheter the given credit card number matches a discover number. + /// </summary> public bool Matches(String card) { *************** *** 295,298 **** --- 307,314 ---- { private static readonly String PREFIX = "51,52,53,54,55,"; + + /// <summary> + /// Indicates, wheter the given credit card number matches a mastercard number. + /// </summary> public bool Matches(String card) { |
From: Mark P. <mar...@us...> - 2007-08-27 13:43:55
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv19001 Modified Files: Spring.Core.Tests.2005.csproj Log Message: SPRNET-453 - ConversionUtils should use ConvertFromInvariantString if failed to convert string value. Index: Spring.Core.Tests.2005.csproj =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Spring.Core.Tests.2005.csproj,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** Spring.Core.Tests.2005.csproj 25 Aug 2007 10:21:59 -0000 1.62 --- Spring.Core.Tests.2005.csproj 25 Aug 2007 16:08:36 -0000 1.63 *************** *** 305,308 **** --- 305,309 ---- <Compile Include="Objects\Factory\DummyConfigurableFactory.cs" /> <Compile Include="Objects\Factory\Support\ObjectDefinitionBuilderTests.cs" /> + <Compile Include="Objects\Factory\Xml\LocaleTests.cs" /> <Compile Include="Objects\Factory\Xml\ObjectFactorySectionHandlerTests.cs" /> <Compile Include="Objects\LazyTestObject.cs" /> *************** *** 768,771 **** --- 769,773 ---- <Content Include="Data\Spring\Objects\Factory\Xml\invoke-factory.xml" /> <Content Include="Data\Spring\Objects\Factory\Xml\lazy-init-multithreaded.xml" /> + <Content Include="Data\Spring\Objects\Factory\Xml\locale.xml" /> <Content Include="Data\Spring\Objects\Factory\Xml\no-objects.xml" /> <Content Include="Data\Spring\Objects\Factory\Xml\notfullyspecified.xml" /> |
From: Mark P. <mar...@us...> - 2007-08-27 13:43:39
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Core/TypeConversion In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv18587 Modified Files: TypeConversionUtils.cs Log Message: SPRNET-453 - ConversionUtils should use ConvertFromInvariantString if failed to convert string value. Index: TypeConversionUtils.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Core/TypeConversion/TypeConversionUtils.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TypeConversionUtils.cs 31 Jul 2007 18:16:08 -0000 1.1 --- TypeConversionUtils.cs 25 Aug 2007 16:07:35 -0000 1.2 *************** *** 97,101 **** if (typeConverter != null && typeConverter.CanConvertFrom(newValue.GetType())) { ! newValue = typeConverter.ConvertFrom(newValue); } else --- 97,111 ---- if (typeConverter != null && typeConverter.CanConvertFrom(newValue.GetType())) { ! try ! { ! newValue = typeConverter.ConvertFrom(newValue); ! } ! catch (Exception e) ! { ! if (newValue is string) ! { ! newValue = typeConverter.ConvertFromInvariantString((string)newValue); ! } ! } } else |
From: Mark P. <mar...@us...> - 2007-08-27 13:43:35
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Objects/Factory/Xml In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv19001/Objects/Factory/Xml Added Files: LocaleTests.cs Log Message: SPRNET-453 - ConversionUtils should use ConvertFromInvariantString if failed to convert string value. --- NEW FILE: LocaleTests.cs --- (This appears to be a binary file; contents omitted.) |
From: Mark P. <mar...@us...> - 2007-08-27 13:43:10
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Objects In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv19001/Objects Modified Files: TestObject.cs Log Message: SPRNET-453 - ConversionUtils should use ConvertFromInvariantString if failed to convert string value. Index: TestObject.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Objects/TestObject.cs,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** TestObject.cs 17 Aug 2007 02:43:30 -0000 1.35 --- TestObject.cs 25 Aug 2007 16:08:36 -0000 1.36 *************** *** 25,28 **** --- 25,29 ---- using System.ComponentModel; using System.ComponentModel.Design.Serialization; + using System.Drawing; using System.Globalization; using System.IO; *************** *** 296,299 **** --- 297,306 ---- } + + public Size Size + { + get { return size; } + set { size = value;} + } #endregion *************** *** 368,371 **** --- 375,379 ---- private IApplicationContext applicationContext; private string objectName; + private Size size; #endregion |
From: Erich E. <oak...@us...> - 2007-08-26 11:44:12
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Web.Tests In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv14656/Spring.Web.Tests Modified Files: Spring.Web.Tests.2003.csproj Log Message: added test for AbstractCache and AspNetCache Index: Spring.Web.Tests.2003.csproj =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Web.Tests/Spring.Web.Tests.2003.csproj,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** Spring.Web.Tests.2003.csproj 24 Aug 2007 22:48:59 -0000 1.30 --- Spring.Web.Tests.2003.csproj 25 Aug 2007 10:21:59 -0000 1.31 *************** *** 199,203 **** <File RelPath = "Util\ControlInterceptionTests.cs" ! SubType = "Code" BuildAction = "Compile" /> --- 199,203 ---- <File RelPath = "Util\ControlInterceptionTests.cs" ! SubType = "ASPXCodeBehind" BuildAction = "Compile" /> |
From: Erich E. <oak...@us...> - 2007-08-26 11:44:12
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Expressions In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv28257 Modified Files: ExpressionEvaluatorTests.cs Log Message: additional fix for SPRNET-499 (enable static inherited method calls) Index: ExpressionEvaluatorTests.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Expressions/ExpressionEvaluatorTests.cs,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** ExpressionEvaluatorTests.cs 24 Aug 2007 22:44:26 -0000 1.66 --- ExpressionEvaluatorTests.cs 26 Aug 2007 02:00:00 -0000 1.67 *************** *** 622,630 **** Assert.AreEqual(typeof (DateTime), exp.GetValue()); ! Assert.AreEqual(typeof (DateTime), ExpressionEvaluator.GetValue(null, "T(System.DateTime)")); ! Assert.AreEqual(typeof (DateTime[]), ExpressionEvaluator.GetValue(null, "T(System.DateTime[], mscorlib)")); ! Assert.AreEqual(typeof (ExpressionEvaluator), ! ExpressionEvaluator.GetValue(null, "T(Spring.Expressions.ExpressionEvaluator, Spring.Core)")); ! Assert.IsTrue((bool) ExpressionEvaluator.GetValue(tesla, "T(System.DateTime) == DOB.GetType()")); } --- 622,639 ---- Assert.AreEqual(typeof (DateTime), exp.GetValue()); ! Assert.AreEqual(typeof(DateTime), ExpressionEvaluator.GetValue(null, "T(System.DateTime)")); ! Assert.AreEqual(typeof(DateTime[]), ExpressionEvaluator.GetValue(null, "T(System.DateTime[], mscorlib)")); ! Assert.AreEqual(typeof(ExpressionEvaluator), ExpressionEvaluator.GetValue(null, "T(Spring.Expressions.ExpressionEvaluator, Spring.Core)")); ! Assert.IsTrue((bool)ExpressionEvaluator.GetValue(tesla, "T(System.DateTime) == DOB.GetType()")); ! } ! ! /// <summary> ! /// Tests type node ! /// </summary> ! [Test] ! [Ignore("does not work yet due to parser expecting ID production within T(ID)")] ! public void TestTypeNodeWithAssemblyQualifiedName() ! { ! Assert.AreEqual(typeof(ExpressionEvaluator), ExpressionEvaluator.GetValue(null, string.Format("T({0})", typeof(ExpressionEvaluator).AssemblyQualifiedName))); } *************** *** 2549,2552 **** --- 2558,2574 ---- Assert.AreEqual("Hello World", ExpressionEvaluator.GetValue(testClass, "#root.GetString()")); } + + [Test] + public void TestStaticInheritedMethodInvocation() + { + Assert.AreEqual("Hello Static World from SingleMethodTestClass", DerivedSingleMethodTestClass.StaticMethod()); + Assert.AreEqual("Hello Static World from SingleMethodTestClass", ExpressionEvaluator.GetValue(null, string.Format("T({0}).StaticMethod()", typeof(DerivedSingleMethodTestClass).FullName))); + + Assert.AreEqual("SingleMethodTestClass.ShadowedStaticMethod", SingleMethodTestClass.ShadowedStaticMethod()); + Assert.AreEqual("DerivedSingleMethodTestClass.ShadowedStaticMethod", DerivedSingleMethodTestClass.ShadowedStaticMethod()); + Assert.AreEqual("SingleMethodTestClass.ShadowedStaticMethod", ExpressionEvaluator.GetValue(null, string.Format("T({0}).ShadowedStaticMethod()", typeof(SingleMethodTestClass).FullName))); + Assert.AreEqual("DerivedSingleMethodTestClass.ShadowedStaticMethod", ExpressionEvaluator.GetValue(null, string.Format("T({0}).ShadowedStaticMethod()", typeof(DerivedSingleMethodTestClass).FullName))); + } + #endregion *************** *** 2572,2585 **** internal class SingleMethodTestClass { ! public string GetString() ! { ! return "Hello World"; ! } } internal class DerivedSingleMethodTestClass : SingleMethodTestClass { ! } --- 2594,2624 ---- internal class SingleMethodTestClass { ! protected static string GetMethodName(MethodBase method) ! { ! return method.DeclaringType.Name + "." + method.Name; ! } ! ! public static string StaticMethod() ! { ! return "Hello Static World from SingleMethodTestClass"; ! } + public static string ShadowedStaticMethod() + { + return GetMethodName(MethodInfo.GetCurrentMethod()); + } + + public string GetString() + { + return "Hello World"; + } } internal class DerivedSingleMethodTestClass : SingleMethodTestClass { ! public new static string ShadowedStaticMethod() ! { ! return GetMethodName(MethodInfo.GetCurrentMethod()); ! } } |