SPRNET-1563 Make code as ClsCompliant as possible

This commit is contained in:
Marko Lahma
2013-12-03 19:09:19 +02:00
parent 72fd5be280
commit 1b73368826
72 changed files with 1271 additions and 1106 deletions

View File

@@ -1,3 +1,9 @@
Changes (1.3.2 to 2.0)
========================
Protected fields were changed to private. Access is now allowed via public/protected property member.
Changes (1.3.1 to 1.3.2)
========================

View File

@@ -99,10 +99,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Web.Conversation.NHi
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Web.Conversation.NHibernate33.Tests.2010", "test\Spring\Spring.Web.Conversation.NHibernate33.Tests\Spring.Web.Conversation.NHibernate33.Tests.2010.csproj", "{C57B05EA-FD1A-40EC-BB60-D2E45AB1A86A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Web.Mvc5.2010", "src\Spring\Spring.Web.Mvc5\Spring.Web.Mvc5.2010.csproj", "{39AAD7EA-2ED0-4E50-8D4D-C666EA9CBFE4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Web.Mvc5.Tests.2010", "test\Spring\Spring.Web.Mvc5.Tests\Spring.Web.Mvc5.Tests.2010.csproj", "{B9590252-6D58-4587-950C-475AB61FDBCF}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{79F495DF-83D6-435E-A20E-47800F6F8FE7}"
ProjectSection(SolutionItems) = preProject
.nuget\NuGet.Config = .nuget\NuGet.Config
@@ -560,26 +556,6 @@ Global
{C57B05EA-FD1A-40EC-BB60-D2E45AB1A86A}.Release|Any CPU.Build.0 = Release|Any CPU
{C57B05EA-FD1A-40EC-BB60-D2E45AB1A86A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{C57B05EA-FD1A-40EC-BB60-D2E45AB1A86A}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{39AAD7EA-2ED0-4E50-8D4D-C666EA9CBFE4}.Debug|.NET.ActiveCfg = Debug|Any CPU
{39AAD7EA-2ED0-4E50-8D4D-C666EA9CBFE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{39AAD7EA-2ED0-4E50-8D4D-C666EA9CBFE4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{39AAD7EA-2ED0-4E50-8D4D-C666EA9CBFE4}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{39AAD7EA-2ED0-4E50-8D4D-C666EA9CBFE4}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{39AAD7EA-2ED0-4E50-8D4D-C666EA9CBFE4}.Release|.NET.ActiveCfg = Release|Any CPU
{39AAD7EA-2ED0-4E50-8D4D-C666EA9CBFE4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{39AAD7EA-2ED0-4E50-8D4D-C666EA9CBFE4}.Release|Any CPU.Build.0 = Release|Any CPU
{39AAD7EA-2ED0-4E50-8D4D-C666EA9CBFE4}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{39AAD7EA-2ED0-4E50-8D4D-C666EA9CBFE4}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{B9590252-6D58-4587-950C-475AB61FDBCF}.Debug|.NET.ActiveCfg = Debug|Any CPU
{B9590252-6D58-4587-950C-475AB61FDBCF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B9590252-6D58-4587-950C-475AB61FDBCF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B9590252-6D58-4587-950C-475AB61FDBCF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{B9590252-6D58-4587-950C-475AB61FDBCF}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{B9590252-6D58-4587-950C-475AB61FDBCF}.Release|.NET.ActiveCfg = Release|Any CPU
{B9590252-6D58-4587-950C-475AB61FDBCF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B9590252-6D58-4587-950C-475AB61FDBCF}.Release|Any CPU.Build.0 = Release|Any CPU
{B9590252-6D58-4587-950C-475AB61FDBCF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{B9590252-6D58-4587-950C-475AB61FDBCF}.Release|Mixed Platforms.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@@ -3,6 +3,24 @@
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_BLANK_LINES_IN_CODE/@EntryValue">1</s:Int64>
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_BLANK_LINES_IN_DECLARATIONS/@EntryValue">1</s:Int64>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_LINES/@EntryValue">False</s:Boolean>
<s:String x:Key="/Default/CodeStyle/FileHeader/FileHeaderRegionName/@EntryValue">License</s:String>
<s:String x:Key="/Default/CodeStyle/FileHeader/FileHeaderText/@EntryValue">&#xD;
/*&#xD;
* Copyright 2002-$CURRENT_YEAR$ the original author or authors.&#xD;
*&#xD;
* Licensed under the Apache License, Version 2.0 (the "License");&#xD;
* you may not use this file except in compliance with the License.&#xD;
* You may obtain a copy of the License at&#xD;
*&#xD;
* http://www.apache.org/licenses/LICENSE-2.0&#xD;
*&#xD;
* Unless required by applicable law or agreed to in writing, software&#xD;
* distributed under the License is distributed on an "AS IS" BASIS,&#xD;
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#xD;
* See the License for the specific language governing permissions and&#xD;
* limitations under the License.&#xD;
*/&#xD;
</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ID/@EntryIndexedValue"></s:String>
<s:Boolean x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ID/@EntryIndexRemoved">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=URL/@EntryIndexedValue"></s:String>
@@ -11,6 +29,7 @@
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticReadonly/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:Boolean x:Key="/Default/CodeInspection/Highlighting/IdentifierHighlightingEnabled/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/CodeInspection/Highlighting/AnalysisEnabled/@EntryValue">SOLUTION</s:String>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/TextControl/HighlightCurrentLine/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_IFELSE_BRACES_STYLE/@EntryValue">ALWAYS_ADD</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_FOR_BRACES_STYLE/@EntryValue">ALWAYS_ADD</s:String>

View File

@@ -237,7 +237,7 @@
</target>
<target name="common.set-assembly-attribute-values" depends="generate-build-number">
<property name="assembly.is-cls-compliant" value="false" />
<property name="assembly.is-cls-compliant" value="true" />
<property name="assembly.configuration" value="${nant.settings.currentframework}.win32; ${current.build.config}"/>
<if test="${nant.settings.currentframework!='mono-2.0'}">
<property name="assembly.product" value="${project.name.full} ${package.version} for .NET ${nant.settings.currentframework.number}" />-->
@@ -273,7 +273,7 @@
<import namespace="System.Reflection" />
</imports>
<attributes>
<attribute type="CLSCompliantAttribute" value="${assembly.is-cls-compliant}" />
<attribute type="CLSCompliantAttribute" value="${assembly.is-cls-compliant}" />
<attribute type="AssemblyConfigurationAttribute" value="${assembly.configuration}" />
<attribute type="AssemblyProductAttribute" value="${assembly.product}" />
<attribute type="AssemblyCompanyAttribute" value="${assembly.company}" />

View File

@@ -53,7 +53,7 @@ ${current.bin.dir}: the binary directory to output the assembly + app.config to
-->
<target name="common.init" description="Initializes build properties">
<property name="assembly.is-cls-compliant" value="false" />
<property name="assembly.is-cls-compliant" value="true" />
<property name="assembly.version" value="1.0.0.0" />
<property name="assembly.version.informational" value="1.0" />

View File

@@ -1,6 +1,7 @@
using System;
using System.Reflection;
[assembly: CLSCompliant(false)]
[assembly: CLSCompliant(true)]
//
// General Information about an assembly is controlled through the following

View File

@@ -55,39 +55,39 @@ namespace Spring.Aop.Framework
/// The arguments (if any = may be <see lang="null"/>) to the method
/// that is to be invoked.
/// </summary>
protected object[] arguments;
private object[] arguments;
/// <summary>
/// The target object that the method is to be invoked on.
/// </summary>
protected object target;
private readonly object target;
/// <summary>
/// The AOP proxy for the target object.
/// </summary>
protected object proxy;
private object proxy;
/// <summary>
/// The method invocation that is to be invoked.
/// </summary>
protected MethodInfo method;
private MethodInfo method;
/// <summary>
/// The list of <see cref="AopAlliance.Intercept.IMethodInterceptor"/> and
/// <cref see="Spring.Aop.Framework.InterceptorAndDynamicMethodMatcher"/>
/// that need dynamic checks.
/// </summary>
protected IList interceptors;
private IList interceptors;
/// <summary>
/// The declaring type of the method that is to be invoked.
/// </summary>
protected Type targetType;
private Type targetType;
/// <summary>
/// The index from 0 of the current interceptor we're invoking.
/// </summary>
protected int currentInterceptorIndex;
private int currentInterceptorIndex;
/// <summary>
/// Creates a new instance of the
@@ -128,16 +128,11 @@ namespace Spring.Aop.Framework
protected AbstractMethodInvocation(object proxy, object target,
MethodInfo method, object[] arguments, Type targetType, IList interceptors)
{
#region Sanity Check
// EE: There is not necessarily always a target - e.g. for DynamicEntities
// EE: There is not necessarily always a target - e.g. for DynamicEntities
// moved this check to InvokeJoinpoint()
// AssertUtils.ArgumentNotNull(target, "target");
AssertUtils.ArgumentNotNull(method, "method");
#endregion
this.proxy = proxy;
this.proxy = proxy;
this.target = target;
this.method = method;
this.targetType = targetType;
@@ -157,10 +152,11 @@ namespace Spring.Aop.Framework
/// <see cref="AopAlliance.Intercept.IMethodInvocation.Method"/>
public virtual MethodInfo Method
{
get { return method; }
}
get { return method; }
protected set { method = value; }
}
/// <summary>
/// <summary>
/// Gets the static part of this joinpoint.
/// </summary>
/// <value>
@@ -181,6 +177,7 @@ namespace Spring.Aop.Framework
public virtual object Proxy
{
get { return this.proxy; }
protected set { this.proxy = value; }
}
/// <summary>
/// Gets the target object for the invocation.
@@ -200,7 +197,8 @@ namespace Spring.Aop.Framework
/// </value>
public virtual Type TargetType
{
get { return this.targetType; }
get { return this.targetType; }
protected set { this.targetType = value; }
}
/// <summary>
@@ -240,7 +238,16 @@ namespace Spring.Aop.Framework
get { return this.target; }
}
/// <summary>
/// <summary>
/// The index from 0 of the current interceptor we're invoking.
/// </summary>
protected int CurrentInterceptorIndex
{
get { return currentInterceptorIndex; }
set { currentInterceptorIndex = value; }
}
/// <summary>
/// Proceeds to the next interceptor in the chain.
/// </summary>
/// <returns>
@@ -357,15 +364,15 @@ namespace Spring.Aop.Framework
{
StringBuilder buffer = new StringBuilder("Invocation: method '");
buffer.Append(Method.Name).Append("', ").Append("arguments ");
buffer.Append(this.arguments != null ? StringUtils.CollectionToCommaDelimitedString(this.arguments) : "[none]");
buffer.Append(Arguments != null ? StringUtils.CollectionToCommaDelimitedString(Arguments) : "[none]");
buffer.Append("; ");
if (this.target == null)
if (Target == null)
{
buffer.Append("target is null.");
}
else
{
buffer.Append("target is of Type [").Append(this.targetType.FullName).Append(']');
buffer.Append("target is of Type [").Append(TargetType.FullName).Append(']');
}
return buffer.ToString();
}

View File

@@ -44,7 +44,7 @@ namespace Spring.Aop.Framework
/// <summary>
/// The method invocation that is to be invoked on the proxy.
/// </summary>
protected MethodInfo proxyMethod;
private MethodInfo proxyMethod;
/// <summary>
/// Creates a new instance of the
@@ -73,6 +73,15 @@ namespace Spring.Aop.Framework
this.proxyMethod = proxyMethod;
}
/// <summary>
/// The method invocation that is to be invoked on the proxy.
/// </summary>
protected MethodInfo ProxyMethod
{
get { return proxyMethod; }
set { proxyMethod = value; }
}
/// <summary>
/// Invokes the joinpoint using dynamic reflection.
/// </summary>
@@ -90,14 +99,14 @@ namespace Spring.Aop.Framework
/// <see cref="Spring.Aop.Framework.AbstractMethodInvocation.InvokeJoinpoint"/>
protected override object InvokeJoinpoint()
{
MethodInfo targetMethodInfo = ((this.proxyMethod == null)) ? method : this.proxyMethod;
MethodInfo targetMethodInfo = this.proxyMethod ?? Method;
IDynamicMethod targetMethod = new SafeMethod(targetMethodInfo);
try
{
AssertUtils.Understands(target, "target", targetMethodInfo);
return targetMethod.Invoke(target, arguments);
AssertUtils.Understands(Target, "target", targetMethodInfo);
return targetMethod.Invoke(Target, Arguments);
}
// Only happens if fallback to standard reflection.
catch (TargetInvocationException ex)
@@ -119,9 +128,8 @@ namespace Spring.Aop.Framework
/// </returns>
protected override IMethodInvocation PrepareMethodInvocationForProceed(IMethodInvocation invocation)
{
DynamicMethodInvocation rmi = new DynamicMethodInvocation(
this.proxy, this.target, this.method, this.proxyMethod, this.arguments, this.targetType, this.interceptors);
rmi.currentInterceptorIndex = this.currentInterceptorIndex + 1;
var rmi = new DynamicMethodInvocation(Proxy, Target, Method, ProxyMethod, Arguments, TargetType, Interceptors);
rmi.CurrentInterceptorIndex = CurrentInterceptorIndex + 1;
return rmi;
}

View File

@@ -44,7 +44,7 @@ namespace Spring.Aop.Framework
/// <summary>
/// The method invocation that is to be invoked on the proxy.
/// </summary>
protected MethodInfo proxyMethod;
private MethodInfo proxyMethod;
/// <summary>
/// Creates a new instance of the
@@ -73,7 +73,16 @@ namespace Spring.Aop.Framework
this.proxyMethod = proxyMethod;
}
/// <summary>
/// <summary>
/// The method invocation that is to be invoked on the proxy.
/// </summary>
protected MethodInfo ProxyMethod
{
get { return proxyMethod; }
set { proxyMethod = value; }
}
/// <summary>
/// Invokes the joinpoint using standard reflection.
/// </summary>
/// <remarks>
@@ -92,10 +101,10 @@ namespace Spring.Aop.Framework
{
try
{
MethodInfo targetMethodInfo = ((this.proxyMethod == null)) ? method : this.proxyMethod;
MethodInfo targetMethodInfo = ProxyMethod ?? Method;
AssertUtils.Understands(target, "target", targetMethodInfo);
return targetMethodInfo.Invoke(target, arguments);
AssertUtils.Understands(Target, "target", targetMethodInfo);
return targetMethodInfo.Invoke(Target, Arguments);
}
catch (TargetInvocationException ex)
{
@@ -116,9 +125,8 @@ namespace Spring.Aop.Framework
/// </returns>
protected override IMethodInvocation PrepareMethodInvocationForProceed(IMethodInvocation invocation)
{
ReflectiveMethodInvocation rmi = new ReflectiveMethodInvocation(
this.proxy, this.target, this.method, this.proxyMethod, this.arguments, this.targetType, this.interceptors);
rmi.currentInterceptorIndex = this.currentInterceptorIndex + 1;
var rmi = new ReflectiveMethodInvocation(Proxy, Target, Method, ProxyMethod, Arguments, TargetType, Interceptors);
rmi.CurrentInterceptorIndex = CurrentInterceptorIndex + 1;
return rmi;
}

View File

@@ -85,7 +85,7 @@
<Optimize>true</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>none</DebugType>
<ErrorReport>prompt</ErrorReport>

View File

@@ -84,16 +84,19 @@ namespace Spring.Context.Attributes
/// <summary>
/// Stores the object default definitons defined in the XML configuration documnet
/// </summary>
protected DocumentDefaultsDefinition _defaults;
private DocumentDefaultsDefinition _defaults;
protected string _scanStartFolderPath;
private string _scanStartFolderPath;
/// <summary>
/// Stores the object default definitons defined in the XML configuration documnet
/// </summary>
public DocumentDefaultsDefinition Defaults { get { return _defaults; } set { _defaults = value; } }
public DocumentDefaultsDefinition Defaults
{
get { return _defaults; }
set { _defaults = value; }
}
public string ScanStartFolderPath
{

View File

@@ -44,7 +44,14 @@ namespace Spring.Context.Attributes
/// <summary>
/// Initializes a new instance of the DependsOn class.
/// </summary>
/// <param name="name"></param>
public DependsOnAttribute(string name)
: this(new[] { name })
{
}
/// <summary>
/// Initializes a new instance of the DependsOn class.
/// </summary>
public DependsOnAttribute(params string[] name)
{
_name = name;

View File

@@ -37,6 +37,13 @@ namespace Spring.Context.Attributes
public class ImportAttribute : Attribute
{
private Type[] _types;
/// <summary>
/// Initializes a new instance of the Import class.
/// </summary>
public ImportAttribute(Type type) : this(new []{ type })
{
}
/// <summary>
/// Initializes a new instance of the Import class.

View File

@@ -74,6 +74,7 @@ namespace Spring.Expressions
/// Gets the right operand.
/// </summary>
/// <value>The right operand.</value>
[CLSCompliant(false)]
public BaseNode Right
{
get { return (BaseNode) this.getFirstChild().getNextSibling(); }

File diff suppressed because it is too large Load Diff

View File

@@ -1,152 +1,152 @@
using System;
using System;
using System.Runtime.Serialization;
using Spring.Expressions.Parser.antlr;
using Spring.Expressions.Parser.antlr.collections;
namespace Spring.Expressions
{
/// <summary>
/// For internal purposes only. Use <see cref="BaseNode"/> for expression node implementations.
/// </summary>
/// <remarks>
/// This class is only required to enable serialization of parsed Spring expressions since antlr.CommonAST
/// unfortunately is not marked as [Serializable].<br/>
/// <br/>
/// <b>Note:</b>Since SpringAST implements <see cref="ISerializable"/>, deriving classes
/// have to explicitely override <see cref="GetObjectData"/> if they need to persist additional
/// data during serialization.
/// </remarks>
[Serializable]
public class SpringAST : Parser.antlr.BaseAST, ISerializable
{
#region Global SpringAST Factory
internal class SpringASTCreator : Parser.antlr.ASTNodeCreator
{
public override Parser.antlr.collections.AST Create()
{
return new SpringAST();
}
public override string ASTNodeTypeName
{
get { return typeof(SpringAST).FullName; }
}
}
/// <summary>
/// The global SpringAST node factory
/// </summary>
internal static readonly SpringASTCreator Creator = new SpringASTCreator();
#endregion
#region Members
private string text;
private int ttype;
#endregion
/// <summary>
/// Create an instance
/// </summary>
public SpringAST()
{}
/// <summary>
/// Create an instance from a token
/// </summary>
public SpringAST(IToken token)
{
initialize(token);
}
/// <summary>
/// initialize this instance from an AST
/// </summary>
public override void initialize(AST t)
{
this.setText(t.getText());
this.Type = t.Type;
}
/// <summary>
/// initialize this instance from an IToken
/// </summary>
public override void initialize(IToken tok)
{
this.setText(tok.getText());
this.Type = tok.Type;
}
/// <summary>
/// initialize this instance from a token type number and a text
/// </summary>
public override void initialize(int t, string txt)
{
this.Type = t;
this.setText(txt);
}
/// <summary>
/// gets or sets the token type of this node
/// </summary>
public override int Type
{
get { return this.ttype; }
set { this.ttype = value; }
}
/// <summary>
/// gets or sets the text of this node
/// </summary>
public string Text
{
get { return this.getText(); }
set { this.setText(value); }
}
/// <summary>
/// sets the text of this node
/// </summary>
public override void setText(string txt)
{
this.text = txt;
}
/// <summary>
/// gets the text of this node
/// </summary>
public override string getText()
{
return this.text;
}
#region ISerializable Implementation
/// <summary>
/// Create a new instance from SerializationInfo
/// </summary>
protected SpringAST(SerializationInfo info, StreamingContext context)
{
base.down = (BaseAST)info.GetValue("down", typeof(BaseAST));
base.right = (BaseAST)info.GetValue("right", typeof(BaseAST));
this.ttype = info.GetInt32("ttype");
this.text = info.GetString("text");
}
/// <summary>
/// populate SerializationInfo from this instance
/// </summary>
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
{
info.AddValue("down", base.down, typeof(SpringAST));
info.AddValue("right", base.right, typeof(SpringAST));
info.AddValue("ttype", this.Type, typeof(int));
info.AddValue("text", this.Text, typeof(string));
}
#endregion
}
using Spring.Expressions.Parser.antlr.collections;
namespace Spring.Expressions
{
/// <summary>
/// For internal purposes only. Use <see cref="BaseNode"/> for expression node implementations.
/// </summary>
/// <remarks>
/// This class is only required to enable serialization of parsed Spring expressions since antlr.CommonAST
/// unfortunately is not marked as [Serializable].<br/>
/// <br/>
/// <b>Note:</b>Since SpringAST implements <see cref="ISerializable"/>, deriving classes
/// have to explicitely override <see cref="GetObjectData"/> if they need to persist additional
/// data during serialization.
/// </remarks>
[Serializable]
public class SpringAST : Parser.antlr.BaseAST, ISerializable
{
#region Global SpringAST Factory
internal class SpringASTCreator : Parser.antlr.ASTNodeCreator
{
public override Parser.antlr.collections.AST Create()
{
return new SpringAST();
}
public override string ASTNodeTypeName
{
get { return typeof(SpringAST).FullName; }
}
}
/// <summary>
/// The global SpringAST node factory
/// </summary>
internal static readonly SpringASTCreator Creator = new SpringASTCreator();
#endregion
#region Members
private string text;
private int ttype;
#endregion
/// <summary>
/// Create an instance
/// </summary>
public SpringAST()
{}
/// <summary>
/// Create an instance from a token
/// </summary>
public SpringAST(IToken token)
{
initialize(token);
}
/// <summary>
/// initialize this instance from an AST
/// </summary>
public override void initialize(AST t)
{
this.setText(t.getText());
this.Type = t.Type;
}
/// <summary>
/// initialize this instance from an IToken
/// </summary>
public override void initialize(IToken tok)
{
this.setText(tok.getText());
this.Type = tok.Type;
}
/// <summary>
/// initialize this instance from a token type number and a text
/// </summary>
public override void initialize(int t, string txt)
{
this.Type = t;
this.setText(txt);
}
/// <summary>
/// gets or sets the token type of this node
/// </summary>
public override int Type
{
get { return this.ttype; }
set { this.ttype = value; }
}
/// <summary>
/// gets or sets the text of this node
/// </summary>
public string Text
{
get { return this.getText(); }
set { this.setText(value); }
}
/// <summary>
/// sets the text of this node
/// </summary>
public override void setText(string txt)
{
this.text = txt;
}
/// <summary>
/// gets the text of this node
/// </summary>
public override string getText()
{
return this.text;
}
#region ISerializable Implementation
/// <summary>
/// Create a new instance from SerializationInfo
/// </summary>
protected SpringAST(SerializationInfo info, StreamingContext context)
{
base.down = (BaseAST)info.GetValue("down", typeof(BaseAST));
base.right = (BaseAST)info.GetValue("right", typeof(BaseAST));
this.ttype = info.GetInt32("ttype");
this.text = info.GetString("text");
}
/// <summary>
/// populate SerializationInfo from this instance
/// </summary>
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
{
info.AddValue("down", base.down, typeof(SpringAST));
info.AddValue("right", base.right, typeof(SpringAST));
info.AddValue("ttype", this.Type, typeof(int));
info.AddValue("text", this.Text, typeof(string));
}
#endregion
}
}

View File

@@ -441,7 +441,7 @@ namespace Spring.Objects.Factory.Attributes
public override void Inject(Object instance, String objectName, IPropertyValues pvs)
{
var property = (PropertyInfo) _member;
var property = (PropertyInfo) Member;
try
{
Object value;
@@ -513,7 +513,7 @@ namespace Spring.Objects.Factory.Attributes
public override void Inject(Object instance, String objectName, IPropertyValues pvs)
{
var field = (FieldInfo) _member;
var field = (FieldInfo) Member;
try
{
Object value;
@@ -585,7 +585,7 @@ namespace Spring.Objects.Factory.Attributes
public override void Inject(Object target, string objectName, IPropertyValues pvs)
{
MethodInfo method = _member as MethodInfo;
MethodInfo method = Member as MethodInfo;
try
{
Object[] arguments;

View File

@@ -89,7 +89,7 @@ namespace Spring.Objects.Factory.Attributes
/// <summary>
/// The Property, field, method or constructor info
/// </summary>
protected readonly MemberInfo _member;
private readonly MemberInfo _member;
/// <summary>
/// Instantiates a new inject element
@@ -100,6 +100,11 @@ namespace Spring.Objects.Factory.Attributes
_member = member;
}
public MemberInfo Member
{
get { return _member; }
}
/// <summary>
/// Ececuted to inject value to associated memeber info
/// </summary>

View File

@@ -38,7 +38,7 @@ namespace Spring.Objects.Factory.Config
[Serializable]
public class ConfigurableVariableSource : IVariableSource
{
protected NameValueCollection _variables;
private NameValueCollection _variables;
/// <summary>
/// Initializes a new instance of <see cref="ConfigurableVariableSource"/>.

View File

@@ -243,6 +243,7 @@ namespace Spring.Objects.Factory.Config
/// A <see cref="ulong"/> that contains the value of the specified variable
/// or <paramref name="defaultValue"/>, if <see cref="IVariableSource.ResolveVariable"/> returns <c>null</c>.
/// </returns>
[CLSCompliant(false)]
public ulong GetUInt64(string name, ulong defaultValue)
{
return GetUInt64(name, defaultValue, true);
@@ -261,6 +262,7 @@ namespace Spring.Objects.Factory.Config
/// A <see cref="ulong"/> that contains the value of the specified variable
/// or <paramref name="defaultValue"/>, if <see cref="IVariableSource.ResolveVariable"/> cannot be parsed.
/// </returns>
[CLSCompliant(false)]
public ulong GetUInt64(string name, ulong defaultValue, bool throwOnInvalidValue)
{
try
@@ -337,6 +339,7 @@ namespace Spring.Objects.Factory.Config
/// A <see cref="uint"/> that contains the value of the specified variable
/// or <paramref name="defaultValue"/>, if <see cref="IVariableSource.ResolveVariable"/> returns <c>null</c>.
/// </returns>
[CLSCompliant(false)]
public uint GetUInt32(string name, uint defaultValue)
{
return GetUInt32(name, defaultValue, true);
@@ -355,6 +358,7 @@ namespace Spring.Objects.Factory.Config
/// A <see cref="uint"/> that contains the value of the specified variable
/// or <paramref name="defaultValue"/>, if <see cref="IVariableSource.ResolveVariable"/> cannot be parsed.
/// </returns>
[CLSCompliant(false)]
public uint GetUInt32(string name, uint defaultValue, bool throwOnInvalidValue)
{
try
@@ -431,6 +435,7 @@ namespace Spring.Objects.Factory.Config
/// A <see cref="short"/> that contains the value of the specified variable
/// or <paramref name="defaultValue"/>, if <see cref="IVariableSource.ResolveVariable"/> returns <c>null</c>.
/// </returns>
[CLSCompliant(false)]
public ushort GetUInt16(string name, ushort defaultValue)
{
return GetUInt16(name, defaultValue, true);
@@ -449,6 +454,7 @@ namespace Spring.Objects.Factory.Config
/// A <see cref="short"/> that contains the value of the specified variable
/// or <paramref name="defaultValue"/>, if <see cref="IVariableSource.ResolveVariable"/> cannot be parsed.
/// </returns>
[CLSCompliant(false)]
public ushort GetUInt16(string name, ushort defaultValue, bool throwOnInvalidValue)
{
try

View File

@@ -158,7 +158,7 @@ namespace Spring.Objects.Factory.Support
/// <summary>
/// Whether to cache object metadata or rather reobtain it for every access
/// </summary>
protected bool cacheObjectMetadata = true;
private bool cacheObjectMetadata = true;
/// <summary>
@@ -766,6 +766,7 @@ namespace Spring.Objects.Factory.Support
protected bool CacheObjectMetadata
{
get { return this.cacheObjectMetadata; }
set { this.cacheObjectMetadata = value; }
}
/// <summary>

View File

@@ -60,11 +60,12 @@
<Optimize>false</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>full</DebugType>
<ErrorReport>prompt</ErrorReport>
<WarningsAsErrors>1591</WarningsAsErrors>
<WarningsAsErrors>
</WarningsAsErrors>
<RunCodeAnalysis>false</RunCodeAnalysis>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
@@ -85,7 +86,7 @@
<Optimize>true</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>none</DebugType>
<ErrorReport>prompt</ErrorReport>

View File

@@ -36,7 +36,7 @@ namespace Spring.Data.Core
{
protected object AdoUtils;
protected int commandTimeout = -1;
private int commandTimeout = -1;
#region Properties

View File

@@ -57,7 +57,7 @@ namespace Spring.Data.Core
private IAdoExceptionTranslator exceptionTranslator;
private bool lazyInit = true;
protected Type dataReaderWrapperType;
private Type dataReaderWrapperType;
protected IDynamicConstructor newDataReaderWrapper;
#endregion

View File

@@ -50,8 +50,7 @@ namespace Spring.Data.Generic
#region Fields
private Core.AdoTemplate classicAdoTemplate;
protected Type dataReaderWrapperType;
#endregion
#region Constructors
@@ -172,10 +171,10 @@ namespace Spring.Data.Generic
/// </remarks>
public override int CommandTimeout
{
get { return commandTimeout; }
get { return base.CommandTimeout; }
set
{
commandTimeout = value;
base.CommandTimeout = value;
classicAdoTemplate.CommandTimeout = value;
}
}

View File

@@ -54,7 +54,7 @@ namespace Spring.Data.Objects
/// least checking that a IDbProvider and sql have been provided,
/// but subclasses may also implement their own custom validation.
/// </summary>
protected bool compiled;
private bool compiled;
/// <summary>
/// Object enabling us to create IDbCommands
@@ -132,6 +132,7 @@ namespace Spring.Data.Objects
public bool Compiled
{
get { return compiled; }
protected set { compiled = value; }
}
/// <summary>

View File

@@ -21,6 +21,7 @@
#region Imports
using System;
using Spring.Dao;
using Spring.Data.Common;
using Spring.Data.Core;
@@ -44,16 +45,14 @@ namespace Spring.Data.Objects
/// <author>Mark Pollack (.NET)</author>
public abstract class AdoOperation : AbstractAdoOperation
{
#region Fields
private AdoTemplate adoTemplate = new AdoTemplate();
#endregion
#region Constructor (s)
/// <summary>
/// Initializes a new instance of the <see cref="AdoOperation"/> class.
/// </summary>
@@ -61,7 +60,8 @@ namespace Spring.Data.Objects
/// before invoking the compile method and using this object.
/// </remarks>
public AdoOperation()
{}
{
}
/// <summary>
/// Initializes a new instance of the <see cref="AdoOperation"/> class.
@@ -72,7 +72,8 @@ namespace Spring.Data.Objects
/// <param name="provider">Database provider to use.</param>
public AdoOperation(IDbProvider provider)
: this(provider, null)
{}
{
}
/// <summary>
/// Initializes a new instance of the <see cref="AdoOperation"/> class.
@@ -86,7 +87,7 @@ namespace Spring.Data.Objects
{
//intialized AdoTemplate with the DbProvider
DbProvider = provider;
Sql = sql;
Sql = sql;
}
#endregion
@@ -107,13 +108,9 @@ namespace Spring.Data.Objects
}
adoTemplate = value;
}
get
{
return adoTemplate;
}
get { return adoTemplate; }
}
/// <summary>
/// Gets or sets the db provider.
/// </summary>
@@ -122,20 +119,15 @@ namespace Spring.Data.Objects
{
set
{
adoTemplate.DbProvider = value;
adoTemplate.DbProvider = value;
if (DeclaredParameters == null)
{
{
DeclaredParameters = new DbParameters(value);
}
}
get
{
return adoTemplate.DbProvider;
}
get { return adoTemplate.DbProvider; }
}
/// <summary>
/// Sets the command timeout for IDbCommands that this AdoTemplate executes.
/// </summary>
@@ -153,7 +145,6 @@ namespace Spring.Data.Objects
#endregion
#region Methods
/// <summary>
/// Compiles this operation. Ignores subsequent attempts to compile.
@@ -171,28 +162,20 @@ namespace Spring.Data.Objects
throw new InvalidDataAccessApiUsageException("Setting of CommandType is required");
}
try
{
try
{
adoTemplate.AfterPropertiesSet();
}
catch (ArgumentException ex)
catch (ArgumentException ex)
{
throw new InvalidDataAccessApiUsageException(ex.Message);
}
}
CompileInternal();
compiled = true;
Compiled = true;
}
}
#endregion
}
}
}

View File

@@ -21,6 +21,7 @@
#region Imports
using System;
using Spring.Dao;
using Spring.Data.Common;
@@ -43,16 +44,14 @@ namespace Spring.Data.Objects.Generic
/// <author>Mark Pollack (.NET)</author>
public abstract class AdoOperation : AbstractAdoOperation
{
#region Fields
private Data.Generic.AdoTemplate adoTemplate = new Data.Generic.AdoTemplate();
#endregion
#region Constructor (s)
/// <summary>
/// Initializes a new instance of the <see cref="AdoOperation"/> class.
/// </summary>
@@ -60,7 +59,8 @@ namespace Spring.Data.Objects.Generic
/// before invoking the compile method and using this object.
/// </remarks>
public AdoOperation()
{}
{
}
/// <summary>
/// Initializes a new instance of the <see cref="AdoOperation"/> class.
@@ -71,7 +71,8 @@ namespace Spring.Data.Objects.Generic
/// <param name="provider">Database provider to use.</param>
public AdoOperation(IDbProvider provider)
: this(provider, null)
{}
{
}
/// <summary>
/// Initializes a new instance of the <see cref="AdoOperation"/> class.
@@ -85,7 +86,7 @@ namespace Spring.Data.Objects.Generic
{
//intialized AdoTemplate with the DbProvider
DbProvider = provider;
Sql = sql;
Sql = sql;
}
#endregion
@@ -106,13 +107,9 @@ namespace Spring.Data.Objects.Generic
}
adoTemplate = value;
}
get
{
return adoTemplate;
}
get { return adoTemplate; }
}
/// <summary>
/// Gets or sets the db provider.
/// </summary>
@@ -127,14 +124,9 @@ namespace Spring.Data.Objects.Generic
DeclaredParameters = new DbParameters(value);
}
}
get
{
return adoTemplate.DbProvider;
}
get { return adoTemplate.DbProvider; }
}
/// <summary>
/// Sets the command timeout for IDbCommands that this AdoTemplate executes.
/// </summary>
@@ -152,7 +144,6 @@ namespace Spring.Data.Objects.Generic
#endregion
#region Methods
/// <summary>
/// Compiles this operation. Ignores subsequent attempts to compile.
@@ -170,23 +161,20 @@ namespace Spring.Data.Objects.Generic
throw new InvalidDataAccessApiUsageException("Setting of CommandType is required");
}
try
{
try
{
adoTemplate.AfterPropertiesSet();
}
catch (ArgumentException ex)
catch (ArgumentException ex)
{
throw new InvalidDataAccessApiUsageException(ex.Message);
}
}
CompileInternal();
compiled = true;
Compiled = true;
}
}
#endregion
}
}
}

View File

@@ -68,7 +68,7 @@
<Optimize>true</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>none</DebugType>
<ErrorReport>prompt</ErrorReport>

View File

@@ -37,6 +37,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="Common.Logging, Version=1.2.0.0, Culture=neutral, PublicKeyToken=65e474d141e25e07, processorArchitecture=MSIL">

View File

@@ -1167,7 +1167,7 @@ namespace Spring.Messaging.Nms.Core
public object ReceiveSelectedAndConvert(string messageSelector)
{
CheckMessageConverter();
return DoConvertFromMessage(ReceiveSelected(messageSelector)); ;
return DoConvertFromMessage(ReceiveSelected(messageSelector));
}
/// <summary> Receive a message synchronously from the specified destination, but only

View File

@@ -19,7 +19,7 @@
#endregion
using System;
using Spring.Context;
using Spring.Objects.Factory;
namespace Spring.Messaging.Core
@@ -56,7 +56,11 @@ namespace Spring.Messaging.Core
}
public void AfterPropertiesSet()
/// <summary>
/// Invoked by an <see cref="Spring.Objects.Factory.IObjectFactory"/>
/// after it has injected all of an object's dependencies.
/// </summary>
public void AfterPropertiesSet()
{
if (this.MessageQueueTemplate == null)
{

View File

@@ -8,6 +8,9 @@ using Spring.Objects.Factory;
namespace Spring.Messaging.Core
{
/// <summary>
/// Hold cached data for queue's metadata.
/// </summary>
public class MessageQueueMetadataCache : IApplicationContextAware, IInitializingObject
{
#region Logging Definition
@@ -24,20 +27,33 @@ namespace Spring.Messaging.Core
private bool isInitialized;
/// <summary>
/// Constructs a new instance of <see cref="MessageQueueMetadataCache"/>.
/// </summary>
public MessageQueueMetadataCache()
{
}
/// <summary>
/// Constructs a new instance of <see cref="MessageQueueMetadataCache"/>.
/// </summary>
public MessageQueueMetadataCache(IConfigurableApplicationContext configurableApplicationContext)
{
this.configurableApplicationContext = configurableApplicationContext;
}
/// <summary>
/// Sets the <see cref="Spring.Context.IApplicationContext"/> that this
/// object runs in.
/// </summary>
public IApplicationContext ApplicationContext
{
set { applicationContext = value; }
}
/// <summary>
/// Initializes the cache.
/// </summary>
public void Initialize()
{
IDictionary<string, MessageQueueFactoryObject> messageQueueDictionary = configurableApplicationContext.GetObjects<MessageQueueFactoryObject>();
@@ -72,7 +88,11 @@ namespace Spring.Messaging.Core
isInitialized = true;
}
}
/// <summary>
/// Invoked by an <see cref="Spring.Objects.Factory.IObjectFactory"/>
/// after it has injected all of an object's dependencies.
/// </summary>
public void AfterPropertiesSet()
{
IConfigurableApplicationContext ctx = applicationContext as IConfigurableApplicationContext;
@@ -98,6 +118,9 @@ namespace Spring.Messaging.Core
}
}
/// <summary>
/// Returns whether this cache has been initialized yet.
/// </summary>
public bool Initalized
{
get
@@ -184,6 +207,9 @@ namespace Spring.Messaging.Core
}
}
/// <summary>
/// Inserts metadata to the cache.
/// </summary>
public void Insert(string path, MessageQueueMetadata messageQueueMetadata)
{
lock (itemStore.SyncRoot)

View File

@@ -19,16 +19,15 @@
#endregion
using System;
using System.Collections;
using System.Messaging;
using Common.Logging;
using Spring.Context;
using Spring.Messaging.Support;
using Spring.Messaging.Support.Converters;
using Spring.Objects.Factory;
using Spring.Objects.Factory.Config;
using Spring.Util;
using Common.Logging;
namespace Spring.Messaging.Core
{
/// <summary>
@@ -83,12 +82,15 @@ namespace Spring.Messaging.Core
private string messageConverterObjectName;
private IMessageQueueFactory messageQueueFactory;
protected IConfigurableApplicationContext applicationContext;
private IConfigurableApplicationContext applicationContext;
private TimeSpan timeout = MessageQueue.InfiniteTimeout;
private MessageQueueMetadataCache metadataCache;
/// <summary>
/// The name that is used from cache registration inside the application context.
/// </summary>
public const string METADATA_CACHE_NAME = "__MessageQueueMetadataCache__";
#endregion
@@ -246,7 +248,7 @@ namespace Spring.Messaging.Core
get { return applicationContext; }
set {
AssertUtils.ArgumentNotNull(value, "An ApplicationContext instance is required");
IConfigurableApplicationContext ctx = value as IConfigurableApplicationContext;
var ctx = value as IConfigurableApplicationContext;
if (ctx == null)
{
throw new InvalidOperationException(
@@ -292,6 +294,9 @@ namespace Spring.Messaging.Core
CreateDefaultMetadataCache();
}
/// <summary>
/// Constructs the metadata cache with default options.
/// </summary>
protected virtual void CreateDefaultMetadataCache()
{
if (metadataCache == null)

View File

@@ -496,6 +496,11 @@ namespace Spring.Messaging.Listener
return message;
}
/// <summary>
/// Handles the result of a listener method.
/// </summary>
/// <param name="result">The result that was returned from listener.</param>
/// <param name="request">The original request.</param>
protected virtual void HandleResult(object result, Message request)
{
if (logger.IsDebugEnabled)

View File

@@ -25,7 +25,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>Spring.Messaging.xml</DocumentationFile>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>

View File

@@ -0,0 +1,42 @@
#region License
/*
* Copyright <20> 2002-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#endregion
using System.Reflection;
using System.Runtime.InteropServices;
using System.Security;
[assembly: ComVisible(false)]
[assembly: AssemblyTitle("Spring.Scheduling.Quartz")]
[assembly: AssemblyDescription("Quartz.NET scheduler integration for Spring.NET")]
//
// Security Permissions
//
// we need full, unrestricted access to reflection metadata...
//[assembly: ReflectionPermission(SecurityAction.RequestMinimum, Unrestricted = true)]
//[assembly: AssemblyKeyFile(@"C:\users\aseovic\projects\OpenSource\Spring.Net\Spring.Net.PrivateKey.keys")]
//[assembly: AssemblyKeyFile(@"C:\projects\Spring.Net\Spring.Net.snk")]
#if !NET_4_0
[assembly: AllowPartiallyTrustedCallers]
[assembly: SecurityCritical]
#endif

View File

@@ -47,7 +47,7 @@ namespace Spring.Scheduling.Quartz
/// <summary>
/// Logger instance.
/// </summary>
protected readonly ILog logger;
private readonly ILog logger;
private bool overwriteExistingJobs;
private string[] jobSchedulingDataLocations;
@@ -66,7 +66,7 @@ namespace Spring.Scheduling.Quartz
/// <summary>
/// Resource loader instance for sub-classes
/// </summary>
protected IResourceLoader resourceLoader;
private IResourceLoader resourceLoader;
/// <summary>
/// Initializes a new instance of the <see cref="SchedulerAccessor"/> class.
@@ -244,6 +244,15 @@ namespace Spring.Scheduling.Quartz
public virtual IResourceLoader ResourceLoader
{
set { resourceLoader = value; }
protected get { return resourceLoader; }
}
/// <summary>
/// Logger instance.
/// </summary>
protected ILog Logger
{
get { return logger; }
}
/// <summary>

View File

@@ -471,7 +471,7 @@ namespace Spring.Scheduling.Quartz
/// </summary>
public virtual void Dispose()
{
logger.Info("Shutting down Quartz Scheduler");
Logger.Info("Shutting down Quartz Scheduler");
scheduler.Shutdown(waitForJobsToCompleteOnShutdown);
}
@@ -657,9 +657,9 @@ namespace Spring.Scheduling.Quartz
if (configLocation != null)
{
if (logger.IsInfoEnabled)
if (Logger.IsInfoEnabled)
{
logger.Info("Loading Quartz config from [" + configLocation + "]");
Logger.Info("Loading Quartz config from [" + configLocation + "]");
}
using (StreamReader sr = new StreamReader(configLocation.InputStream))
{
@@ -783,16 +783,14 @@ namespace Spring.Scheduling.Quartz
{
if (startDelay.TotalSeconds <= 0)
{
logger.Info("Starting Quartz Scheduler now");
Logger.Info("Starting Quartz Scheduler now");
sched.Start();
}
else
{
if (logger.IsInfoEnabled)
if (Logger.IsInfoEnabled)
{
logger.Info(
string.Format("Will start Quartz Scheduler [{0}] in {1} seconds", sched.SchedulerName,
startDelay));
Logger.InfoFormat("Will start Quartz Scheduler [{0}] in {1} seconds", sched.SchedulerName, startDelay);
}
sched.StartDelayed(startDelay);
}

View File

@@ -35,6 +35,8 @@
<DefineConstants>TRACE;NET_4_0</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DocumentationFile>..\..\..\build\VS.NET.2010\Spring.Scheduling.Quartz21\Release\Spring.Scheduling.Quartz21.XML</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="Common.Logging, Version=2.1.2.0, Culture=neutral, PublicKeyToken=af08829b84f0328e, processorArchitecture=MSIL">
@@ -48,6 +50,10 @@
<Reference Include="System.Data" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\CommonAssemblyInfo.cs">
<Link>CommonAssemblyInfo.cs</Link>
</Compile>
<Compile Include="AssemblyInfo.cs" />
<Compile Include="JobMethodInvocationFailedException.cs" />
<Compile Include="Scheduling\Quartz\AdaptableJobFactory.cs" />
<Compile Include="Scheduling\Quartz\CronTriggerObject.cs" />

View File

@@ -51,7 +51,7 @@ namespace Spring.ServiceModel.Activation
/// <summary>
/// The owning factory.
/// </summary>
protected IObjectFactory objectFactory;
private IObjectFactory objectFactory;
/// <summary>
/// The <see cref="Spring.ServiceModel.SpringServiceHost" /> instance managed by this factory.
@@ -133,6 +133,7 @@ namespace Spring.ServiceModel.Activation
/// </exception>
public virtual IObjectFactory ObjectFactory
{
protected get { return this.objectFactory; }
set { this.objectFactory = value; }
}

View File

@@ -69,12 +69,12 @@ namespace Spring.ServiceModel
/// <summary>
/// The name of the object in the factory.
/// </summary>
protected string objectName;
private string objectName;
/// <summary>
/// The owning factory.
/// </summary>
protected DefaultListableObjectFactory objectFactory;
private DefaultListableObjectFactory objectFactory;
/// <summary>
/// The generated WCF service wrapper type.
@@ -258,6 +258,7 @@ namespace Spring.ServiceModel
/// </exception>
public virtual IObjectFactory ObjectFactory
{
protected get { return objectFactory; }
set
{
if (value is DefaultListableObjectFactory)
@@ -347,6 +348,7 @@ namespace Spring.ServiceModel
/// </remarks>
public string ObjectName
{
protected get { return this.objectName; }
set { this.objectName = value; }
}

View File

@@ -48,7 +48,7 @@
<Optimize>false</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>full</DebugType>
<ErrorReport>prompt</ErrorReport>
@@ -71,7 +71,7 @@
<Optimize>true</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>none</DebugType>
<ErrorReport>prompt</ErrorReport>

View File

@@ -0,0 +1,42 @@
#region License
/*
* Copyright <20> 2002-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#endregion
using System.Reflection;
using System.Runtime.InteropServices;
using System.Security;
[assembly: ComVisible(false)]
[assembly: AssemblyTitle("Spring.Template.Velocity")]
[assembly: AssemblyDescription("NVelocity template engine integration for Spring.NET")]
//
// Security Permissions
//
// we need full, unrestricted access to reflection metadata...
//[assembly: ReflectionPermission(SecurityAction.RequestMinimum, Unrestricted = true)]
//[assembly: AssemblyKeyFile(@"C:\users\aseovic\projects\OpenSource\Spring.Net\Spring.Net.PrivateKey.keys")]
//[assembly: AssemblyKeyFile(@"C:\projects\Spring.Net\Spring.Net.snk")]
#if !NET_4_0
[assembly: AllowPartiallyTrustedCallers]
[assembly: SecurityCritical]
#endif

View File

@@ -72,6 +72,10 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\CommonAssemblyInfo.cs">
<Link>CommonAssemblyInfo.cs</Link>
</Compile>
<Compile Include="AssemblyInfo.cs" />
<Compile Include="Template\Velocity\Config\TemplateNamespaceParser.cs" />
<Compile Include="Template\Velocity\CommonsLoggingLogSystem.cs" />
<Compile Include="Template\Velocity\SpringResourceLoader.cs" />

View File

@@ -18,6 +18,8 @@
#endregion
using System;
using Common.Logging;
using NVelocity.Runtime;
using NVelocity.Runtime.Log;
@@ -41,7 +43,9 @@ namespace Spring.Template.Velocity
/// Initializes the specified runtime services. No-op in current implementatin
/// </summary>
/// <param name="runtimeServices">the runtime services.</param>
public void Init(IRuntimeServices runtimeServices) {
[CLSCompliant(false)]
public void Init(IRuntimeServices runtimeServices)
{
}
/// <summary>
@@ -49,7 +53,9 @@ namespace Spring.Template.Velocity
/// </summary>
/// <param name="level">LogLevel to match</param>
/// <param name="message">message to log</param>
public void LogVelocityMessage(LogLevel level, string message) {
[CLSCompliant(false)]
public void LogVelocityMessage(LogLevel level, string message)
{
switch (level) {
case LogLevel.Error:
log.Error(message);

View File

@@ -50,6 +50,7 @@ namespace Spring.Template.Velocity {
/// <see cref="ResourceLoader"/>
/// <see cref="AssemblyResourceLoader"/>
/// <author>Erez Mazor (.NET) </author>
[CLSCompliant(false)]
public class SpringResourceLoader : ResourceLoader {
///<summary>
/// Prefix used for the NVelocity Configuration

View File

@@ -64,8 +64,8 @@ namespace Spring.Template.Velocity {
/// <see cref="VelocityEngineFactoryObject" />
/// <see cref="CommonsLoggingLogSystem" />
/// <author>Erez Mazor</author>
public class VelocityEngineFactory {
private const char DELIMITER = ',';
public class VelocityEngineFactory
{
/// <summary>
/// Shared logger instance.
@@ -198,7 +198,9 @@ namespace Spring.Template.Velocity {
/// <see cref="InitVelocityResourceLoader" />
/// <see cref="PostProcessVelocityEngine" />
/// <see cref="VelocityEngine.Init()" />
public VelocityEngine CreateVelocityEngine() {
[CLSCompliant(false)]
public VelocityEngine CreateVelocityEngine()
{
ExtendedProperties extendedProperties = new ExtendedProperties();
VelocityEngine velocityEngine = NewVelocityEngine();
@@ -272,7 +274,9 @@ namespace Spring.Template.Velocity {
/// </summary>
/// <returns>VelocityEngine instance (non-configured)</returns>
/// <see cref="CreateVelocityEngine"/>
protected static VelocityEngine NewVelocityEngine() {
[CLSCompliant(false)]
protected static VelocityEngine NewVelocityEngine()
{
return new VelocityEngine();
}
@@ -288,7 +292,9 @@ namespace Spring.Template.Velocity {
/// <see cref="SpringResourceLoader"/>
/// <see cref="InitSpringResourceLoader"/>
/// <see cref="CreateVelocityEngine"/>
protected void InitVelocityResourceLoader(VelocityEngine velocityEngine, ExtendedProperties extendedProperties, IList<string> paths) {
[CLSCompliant(false)]
protected void InitVelocityResourceLoader(VelocityEngine velocityEngine, ExtendedProperties extendedProperties, IList<string> paths)
{
if (PreferFileSystemAccess) {
// Try to load via the file system, fall back to SpringResourceLoader
@@ -335,7 +341,9 @@ namespace Spring.Template.Velocity {
/// <param name="resourceLoaderPathString">resourceLoaderPath the path to load Velocity resources from</param>
/// <see cref="SpringResourceLoader"/>
/// <see cref="InitVelocityResourceLoader"/>
protected void InitSpringResourceLoader(VelocityEngine velocityEngine, ExtendedProperties extendedProperties, string resourceLoaderPathString) {
[CLSCompliant(false)]
protected void InitSpringResourceLoader(VelocityEngine velocityEngine, ExtendedProperties extendedProperties, string resourceLoaderPathString)
{
extendedProperties.SetProperty(RuntimeConstants.RESOURCE_LOADER, SpringResourceLoader.NAME);
Type springResourceLoaderType = typeof(SpringResourceLoader);
string springResourceLoaderTypeName = springResourceLoaderType.FullName + "; " + springResourceLoaderType.Assembly.GetName().Name;
@@ -355,7 +363,9 @@ namespace Spring.Template.Velocity {
/// <exception cref="IOException" />
/// <see cref="CreateVelocityEngine"/>
/// <see cref="VelocityEngine.Init()"/>
protected void PostProcessVelocityEngine(VelocityEngine velocityEngine) {
[CLSCompliant(false)]
protected virtual void PostProcessVelocityEngine(VelocityEngine velocityEngine)
{
}
/// <summary>

View File

@@ -34,7 +34,8 @@ namespace Spring.Template.Velocity
/// </summary>
/// <see cref="VelocityEngineFactory"/>
/// <author>Erez Mazor</author>
public class VelocityEngineFactoryObject : VelocityEngineFactory, IFactoryObject, IInitializingObject, IResourceLoaderAware {
public class VelocityEngineFactoryObject : VelocityEngineFactory, IFactoryObject, IInitializingObject, IResourceLoaderAware
{
private VelocityEngine velocityEngine;
/// <summary>
/// Get the velocity engine underlying object

View File

@@ -31,7 +31,9 @@ namespace Spring.Template.Velocity{
/// Generalized Utility class for merging velocity templates into a text writer or return the result as a string
/// </summary>
/// <author>Erez Mazor</author>
public class VelocityEngineUtils {
[CLSCompliant(false)]
public class VelocityEngineUtils
{
/// <summary>
/// Shared logger instance.

View File

@@ -1,22 +1,22 @@
#region License
/*
* Copyright 2002-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
/*
* Copyright 2002-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#endregion
#endregion
using System;
@@ -43,7 +43,7 @@ namespace Spring.Testing.Microsoft
/// <summary>
/// Holds the <see cref="AdoTemplate"/> that this base class manages
/// </summary>
protected AdoTemplate adoTemplate;
private AdoTemplate adoTemplate;
/// <summary>
/// Did this test delete any tables? If so, we forbid transaction completion,
@@ -74,6 +74,7 @@ namespace Spring.Testing.Microsoft
public AdoTemplate AdoTemplate
{
get { return adoTemplate; }
protected set { adoTemplate = value; }
}
/// <summary>

View File

@@ -1,19 +1,19 @@
#region License
/*
* Copyright 2002-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
/*
* Copyright 2002-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#endregion
@@ -81,7 +81,7 @@ namespace Spring.Testing.Microsoft
/// <summary>
/// The transaction manager to use
/// </summary>
protected IPlatformTransactionManager transactionManager;
private IPlatformTransactionManager transactionManager;
/// <summary>
/// Should we roll back by default?
@@ -107,7 +107,7 @@ namespace Spring.Testing.Microsoft
/// <summary>
/// TransactionStatus for this test. Typical subclasses won't need to use it.
/// </summary>
protected ITransactionStatus transactionStatus;
private ITransactionStatus transactionStatus;
/// <summary>
@@ -122,6 +122,7 @@ namespace Spring.Testing.Microsoft
/// </summary>
public IPlatformTransactionManager TransactionManager
{
protected get { return transactionManager; }
set { transactionManager = value; }
}
@@ -144,6 +145,15 @@ namespace Spring.Testing.Microsoft
set { transactionDefinition = value; }
}
/// <summary>
/// TransactionStatus for this test. Typical subclasses won't need to use it.
/// </summary>
protected ITransactionStatus TransactionStatus
{
get { return transactionStatus; }
set { transactionStatus = value; }
}
/// <summary>
/// Prevents the transaction.
/// </summary>

View File

@@ -25,6 +25,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>Spring.Testing.NUnit.xml</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>

View File

@@ -23,7 +23,7 @@ namespace Spring.Testing.NUnit
/// <summary>
/// Holds the <see cref="AdoTemplate"/> that this base class manages
/// </summary>
protected AdoTemplate adoTemplate;
private AdoTemplate adoTemplate;
/// <summary>
/// Did this test delete any tables? If so, we forbid transaction completion,
@@ -54,6 +54,7 @@ namespace Spring.Testing.NUnit
public AdoTemplate AdoTemplate
{
get { return adoTemplate; }
protected set { adoTemplate = value; }
}
/// <summary>

View File

@@ -60,7 +60,7 @@ namespace Spring.Testing.NUnit
/// <summary>
/// The transaction manager to use
/// </summary>
protected IPlatformTransactionManager transactionManager;
private IPlatformTransactionManager transactionManager;
/// <summary>
/// Should we roll back by default?
@@ -86,21 +86,14 @@ namespace Spring.Testing.NUnit
/// <summary>
/// TransactionStatus for this test. Typical subclasses won't need to use it.
/// </summary>
protected ITransactionStatus transactionStatus;
/// <summary>
/// Initializes a new instance of the <see cref="AbstractTransactionalSpringContextTests"/> class.
/// </summary>
public AbstractTransactionalSpringContextTests()
{
}
private ITransactionStatus transactionStatus;
/// <summary>
/// Sets the transaction manager to use.
/// </summary>
public IPlatformTransactionManager TransactionManager
{
protected get { return transactionManager; }
set { transactionManager = value; }
}
@@ -123,6 +116,15 @@ namespace Spring.Testing.NUnit
set { transactionDefinition = value; }
}
/// <summary>
/// TransactionStatus for this test. Typical subclasses won't need to use it.
/// </summary>
protected ITransactionStatus TransactionStatus
{
get { return transactionStatus; }
set { transactionStatus = value; }
}
/// <summary>
/// Prevents the transaction.
/// </summary>

View File

@@ -26,14 +26,16 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>Spring.Web.Conversation.NHibernate32.xml</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<OutputPath>..\..\..\build\VS.Net.2010\Spring.Web.Conversation.NHibernate32\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="Common.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=af08829b84f0328e, processorArchitecture=MSIL">

View File

@@ -26,14 +26,16 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>Spring.Web.Conversation.NHibernate33.XML</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<OutputPath>..\..\..\build\VS.Net.2010\Spring.Web.Conversation.NHibernate33\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="Common.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=af08829b84f0328e, processorArchitecture=MSIL">

View File

@@ -25,6 +25,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>Spring.Web.Extensions.xml</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -33,6 +34,7 @@
<DefineConstants>TRACE;NET_4_0;NET_3_5</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="Common.Logging, Version=1.0.2.0, Culture=neutral, PublicKeyToken=af08829b84f0328e">

View File

@@ -28,10 +28,11 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<OutputPath>..\..\..\build\VS.Net.2010\Spring.Web.Mvc3\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="Common.Logging">

View File

@@ -28,10 +28,11 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<OutputPath>..\..\..\build\VS.Net.2010\Spring.Web.Mvc4\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="Common.Logging">

View File

@@ -1,5 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
@@ -17,7 +16,7 @@ namespace Spring.Web.Mvc
/// <summary>
/// The <see cref="IApplicationContext"/> to be used by the resolver
/// </summary>
protected IApplicationContext _context;
private IApplicationContext _context;
/// <summary>
/// Initializes a new instance of the <see cref="SpringMvcDependencyResolver"/> class.
@@ -51,6 +50,7 @@ namespace Spring.Web.Mvc
return _context;
}
protected set { _context = value; }
}
/// <summary>

View File

@@ -31,11 +31,12 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<OutputPath>..\..\..\build\VS.Net.2010\Spring.Web.Mvc5\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="Common.Logging">

View File

@@ -43,12 +43,11 @@
<DebugSymbols>true</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<NoWarn>
</NoWarn>
<NoWarn>618</NoWarn>
<Optimize>false</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>full</DebugType>
<ErrorReport>prompt</ErrorReport>
@@ -66,12 +65,11 @@
<DebugSymbols>false</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<NoWarn>
</NoWarn>
<NoWarn>618</NoWarn>
<Optimize>true</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>none</DebugType>
<ErrorReport>prompt</ErrorReport>

View File

@@ -98,12 +98,12 @@ namespace Spring.Web.Services
/// <summary>
/// The name of the object in the factory.
/// </summary>
protected string objectName;
private string objectName;
/// <summary>
/// The owning factory.
/// </summary>
protected IObjectFactory objectFactory;
private IObjectFactory objectFactory;
/// <summary>
/// The generated web service wrapper type.
@@ -315,7 +315,8 @@ namespace Spring.Web.Services
/// </exception>
public virtual IObjectFactory ObjectFactory
{
set { this.objectFactory = value; }
protected get { return objectFactory; }
set { objectFactory = value; }
}
#endregion
@@ -338,7 +339,8 @@ namespace Spring.Web.Services
/// </remarks>
public string ObjectName
{
set { this.objectName = value; }
protected get { return objectName; }
set { objectName = value; }
}
#endregion

View File

@@ -223,8 +223,6 @@ namespace Spring.Data
[Test]
public void ExecuteNonQueryText()
{
int counter = 0;
int user_id = 100;
string user_name = "George0";
@@ -240,7 +238,6 @@ namespace Spring.Data
int user_id1 = 101;
string user_name1 = "George1";
parameters.Add("id", OracleType.Int32).Value = user_id1;
counter++;
parameters.Add("name", DbType.String, 12).Value = user_name1;
adoOperations.ExecuteNonQuery(CommandType.Text, sql, parameters);

View File

@@ -20,15 +20,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Runtime.Serialization.Formatters.Binary;
using System.IO;
using System.Runtime.Remoting.Messaging;
using System.Runtime.Serialization;
using System.Reflection;
using Spring.Entities;
namespace Spring.Web.Conversation
{
@@ -211,9 +207,6 @@ namespace Spring.Web.Conversation
private static readonly Common.Logging.ILog LOG = Common.Logging.LogManager.GetLogger(typeof(SerializeConversationTestModule));
#endregion
public MySerializationSurrogate()
{
}
#region ISerializationSurrogate Members

View File

@@ -1,21 +1,11 @@
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Spring.Web.Conversation;
using NUnit.Framework;
using Spring.Context.Support;
using System.Text;
using Common.Logging;
using Spring.Context;
using Spring.Web.Conversation;
using Common.Logging;
public partial class CircularDependenceTest : System.Web.UI.Page, IApplicationContextAware
{
private static readonly ILog LOG = LogManager.GetLogger(typeof(CircularDependenceTest));

View File

@@ -1,32 +1,26 @@
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Spring.Web.Conversation;
using System.Reflection;
using Spring.Data.NHibernate.Support;
using NHibernate;
using Spring.Bsn;
using Spring.Entities;
using Spring.Spring.Data.Common;
using NUnit.Framework;
using Spring.Bsn;
using NHibernate.Impl;
using System.Reflection;
using NHibernate.Cfg;
using Spring.Context;
using Spring.Web.Conversation;
using NHibernate;
using NHibernate.Cfg;
using NHibernate.Impl;
using NUnit.Framework;
/// <summary>
/// Page for <see cref="Spring.Web.Conversation.WebConversationStateTest.ConnectionReleaseModeIssue()"/>.
/// </summary>
public partial class ConnectionReleaseModeIssue : System.Web.UI.Page, IApplicationContextAware
{
private IConversationState conversation;
/// <summary>
/// <see cref="IConversationState"/>
/// </summary>
@@ -37,14 +31,15 @@ public partial class ConnectionReleaseModeIssue : System.Web.UI.Page, IApplicati
}
private ISessionFactory sessionFactory;
public ISessionFactory SessionFactory
{
get { return sessionFactory; }
set { sessionFactory = value; }
}
private IConnectionReleaseModeIssueBsn connectionReleaseModeIssueBsn;
public IConnectionReleaseModeIssueBsn ConnectionReleaseModeIssueBsn
{
get { return connectionReleaseModeIssueBsn; }
@@ -92,7 +87,7 @@ public partial class ConnectionReleaseModeIssue : System.Web.UI.Page, IApplicati
{
//with conversation and "connection.release_mode" "auto"(AfterTransaction)
//forcing "auto" by reflection.
Settings settings = ((SessionFactoryImpl)this.SessionFactory).Settings;
Settings settings = ((SessionFactoryImpl) this.SessionFactory).Settings;
ConnectionReleaseMode connReleaseModeOriginal = settings.ConnectionReleaseMode;
this.setConnectionReleaseModeByReflection(settings, ConnectionReleaseMode.AfterTransaction);
@@ -126,11 +121,10 @@ public partial class ConnectionReleaseModeIssue : System.Web.UI.Page, IApplicati
Assert.AreEqual(1, masterEnt3.SPCDetailEntList.Count, "masterEnt3.SPCDetailEntList.Count");
Assert.AreEqual(6, ConnectionCreationTrackingDbProvider.Count, "ConnectionCreationTrackingDbProvider.Count");
//Renew the conversation.
this.Conversation.EndConversation();
this.Conversation.ConversationManager.FreeEnded();
this.Conversation = (IConversationState)this.applicationContext.GetObject("convConnectionReleaseModeIssue");
this.Conversation = (IConversationState) this.applicationContext.GetObject("convConnectionReleaseModeIssue");
this.setConnectionReleaseModeByReflection(settings, connReleaseModeOriginal);
}
@@ -149,7 +143,7 @@ public partial class ConnectionReleaseModeIssue : System.Web.UI.Page, IApplicati
{
//with conversation and "connection.release_mode" "auto"(AfterTransaction)
//forcing "auto" by reflection.
Settings settings = ((SessionFactoryImpl)this.SessionFactory).Settings;
Settings settings = ((SessionFactoryImpl) this.SessionFactory).Settings;
ConnectionReleaseMode connReleaseModeOriginal = settings.ConnectionReleaseMode;
this.setConnectionReleaseModeByReflection(settings, ConnectionReleaseMode.AfterTransaction);
@@ -167,7 +161,7 @@ public partial class ConnectionReleaseModeIssue : System.Web.UI.Page, IApplicati
{
//with NO conversation and "connection.release_mode" "auto"(AfterTransaction)
//forcing "auto" by reflection.
Settings settings = ((SessionFactoryImpl)this.SessionFactory).Settings;
Settings settings = ((SessionFactoryImpl) this.SessionFactory).Settings;
ConnectionReleaseMode connReleaseModeOriginal = settings.ConnectionReleaseMode;
this.setConnectionReleaseModeByReflection(settings, ConnectionReleaseMode.AfterTransaction);
@@ -202,7 +196,7 @@ public partial class ConnectionReleaseModeIssue : System.Web.UI.Page, IApplicati
private void connection_release_mode_on_close()
{
//forcing "on_close" by reflection.
Settings settings = ((SessionFactoryImpl)this.SessionFactory).Settings;
Settings settings = ((SessionFactoryImpl) this.SessionFactory).Settings;
ConnectionReleaseMode connReleaseModeOriginal = settings.ConnectionReleaseMode;
this.setConnectionReleaseModeByReflection(settings, ConnectionReleaseMode.OnClose);
@@ -232,7 +226,7 @@ public partial class ConnectionReleaseModeIssue : System.Web.UI.Page, IApplicati
//Renew the conversation.
this.Conversation.EndConversation();
this.Conversation.ConversationManager.FreeEnded();
this.Conversation = (IConversationState)this.applicationContext.GetObject("convConnectionReleaseModeIssue");
this.Conversation = (IConversationState) this.applicationContext.GetObject("convConnectionReleaseModeIssue");
this.setConnectionReleaseModeByReflection(settings, connReleaseModeOriginal);
}
@@ -248,19 +242,21 @@ public partial class ConnectionReleaseModeIssue : System.Web.UI.Page, IApplicati
settings.GetType().GetProperty(
"ConnectionReleaseMode",
BindingFlags.Public |
BindingFlags.NonPublic |
BindingFlags.SetProperty |
BindingFlags.Instance);
BindingFlags.NonPublic |
BindingFlags.SetProperty |
BindingFlags.Instance);
pInfoConnectionReleaseMode.SetValue(settings, mode, null);
}
#region IApplicationContextAware Members
private IApplicationContext applicationContext;
public IApplicationContext ApplicationContext
{
set { this.applicationContext = value; }
}
#endregion
}
}

View File

@@ -1,16 +1,7 @@
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Spring.Web.Conversation;
using Spring.Bsn;
using Spring.Web.Conversation;
public partial class EndConversationTestBegin : System.Web.UI.Page
{

View File

@@ -1,16 +1,7 @@
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Spring.Bsn;
using Spring.Web.Conversation;
using Spring.Web.Conversation;
public partial class EndConversationTestEnd : System.Web.UI.Page
{

View File

@@ -1,18 +1,9 @@
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Spring.Web.Conversation;
using Spring.Entities;
using NHibernate;
using Common.Logging;
using Spring.Web.Conversation;
public partial class SPCSwitchConversationSameRequest : System.Web.UI.Page
{

View File

@@ -271,15 +271,15 @@ namespace Spring.Util
Assert.AreEqual("/mYpath", WebUtils.GetRelativePath("/Mydir", "/mYdir/mYpath"));
Assert.AreEqual("/myotherdir/mypath", WebUtils.GetRelativePath("/mydir", "/myotherdir/mypath"));
}
[Test]
public void GetNormalizedVirtualPath()
{
Assert.AreEqual(null, WebUtils.GetNormalizedVirtualPath(null));
Assert.AreEqual(String.Empty, WebUtils.GetNormalizedVirtualPath(String.Empty));
Assert.AreEqual("~test.aspx", WebUtils.GetNormalizedVirtualPath("~test.aspx"));
Assert.AreEqual("/test.aspx", WebUtils.GetNormalizedVirtualPath("~/test.aspx"));
Assert.AreEqual("/Complex.Path/~/test.aspx", WebUtils.GetNormalizedVirtualPath("~/Complex.Path/~/test.aspx"));
}
[Test]
public void GetNormalizedVirtualPath()
{
Assert.AreEqual(null, WebUtils.GetNormalizedVirtualPath(null));
Assert.AreEqual(String.Empty, WebUtils.GetNormalizedVirtualPath(String.Empty));
Assert.AreEqual("~test.aspx", WebUtils.GetNormalizedVirtualPath("~test.aspx"));
Assert.AreEqual("/test.aspx", WebUtils.GetNormalizedVirtualPath("~/test.aspx"));
Assert.AreEqual("/Complex.Path/~/test.aspx", WebUtils.GetNormalizedVirtualPath("~/Complex.Path/~/test.aspx"));
}
}
}