Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Proxy
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv4470
Modified Files:
AbstractProxyTypeBuilder.cs InheritanceProxyTypeBuilder.cs
Log Message:
Problems with Attributes in proxy generation [SPRNET-606]
(Proxy SecurityAttribute in .NET 2.0)
Index: InheritanceProxyTypeBuilder.cs
===================================================================
RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Proxy/InheritanceProxyTypeBuilder.cs,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** InheritanceProxyTypeBuilder.cs 31 Mar 2007 01:09:05 -0000 1.13
--- InheritanceProxyTypeBuilder.cs 4 Dec 2007 18:38:02 -0000 1.14
***************
*** 75,79 ****
{
Name = "InheritanceProxy";
! //ExposeTargetAttributes = false;
}
--- 75,79 ----
{
Name = "InheritanceProxy";
! //ProxyTargetAttributes = false;
}
Index: AbstractProxyTypeBuilder.cs
===================================================================
RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Proxy/AbstractProxyTypeBuilder.cs,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** AbstractProxyTypeBuilder.cs 3 Dec 2007 23:31:27 -0000 1.31
--- AbstractProxyTypeBuilder.cs 4 Dec 2007 18:38:02 -0000 1.32
***************
*** 366,374 ****
// add attributes that apply to the target type
#if NET_2_0
try
{
! foreach (CustomAttributeData cad in CustomAttributeData.GetCustomAttributes(type))
{
! attributes.Add(cad);
}
}
--- 366,386 ----
// add attributes that apply to the target type
#if NET_2_0
+ object[] attrs = type.GetCustomAttributes(false);
try
{
! System.Collections.Generic.IList<CustomAttributeData> attrsData =
! CustomAttributeData.GetCustomAttributes(type);
!
! if (attrs.Length != attrsData.Count)
{
! // http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=94803
! attributes.AddRange(attrs);
! }
! else
! {
! foreach (CustomAttributeData cad in attrsData)
! {
! attributes.Add(cad);
! }
}
}
***************
*** 376,385 ****
{
// http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=296032
! attributes.AddRange(type.GetCustomAttributes(false));
}
catch (CustomAttributeFormatException)
{
// http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=161522
! attributes.AddRange(type.GetCustomAttributes(false));
}
#else
--- 388,397 ----
{
// http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=296032
! attributes.AddRange(attrs);
}
catch (CustomAttributeFormatException)
{
// http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=161522
! attributes.AddRange(attrs);
}
#else
***************
*** 412,420 ****
// add attributes that apply to the target method
#if NET_2_0
try
{
! foreach (CustomAttributeData cad in CustomAttributeData.GetCustomAttributes(method))
{
! attributes.Add(cad);
}
}
--- 424,444 ----
// add attributes that apply to the target method
#if NET_2_0
+ object[] attrs = method.GetCustomAttributes(false);
try
{
! System.Collections.Generic.IList<CustomAttributeData> attrsData =
! CustomAttributeData.GetCustomAttributes(method);
!
! if (attrs.Length != attrsData.Count)
{
! // http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=94803
! attributes.AddRange(attrs);
! }
! else
! {
! foreach (CustomAttributeData cad in attrsData)
! {
! attributes.Add(cad);
! }
}
}
***************
*** 422,426 ****
{
// http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=296032
! attributes.AddRange(method.GetCustomAttributes(false));
}
#else
--- 446,450 ----
{
// http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=296032
! attributes.AddRange(attrs);
}
#else
***************
*** 465,473 ****
{
// add attributes that apply to the target method' return type
try
{
! foreach (CustomAttributeData cad in CustomAttributeData.GetCustomAttributes(method.ReturnParameter))
{
! attributes.Add(cad);
}
}
--- 489,509 ----
{
// add attributes that apply to the target method' return type
+ object[] attrs = method.ReturnTypeCustomAttributes.GetCustomAttributes(false);
try
{
! System.Collections.Generic.IList<CustomAttributeData> attrsData =
! CustomAttributeData.GetCustomAttributes(method.ReturnParameter);
!
! if (attrs.Length != attrsData.Count)
{
! // http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=94803
! attributes.AddRange(attrs);
! }
! else
! {
! foreach (CustomAttributeData cad in attrsData)
! {
! attributes.Add(cad);
! }
}
}
***************
*** 475,479 ****
{
// http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=296032
! attributes.AddRange(method.ReturnTypeCustomAttributes.GetCustomAttributes(false));
}
}
--- 511,515 ----
{
// http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=296032
! attributes.AddRange(attrs);
}
}
***************
*** 503,511 ****
// add attributes that apply to the target method's parameter
#if NET_2_0
try
{
! foreach (CustomAttributeData cad in CustomAttributeData.GetCustomAttributes(paramInfo))
{
! attributes.Add(cad);
}
}
--- 539,559 ----
// add attributes that apply to the target method's parameter
#if NET_2_0
+ object[] attrs = paramInfo.GetCustomAttributes(false);
try
{
! System.Collections.Generic.IList<CustomAttributeData> attrsData =
! CustomAttributeData.GetCustomAttributes(paramInfo);
!
! if (attrs.Length != attrsData.Count)
{
! // http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=94803
! attributes.AddRange(attrs);
! }
! else
! {
! foreach (CustomAttributeData cad in attrsData)
! {
! attributes.Add(cad);
! }
}
}
***************
*** 513,517 ****
{
// http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=296032
! attributes.AddRange(paramInfo.GetCustomAttributes(false));
}
#else
--- 561,565 ----
{
// http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=296032
! attributes.AddRange(attrs);
}
#else
|