|
From: <jer...@us...> - 2008-10-02 01:05:56
|
Revision: 161
http://structuremap.svn.sourceforge.net/structuremap/?rev=161&view=rev
Author: jeremydmiller
Date: 2008-10-02 01:05:46 +0000 (Thu, 02 Oct 2008)
Log Message:
-----------
did some cleanup
Modified Paths:
--------------
trunk/Source/StructureMap.AutoMocking/AutoMockedContainer.cs
trunk/Source/StructureMap.AutoMocking/Properties/AssemblyInfo.cs
trunk/Source/StructureMap.DataAccess/AssemblyInfo.cs
trunk/Source/StructureMap.DataAccess/CommandCollection.cs
trunk/Source/StructureMap.DataAccess/CommandFactory.cs
trunk/Source/StructureMap.DataAccess/CommandFailureException.cs
trunk/Source/StructureMap.DataAccess/Commands/CommandBase.cs
trunk/Source/StructureMap.DataAccess/Commands/QueryFilter.cs
trunk/Source/StructureMap.DataAccess/Commands/StoredProcedureCommand.cs
trunk/Source/StructureMap.DataAccess/Commands/TemplatedCommand.cs
trunk/Source/StructureMap.DataAccess/Commands/TemplatedQuery.cs
trunk/Source/StructureMap.DataAccess/ExecutionStates/AutoCommitExecutionState.cs
trunk/Source/StructureMap.DataAccess/ExecutionStates/TransactionalExecutionState.cs
trunk/Source/StructureMap.DataAccess/IDatabaseEngine.cs
trunk/Source/StructureMap.DataAccess/JSON/Field.cs
trunk/Source/StructureMap.DataAccess/JSON/JSONArray.cs
trunk/Source/StructureMap.DataAccess/JSON/JSONObject.cs
trunk/Source/StructureMap.DataAccess/JSON/JSONSerializer.cs
trunk/Source/StructureMap.DataAccess/JSON/Part.cs
trunk/Source/StructureMap.DataAccess/MSSQL/MSSQLDatabaseEngine.cs
trunk/Source/StructureMap.DataAccess/Oracle/OracleDatabaseEngine.cs
trunk/Source/StructureMap.DataAccess/ParameterCollection.cs
trunk/Source/StructureMap.DataAccess/Parameterization/ParameterizedCommand.cs
trunk/Source/StructureMap.DataAccess/Parameterization/ParameterizedCommandBuilder.cs
trunk/Source/StructureMap.DataAccess/Parameters/Parameter.cs
trunk/Source/StructureMap.DataAccess/ReaderSourceCollection.cs
trunk/Source/StructureMap.DataAccess/TemplateParser.cs
trunk/Source/StructureMap.DataAccess/Tools/Mocks/CommandExpectation.cs
trunk/Source/StructureMap.DataAccess/Tools/Mocks/MockCommand.cs
trunk/Source/StructureMap.DataAccess/Tools/Mocks/MockDataSession.cs
trunk/Source/StructureMap.DataAccess/Tools/Mocks/MockReaderSource.cs
trunk/Source/StructureMap.DataAccess/Tools/Mocks/NotExecutedCommandException.cs
trunk/Source/StructureMap.DataAccess/Tools/Mocks/ParameterList.cs
trunk/Source/StructureMap.DataAccess/Tools/Mocks/ParameterValidationFailureException.cs
trunk/Source/StructureMap.DataAccess/Tools/Mocks/StubbedCommandCollection.cs
trunk/Source/StructureMap.DataAccess/Tools/Mocks/StubbedReaderSource.cs
trunk/Source/StructureMap.DataAccess/Tools/Mocks/StubbedReaderSourceCollection.cs
trunk/Source/StructureMap.DataAccess/Tools/TableDataReader.cs
trunk/Source/StructureMap.DeploymentTasks/AddAssembly.cs
trunk/Source/StructureMap.DeploymentTasks/AssemblyInfo.cs
trunk/Source/StructureMap.DeploymentTasks/SetOverrideTask.cs
trunk/Source/StructureMap.DeploymentTasks/SubstitutionTask.cs
trunk/Source/StructureMap.DeploymentTasks/Versioning/CheckVersionTask.cs
trunk/Source/StructureMap.DeploymentTasks/Versioning/DeployedDirectory.cs
trunk/Source/StructureMap.DeploymentTasks/Versioning/DeployedFile.cs
trunk/Source/StructureMap.DeploymentTasks/Versioning/DotNetAssembly.cs
trunk/Source/StructureMap.DeploymentTasks/Versioning/GenerateVersionReport.cs
trunk/Source/StructureMap.Testing.GenericWidgets/Properties/AssemblyInfo.cs
trunk/Source/StructureMap.Testing.GenericWidgets/Widgets.cs
trunk/Source/StructureMap.Testing.Widget/BuilderSamples.cs
trunk/Source/StructureMap.Testing.Widget/IWidget.cs
trunk/Source/StructureMap.Testing.Widget/Rule.cs
trunk/Source/StructureMap.Testing.Widget2/Rule1.cs
trunk/Source/StructureMap.Testing.Widget3/Gateways.cs
trunk/Source/StructureMap.Testing.Widget5/AutoFilledGridColumn.cs
trunk/Source/StructureMap.Testing.Widget5/BasicGridColumn.cs
trunk/Source/StructureMap.Testing.Widget5/CannotBeAutoFilledGridColumn.cs
trunk/Source/StructureMap.Testing.Widget5/GridColumns.cs
trunk/Source/StructureMap.Testing.Widget5/OtherGridColumn.cs
trunk/Source/StructureMap.Testing.Widget5/WidgetRegistry.cs
trunk/Source/StructureMapDoctor/Properties/AssemblyInfo.cs
Modified: trunk/Source/StructureMap.AutoMocking/AutoMockedContainer.cs
===================================================================
--- trunk/Source/StructureMap.AutoMocking/AutoMockedContainer.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.AutoMocking/AutoMockedContainer.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -23,13 +23,13 @@
return null;
}
- InstanceFactory factory = new InstanceFactory(new PluginFamily(pluginType));
+ var factory = new InstanceFactory(new PluginFamily(pluginType));
try
{
object service = _locator.Service(pluginType);
- LiteralInstance instance = new LiteralInstance(service);
+ var instance = new LiteralInstance(service);
profileManager.SetDefault(pluginType, instance);
}
Modified: trunk/Source/StructureMap.AutoMocking/Properties/AssemblyInfo.cs
===================================================================
--- trunk/Source/StructureMap.AutoMocking/Properties/AssemblyInfo.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.AutoMocking/Properties/AssemblyInfo.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -1,8 +1,8 @@
-using System.Reflection;
+using System.Reflection;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
-[assembly : AssemblyTitle("StructureMap.AutoMocking")]
-[assembly : AssemblyDescription("")]
\ No newline at end of file
+[assembly: AssemblyTitle("StructureMap.AutoMocking")]
+[assembly: AssemblyDescription("")]
\ No newline at end of file
Modified: trunk/Source/StructureMap.DataAccess/AssemblyInfo.cs
===================================================================
--- trunk/Source/StructureMap.DataAccess/AssemblyInfo.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DataAccess/AssemblyInfo.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -6,5 +6,5 @@
// associated with an assembly.
//
-[assembly : AssemblyTitle("StructureMap DataAccess")]
-[assembly : AssemblyDescription("An interface to databases done the StructureMap way")]
\ No newline at end of file
+[assembly: AssemblyTitle("StructureMap DataAccess")]
+[assembly: AssemblyDescription("An interface to databases done the StructureMap way")]
\ No newline at end of file
Modified: trunk/Source/StructureMap.DataAccess/CommandCollection.cs
===================================================================
--- trunk/Source/StructureMap.DataAccess/CommandCollection.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DataAccess/CommandCollection.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -6,8 +6,8 @@
public class CommandCollection : ICommandCollection
{
private readonly ICommandFactory _commandFactory;
+ private readonly Hashtable _commands;
private readonly DataSession _parent;
- private Hashtable _commands;
public CommandCollection(DataSession parent, ICommandFactory commandFactory)
{
Modified: trunk/Source/StructureMap.DataAccess/CommandFactory.cs
===================================================================
--- trunk/Source/StructureMap.DataAccess/CommandFactory.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DataAccess/CommandFactory.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -14,7 +14,7 @@
public ICommand BuildCommand(string commandName)
{
- ICommand command = (ICommand) ObjectFactory.GetNamedInstance(typeof (ICommand), commandName);
+ var command = (ICommand) ObjectFactory.GetNamedInstance(typeof (ICommand), commandName);
initialize(command);
command.Name = commandName;
@@ -23,7 +23,7 @@
public IReaderSource BuildReaderSource(string name)
{
- IReaderSource source = (IReaderSource) ObjectFactory.GetNamedInstance(typeof (IReaderSource), name);
+ var source = (IReaderSource) ObjectFactory.GetNamedInstance(typeof (IReaderSource), name);
initialize(source);
source.Name = name;
@@ -34,7 +34,7 @@
private void initialize(object target)
{
- IInitializable initializable = target as IInitializable;
+ var initializable = target as IInitializable;
if (initializable != null)
{
initializable.Initialize(_engine);
Modified: trunk/Source/StructureMap.DataAccess/CommandFailureException.cs
===================================================================
--- trunk/Source/StructureMap.DataAccess/CommandFailureException.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DataAccess/CommandFailureException.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -38,7 +38,7 @@
private void buildMessage(IDbCommand command)
{
- StringBuilder SB = new StringBuilder();
+ var SB = new StringBuilder();
SB.Append("Command Failure!\r\n");
SB.Append(InnerException.Message);
Modified: trunk/Source/StructureMap.DataAccess/Commands/CommandBase.cs
===================================================================
--- trunk/Source/StructureMap.DataAccess/Commands/CommandBase.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DataAccess/Commands/CommandBase.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -8,7 +8,6 @@
public abstract class CommandBase : IInitializable, IReaderSource, ICommand
{
private IDbCommand _innerCommand;
- private string _name;
private ParameterCollection _parameters;
private IDataSession _session;
@@ -57,11 +56,7 @@
#region IReaderSource Members
- public string Name
- {
- get { return _name; }
- set { _name = value; }
- }
+ public string Name { get; set; }
[IndexerName("Parameter")]
public object this[string parameterName]
@@ -83,7 +78,7 @@
public string ExecuteJSON()
{
DataSet dataSet = ExecuteDataSet();
- JSONSerializer serializer = new JSONSerializer(dataSet.Tables[0]);
+ var serializer = new JSONSerializer(dataSet.Tables[0]);
return serializer.CreateJSON();
}
Modified: trunk/Source/StructureMap.DataAccess/Commands/QueryFilter.cs
===================================================================
--- trunk/Source/StructureMap.DataAccess/Commands/QueryFilter.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DataAccess/Commands/QueryFilter.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -6,7 +6,7 @@
{
protected const string REPLACEMENT_VALUE = "{Value}";
private readonly string _parameterName;
- protected object _innerValue = null;
+ protected object _innerValue;
protected string _sqlSnippet;
Modified: trunk/Source/StructureMap.DataAccess/Commands/StoredProcedureCommand.cs
===================================================================
--- trunk/Source/StructureMap.DataAccess/Commands/StoredProcedureCommand.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DataAccess/Commands/StoredProcedureCommand.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -34,7 +34,7 @@
public override void Initialize(IDatabaseEngine engine)
{
IDbCommand innerCommand = engine.CreateStoredProcedureCommand(_commandText);
- ParameterCollection parameters = new ParameterCollection(innerCommand.Parameters);
+ var parameters = new ParameterCollection(innerCommand.Parameters);
initializeMembers(parameters, innerCommand);
}
Modified: trunk/Source/StructureMap.DataAccess/Commands/TemplatedCommand.cs
===================================================================
--- trunk/Source/StructureMap.DataAccess/Commands/TemplatedCommand.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DataAccess/Commands/TemplatedCommand.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -7,14 +7,14 @@
[Pluggable("Templated")]
public class TemplatedCommand : CommandBase
{
- private string[] _substitutions;
- private string _template;
+ private readonly string[] _substitutions;
+ private readonly string _template;
[DefaultConstructor]
- public TemplatedCommand(string template) : base()
+ public TemplatedCommand(string template)
{
_template = template;
- TemplateParser parser = new TemplateParser(template);
+ var parser = new TemplateParser(template);
_substitutions = parser.Parse();
}
@@ -31,10 +31,10 @@
public override void Initialize(IDatabaseEngine engine)
{
- ParameterCollection parameters = new ParameterCollection();
+ var parameters = new ParameterCollection();
foreach (string substitution in _substitutions)
{
- TemplateParameter parameter = new TemplateParameter(substitution);
+ var parameter = new TemplateParameter(substitution);
parameters.AddParameter(parameter);
}
@@ -44,7 +44,7 @@
public string GetSql()
{
- StringBuilder sb = new StringBuilder(_template);
+ var sb = new StringBuilder(_template);
foreach (TemplateParameter parameter in Parameters)
{
parameter.Substitute(sb);
Modified: trunk/Source/StructureMap.DataAccess/Commands/TemplatedQuery.cs
===================================================================
--- trunk/Source/StructureMap.DataAccess/Commands/TemplatedQuery.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DataAccess/Commands/TemplatedQuery.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -10,9 +10,9 @@
{
private readonly IQueryFilter[] _filters;
private readonly string _selectAndFromClause;
- private ArrayList _templatedParameters = new ArrayList();
+ private readonly ArrayList _templatedParameters = new ArrayList();
- public TemplatedQuery(string selectAndFromClause, IQueryFilter[] filters) : base()
+ public TemplatedQuery(string selectAndFromClause, IQueryFilter[] filters)
{
_selectAndFromClause = selectAndFromClause;
_filters = filters;
@@ -20,14 +20,14 @@
public override void Initialize(IDatabaseEngine engine)
{
- ParameterCollection parameters = new ParameterCollection(_filters);
+ var parameters = new ParameterCollection(_filters);
IDbCommand command = engine.GetCommand();
- TemplateParser parser = new TemplateParser(_selectAndFromClause);
+ var parser = new TemplateParser(_selectAndFromClause);
string[] substitutions = parser.Parse();
foreach (string substitution in substitutions)
{
- TemplateParameter parameter = new TemplateParameter(substitution);
+ var parameter = new TemplateParameter(substitution);
_templatedParameters.Add(parameter);
parameters.AddParameter(parameter);
}
@@ -44,13 +44,13 @@
{
command.Parameters.Clear();
- StringBuilder sb = new StringBuilder(_selectAndFromClause);
+ var sb = new StringBuilder(_selectAndFromClause);
foreach (TemplateParameter parameter in _templatedParameters)
{
parameter.Substitute(sb);
}
- ArrayList whereList = new ArrayList();
+ var whereList = new ArrayList();
foreach (IQueryFilter filter in _filters)
{
if (filter.IsActive())
@@ -63,7 +63,7 @@
if (whereList.Count > 0)
{
sb.Append(" where ");
- string[] filterStrings = (string[]) whereList.ToArray(typeof (string));
+ var filterStrings = (string[]) whereList.ToArray(typeof (string));
string whereClause = string.Join(" and ", filterStrings);
sb.Append(whereClause);
}
Modified: trunk/Source/StructureMap.DataAccess/ExecutionStates/AutoCommitExecutionState.cs
===================================================================
--- trunk/Source/StructureMap.DataAccess/ExecutionStates/AutoCommitExecutionState.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DataAccess/ExecutionStates/AutoCommitExecutionState.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -49,7 +49,7 @@
{
setupConnection(command);
_adapter.SelectCommand = command;
- DataSet dataSet = new DataSet();
+ var dataSet = new DataSet();
_adapter.Fill(dataSet);
return dataSet;
Modified: trunk/Source/StructureMap.DataAccess/ExecutionStates/TransactionalExecutionState.cs
===================================================================
--- trunk/Source/StructureMap.DataAccess/ExecutionStates/TransactionalExecutionState.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DataAccess/ExecutionStates/TransactionalExecutionState.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -47,7 +47,7 @@
{
prepareCommand(command);
_adapter.SelectCommand = command;
- DataSet dataSet = new DataSet();
+ var dataSet = new DataSet();
_adapter.Fill(dataSet);
Modified: trunk/Source/StructureMap.DataAccess/IDatabaseEngine.cs
===================================================================
--- trunk/Source/StructureMap.DataAccess/IDatabaseEngine.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DataAccess/IDatabaseEngine.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -15,6 +15,4 @@
IDataParameter CreateParameter(string parameterName, DbType dbType, bool isNullable);
string GetParameterName(string logicalName);
}
-
-
}
\ No newline at end of file
Modified: trunk/Source/StructureMap.DataAccess/JSON/Field.cs
===================================================================
--- trunk/Source/StructureMap.DataAccess/JSON/Field.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DataAccess/JSON/Field.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -32,7 +32,7 @@
public static Field[] GetFields(DataTable table)
{
- Field[] returnValue = new Field[table.Columns.Count];
+ var returnValue = new Field[table.Columns.Count];
for (int i = 0; i < table.Columns.Count; i++)
Modified: trunk/Source/StructureMap.DataAccess/JSON/JSONArray.cs
===================================================================
--- trunk/Source/StructureMap.DataAccess/JSON/JSONArray.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DataAccess/JSON/JSONArray.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -6,8 +6,8 @@
{
public class JSONArray : Part
{
- private ArrayList _parts = new ArrayList();
- private bool _pretty;
+ private readonly ArrayList _parts = new ArrayList();
+ private readonly bool _pretty;
public JSONArray(bool pretty)
{
Modified: trunk/Source/StructureMap.DataAccess/JSON/JSONObject.cs
===================================================================
--- trunk/Source/StructureMap.DataAccess/JSON/JSONObject.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DataAccess/JSON/JSONObject.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -6,12 +6,8 @@
{
public class JSONObject : Part
{
- private ArrayList _parts = new ArrayList();
+ private readonly ArrayList _parts = new ArrayList();
- public JSONObject()
- {
- }
-
public JSONObject AddString(string propertyName, string propertyValue)
{
_parts.Add(JSONProperty.String(propertyName, propertyValue));
Modified: trunk/Source/StructureMap.DataAccess/JSON/JSONSerializer.cs
===================================================================
--- trunk/Source/StructureMap.DataAccess/JSON/JSONSerializer.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DataAccess/JSON/JSONSerializer.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -16,7 +16,7 @@
{
_fields = Field.GetFields(_table);
- JSONArray array = new JSONArray(true);
+ var array = new JSONArray(true);
foreach (DataRow row in _table.Rows)
@@ -29,7 +29,7 @@
private void writeObject(JSONArray array, DataRow row)
{
- JSONObject obj = new JSONObject();
+ var obj = new JSONObject();
foreach (Field field in _fields)
{
Modified: trunk/Source/StructureMap.DataAccess/JSON/Part.cs
===================================================================
--- trunk/Source/StructureMap.DataAccess/JSON/Part.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DataAccess/JSON/Part.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -8,7 +8,7 @@
public string ToJSON()
{
- StringBuilder sb = new StringBuilder();
+ var sb = new StringBuilder();
Write(sb);
return sb.ToString().Trim();
}
Modified: trunk/Source/StructureMap.DataAccess/MSSQL/MSSQLDatabaseEngine.cs
===================================================================
--- trunk/Source/StructureMap.DataAccess/MSSQL/MSSQLDatabaseEngine.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DataAccess/MSSQL/MSSQLDatabaseEngine.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -67,7 +67,7 @@
public IDbCommand CreateStoredProcedureCommand(string commandText)
{
SqlCommand command = null;
- SqlConnection connection = new SqlConnection(_connectionString);
+ var connection = new SqlConnection(_connectionString);
try
{
@@ -90,8 +90,8 @@
}
catch (SqlException e)
{
- Exception ex = new Exception("Error connecting or executing database command " + e.Message);
- throw(ex);
+ var ex = new Exception("Error connecting or executing database command " + e.Message);
+ throw (ex);
}
finally
{
@@ -112,7 +112,7 @@
private SqlParameter createParameter(string logicalName)
{
- SqlParameter parameter = new SqlParameter();
+ var parameter = new SqlParameter();
parameter.ParameterName = "@" + logicalName;
return parameter;
}
@@ -124,9 +124,9 @@
private void pruneDuplicates(SqlCommand command)
{
- ArrayList list = new ArrayList();
+ var list = new ArrayList();
- SqlParameter[] parameters = new SqlParameter[command.Parameters.Count];
+ var parameters = new SqlParameter[command.Parameters.Count];
command.Parameters.CopyTo(parameters, 0);
foreach (SqlParameter parameter in parameters)
Modified: trunk/Source/StructureMap.DataAccess/Oracle/OracleDatabaseEngine.cs
===================================================================
--- trunk/Source/StructureMap.DataAccess/Oracle/OracleDatabaseEngine.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DataAccess/Oracle/OracleDatabaseEngine.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -1,20 +1,20 @@
-using System;
-using System.Collections.Generic;
+using System;
using System.Data;
using System.Data.OracleClient;
-using System.Text;
namespace StructureMap.DataAccess.Oracle
{
public class OracleDatabaseEngine : IDatabaseEngine
{
- private IConnectionStringProvider _provider;
+ private readonly IConnectionStringProvider _provider;
public OracleDatabaseEngine(IConnectionStringProvider provider)
{
_provider = provider;
}
+ #region IDatabaseEngine Members
+
public IDbConnection GetConnection()
{
return new OracleConnection(_provider.GetConnectionString());
@@ -27,7 +27,7 @@
public IDbCommand CreateStoredProcedureCommand(string commandText)
{
- throw new System.NotImplementedException();
+ throw new NotImplementedException();
}
public IDbDataAdapter GetDataAdapter()
@@ -37,17 +37,19 @@
public IDataParameter CreateStringParameter(string parameterName, int size, bool isNullable)
{
- throw new System.NotImplementedException();
+ throw new NotImplementedException();
}
public IDataParameter CreateParameter(string parameterName, DbType dbType, bool isNullable)
{
- throw new System.NotImplementedException();
+ throw new NotImplementedException();
}
public string GetParameterName(string logicalName)
{
- throw new System.NotImplementedException();
+ throw new NotImplementedException();
}
+
+ #endregion
}
-}
+}
\ No newline at end of file
Modified: trunk/Source/StructureMap.DataAccess/ParameterCollection.cs
===================================================================
--- trunk/Source/StructureMap.DataAccess/ParameterCollection.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DataAccess/ParameterCollection.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -7,7 +7,7 @@
{
public class ParameterCollection : IEnumerable
{
- private Hashtable _parameters = new Hashtable();
+ private readonly Hashtable _parameters = new Hashtable();
public ParameterCollection()
{
@@ -17,7 +17,7 @@
{
foreach (IDataParameter innerParameter in parameters)
{
- Parameter parameter = new Parameter(innerParameter);
+ var parameter = new Parameter(innerParameter);
AddParameter(parameter);
}
}
Modified: trunk/Source/StructureMap.DataAccess/Parameterization/ParameterizedCommand.cs
===================================================================
--- trunk/Source/StructureMap.DataAccess/Parameterization/ParameterizedCommand.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DataAccess/Parameterization/ParameterizedCommand.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -14,7 +14,7 @@
public override void Initialize(IDatabaseEngine engine)
{
- ParameterizedCommandBuilder builder = new ParameterizedCommandBuilder(engine, _commandText);
+ var builder = new ParameterizedCommandBuilder(engine, _commandText);
builder.Build();
initializeMembers(builder.Parameters, builder.Command);
Modified: trunk/Source/StructureMap.DataAccess/Parameterization/ParameterizedCommandBuilder.cs
===================================================================
--- trunk/Source/StructureMap.DataAccess/Parameterization/ParameterizedCommandBuilder.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DataAccess/Parameterization/ParameterizedCommandBuilder.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -7,13 +7,13 @@
{
public class ParameterizedCommandBuilder
{
+ private readonly IDbCommand _command;
private readonly string _commandTemplate;
+ private readonly StringBuilder _commandTextBuilder;
private readonly IDatabaseEngine _engine;
- private IDbCommand _command;
- private StringBuilder _commandTextBuilder;
- private bool _hasBuilt = false;
- private string[] _parameterNames;
- private ParameterCollection _parameters;
+ private readonly string[] _parameterNames;
+ private readonly ParameterCollection _parameters;
+ private bool _hasBuilt;
public ParameterizedCommandBuilder(IDatabaseEngine engine, string commandTemplate)
{
@@ -21,7 +21,7 @@
_commandTemplate = commandTemplate;
_parameters = new ParameterCollection();
- TemplateParser parser = new TemplateParser(_commandTemplate);
+ var parser = new TemplateParser(_commandTemplate);
_parameterNames = parser.Parse();
_commandTextBuilder = new StringBuilder(_commandTemplate);
Modified: trunk/Source/StructureMap.DataAccess/Parameters/Parameter.cs
===================================================================
--- trunk/Source/StructureMap.DataAccess/Parameters/Parameter.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DataAccess/Parameters/Parameter.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -5,7 +5,7 @@
public class Parameter : IParameter
{
private readonly IDataParameter _innerParameter;
- private string _parameterName;
+ private readonly string _parameterName;
public Parameter(IDataParameter innerParameter) : this(innerParameter, innerParameter.ParameterName)
{
Modified: trunk/Source/StructureMap.DataAccess/ReaderSourceCollection.cs
===================================================================
--- trunk/Source/StructureMap.DataAccess/ReaderSourceCollection.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DataAccess/ReaderSourceCollection.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -7,7 +7,7 @@
{
private readonly ICommandFactory _commandFactory;
private readonly DataSession _parent;
- private Hashtable _sources;
+ private readonly Hashtable _sources;
public ReaderSourceCollection(DataSession session, ICommandFactory commandFactory)
{
Modified: trunk/Source/StructureMap.DataAccess/TemplateParser.cs
===================================================================
--- trunk/Source/StructureMap.DataAccess/TemplateParser.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DataAccess/TemplateParser.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -24,13 +24,13 @@
throw new ApplicationException(_template);
}
- string[] tempValues = new string[_leftCurlyIndexes.Length];
+ var tempValues = new string[_leftCurlyIndexes.Length];
for (int i = 0; i < _leftCurlyIndexes.Length; i++)
{
tempValues[i] = getSubstitution(i);
}
- ArrayList list = new ArrayList();
+ var list = new ArrayList();
foreach (string tempValue in tempValues)
{
if (!list.Contains(tempValue))
@@ -58,7 +58,7 @@
private int[] findAllOccurrences(string bracket)
{
- ArrayList list = new ArrayList();
+ var list = new ArrayList();
int curlyIndex = _template.IndexOf(bracket, 0);
while (curlyIndex > -1)
Modified: trunk/Source/StructureMap.DataAccess/Tools/Mocks/CommandExpectation.cs
===================================================================
--- trunk/Source/StructureMap.DataAccess/Tools/Mocks/CommandExpectation.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DataAccess/Tools/Mocks/CommandExpectation.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -4,10 +4,10 @@
{
public class CommandExpectation : ICloneable
{
+ private readonly ParameterList _inputs;
+ private readonly ParameterList _outputs;
private readonly int _rowsAffected;
- private ParameterList _inputs;
- private ParameterList _outputs;
- private bool _wasExecuted = false;
+ private bool _wasExecuted;
public CommandExpectation() : this(1)
{
Modified: trunk/Source/StructureMap.DataAccess/Tools/Mocks/MockCommand.cs
===================================================================
--- trunk/Source/StructureMap.DataAccess/Tools/Mocks/MockCommand.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DataAccess/Tools/Mocks/MockCommand.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -5,25 +5,20 @@
{
public class MockCommand : ICommand
{
+ private readonly Queue _expectations;
+ private readonly ParameterList _inputs;
private CommandExpectation _currentExpectation;
- private Queue _expectations;
- private ParameterList _inputs;
- private string _name;
public MockCommand(string name)
{
- _name = name;
+ Name = name;
_expectations = new Queue();
_inputs = new ParameterList();
}
#region ICommand Members
- public string Name
- {
- get { return _name; }
- set { _name = value; }
- }
+ public string Name { get; set; }
public int Execute()
@@ -57,7 +52,7 @@
if (_expectations.Count > 0)
{
- CommandExpectation nextExpectation = (CommandExpectation) _expectations.Peek();
+ var nextExpectation = (CommandExpectation) _expectations.Peek();
if (nextExpectation.IsOutput(parameterName))
{
throw new NotExecutedCommandException(parameterName, Name);
Modified: trunk/Source/StructureMap.DataAccess/Tools/Mocks/MockDataSession.cs
===================================================================
--- trunk/Source/StructureMap.DataAccess/Tools/Mocks/MockDataSession.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DataAccess/Tools/Mocks/MockDataSession.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -5,8 +5,8 @@
{
public class MockDataSession : IDataSession
{
- private StubbedCommandCollection _commands;
- private StubbedReaderSourceCollection _sources;
+ private readonly StubbedCommandCollection _commands;
+ private readonly StubbedReaderSourceCollection _sources;
public MockDataSession()
{
@@ -105,14 +105,14 @@
public void AddReaderExpectation(string name, ReaderExpectation expectation)
{
- MockReaderSource source = (MockReaderSource) _sources[name];
+ var source = (MockReaderSource) _sources[name];
source.AddExpectation(expectation);
}
public void AddCommandExpectation(string name, CommandExpectation expectation)
{
- MockCommand command = (MockCommand) _commands[name];
+ var command = (MockCommand) _commands[name];
command.AddExpectation(expectation);
}
}
Modified: trunk/Source/StructureMap.DataAccess/Tools/Mocks/MockReaderSource.cs
===================================================================
--- trunk/Source/StructureMap.DataAccess/Tools/Mocks/MockReaderSource.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DataAccess/Tools/Mocks/MockReaderSource.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -7,25 +7,20 @@
{
public class MockReaderSource : IReaderSource
{
- private Queue _expectations;
- private string _name;
- private ParameterList _parameters;
+ private readonly Queue _expectations;
+ private readonly ParameterList _parameters;
public MockReaderSource(string name)
{
- _name = name;
+ Name = name;
_parameters = new ParameterList();
_expectations = new Queue();
}
#region IReaderSource Members
- public string Name
- {
- get { return _name; }
- set { _name = value; }
- }
+ public string Name { get; set; }
public IDataReader ExecuteReader()
{
@@ -34,7 +29,7 @@
throw new UnExpectedCallException(Name);
}
- ReaderExpectation expectation = (ReaderExpectation) _expectations.Dequeue();
+ var expectation = (ReaderExpectation) _expectations.Dequeue();
return expectation.VerifyAndGetReader(_parameters);
}
Modified: trunk/Source/StructureMap.DataAccess/Tools/Mocks/NotExecutedCommandException.cs
===================================================================
--- trunk/Source/StructureMap.DataAccess/Tools/Mocks/NotExecutedCommandException.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DataAccess/Tools/Mocks/NotExecutedCommandException.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -7,7 +7,7 @@
private readonly string _parameterName;
private string _commandName = string.Empty;
- public NotExecutedCommandException(string parameterName) : base()
+ public NotExecutedCommandException(string parameterName)
{
_parameterName = parameterName;
}
Modified: trunk/Source/StructureMap.DataAccess/Tools/Mocks/ParameterList.cs
===================================================================
--- trunk/Source/StructureMap.DataAccess/Tools/Mocks/ParameterList.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DataAccess/Tools/Mocks/ParameterList.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -24,7 +24,7 @@
{
get
{
- string[] returnValue = new string[_values.Count];
+ var returnValue = new string[_values.Count];
_values.Keys.CopyTo(returnValue, 0);
Array.Sort(returnValue);
@@ -37,7 +37,7 @@
public object Clone()
{
- ParameterList clone = new ParameterList();
+ var clone = new ParameterList();
clone._values = (Hashtable) _values.Clone();
return clone;
@@ -47,11 +47,11 @@
public void Verify(ParameterList actualList)
{
- ArrayList expectedKeys = new ArrayList(AllKeys);
- ArrayList actualKeys = new ArrayList(actualList.AllKeys);
- ArrayList unionKeys = new ArrayList();
+ var expectedKeys = new ArrayList(AllKeys);
+ var actualKeys = new ArrayList(actualList.AllKeys);
+ var unionKeys = new ArrayList();
- string[] keys = (string[]) actualKeys.ToArray(typeof (string));
+ var keys = (string[]) actualKeys.ToArray(typeof (string));
foreach (string key in keys)
{
@@ -63,7 +63,7 @@
}
}
- ParameterValidationFailureException failureCondition = new ParameterValidationFailureException();
+ var failureCondition = new ParameterValidationFailureException();
checkForWrongParameterValues(unionKeys, actualList, failureCondition);
checkForMissingParameters(expectedKeys, failureCondition);
Modified: trunk/Source/StructureMap.DataAccess/Tools/Mocks/ParameterValidationFailureException.cs
===================================================================
--- trunk/Source/StructureMap.DataAccess/Tools/Mocks/ParameterValidationFailureException.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DataAccess/Tools/Mocks/ParameterValidationFailureException.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -6,10 +6,6 @@
{
private string _message = string.Empty;
- public ParameterValidationFailureException() : base()
- {
- }
-
public override string Message
{
get { return _message; }
Modified: trunk/Source/StructureMap.DataAccess/Tools/Mocks/StubbedCommandCollection.cs
===================================================================
--- trunk/Source/StructureMap.DataAccess/Tools/Mocks/StubbedCommandCollection.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DataAccess/Tools/Mocks/StubbedCommandCollection.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -5,7 +5,7 @@
{
public class StubbedCommandCollection : ICommandCollection
{
- private Hashtable _commands;
+ private readonly Hashtable _commands;
public StubbedCommandCollection()
{
@@ -21,7 +21,7 @@
{
if (!_commands.ContainsKey(commandName))
{
- MockCommand command = new MockCommand(commandName);
+ var command = new MockCommand(commandName);
_commands.Add(commandName, command);
}
Modified: trunk/Source/StructureMap.DataAccess/Tools/Mocks/StubbedReaderSource.cs
===================================================================
--- trunk/Source/StructureMap.DataAccess/Tools/Mocks/StubbedReaderSource.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DataAccess/Tools/Mocks/StubbedReaderSource.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -2,8 +2,5 @@
{
public class StubbedReaderSource
{
- public StubbedReaderSource()
- {
- }
}
}
\ No newline at end of file
Modified: trunk/Source/StructureMap.DataAccess/Tools/Mocks/StubbedReaderSourceCollection.cs
===================================================================
--- trunk/Source/StructureMap.DataAccess/Tools/Mocks/StubbedReaderSourceCollection.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DataAccess/Tools/Mocks/StubbedReaderSourceCollection.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -5,7 +5,7 @@
{
public class StubbedReaderSourceCollection : IReaderSourceCollection
{
- private Hashtable _sources;
+ private readonly Hashtable _sources;
public StubbedReaderSourceCollection()
{
@@ -31,7 +31,7 @@
{
if (!_sources.ContainsKey(name))
{
- MockReaderSource source = new MockReaderSource(name);
+ var source = new MockReaderSource(name);
_sources.Add(name, source);
}
Modified: trunk/Source/StructureMap.DataAccess/Tools/TableDataReader.cs
===================================================================
--- trunk/Source/StructureMap.DataAccess/Tools/TableDataReader.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DataAccess/Tools/TableDataReader.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -5,12 +5,12 @@
{
public class TableDataReader : IDataReader
{
+ private readonly DataTable[] _tables;
private int _currentPosition;
private DataRow _currentRow;
private DataTable _currentTable;
private bool _isClosed;
private int _tableIndex = -1;
- private DataTable[] _tables;
public TableDataReader()
: this(new DataTable())
@@ -18,7 +18,7 @@
}
public TableDataReader(DataTable table)
- : this(new DataTable[] {table})
+ : this(new[] {table})
{
}
Modified: trunk/Source/StructureMap.DeploymentTasks/AddAssembly.cs
===================================================================
--- trunk/Source/StructureMap.DeploymentTasks/AddAssembly.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DeploymentTasks/AddAssembly.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -11,18 +11,14 @@
private string _assemblyName;
private string _configPath;
- public AddAssembly()
- {
- }
-
- [TaskAttribute("configPath", Required=true)]
+ [TaskAttribute("configPath", Required = true)]
public string ConfigPath
{
get { return _configPath; }
set { _configPath = value; }
}
- [TaskAttribute("assemblyName", Required=true)]
+ [TaskAttribute("assemblyName", Required = true)]
public string AssemblyName
{
get { return _assemblyName; }
@@ -41,7 +37,7 @@
public XmlDocument AddAssemblyNode()
{
- XmlDocument document = new XmlDocument();
+ var document = new XmlDocument();
document.Load(_configPath);
AddAssemblyToDocument(document);
Modified: trunk/Source/StructureMap.DeploymentTasks/AssemblyInfo.cs
===================================================================
--- trunk/Source/StructureMap.DeploymentTasks/AssemblyInfo.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DeploymentTasks/AssemblyInfo.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -7,6 +7,6 @@
// associated with an assembly.
//
-[assembly : AssemblyTitle("StructureMap v0.91")]
-[assembly : AssemblyDescription("Deployment Tasks for NAnt")]
-[assembly : ReflectionPermission(SecurityAction.RequestMinimum, ReflectionEmit=true)]
\ No newline at end of file
+[assembly: AssemblyTitle("StructureMap v0.91")]
+[assembly: AssemblyDescription("Deployment Tasks for NAnt")]
+[assembly: ReflectionPermission(SecurityAction.RequestMinimum, ReflectionEmit = true)]
\ No newline at end of file
Modified: trunk/Source/StructureMap.DeploymentTasks/SetOverrideTask.cs
===================================================================
--- trunk/Source/StructureMap.DeploymentTasks/SetOverrideTask.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DeploymentTasks/SetOverrideTask.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -13,32 +13,28 @@
private string _profileName = string.Empty;
private string _typeName = string.Empty;
- public SetOverrideTask() : base()
- {
- }
-
- [TaskAttribute("configPath", Required=true)]
+ [TaskAttribute("configPath", Required = true)]
public string ConfigPath
{
get { return _configPath; }
set { _configPath = value; }
}
- [TaskAttribute("profileName", Required=false)]
+ [TaskAttribute("profileName", Required = false)]
public string ProfileName
{
get { return _profileName; }
set { _profileName = value; }
}
- [TaskAttribute("typeName", Required=true)]
+ [TaskAttribute("typeName", Required = true)]
public string TypeName
{
get { return _typeName; }
set { _typeName = value; }
}
- [TaskAttribute("key", Required=true)]
+ [TaskAttribute("key", Required = true)]
public string DefaultKey
{
get { return _defaultKey; }
@@ -48,7 +44,7 @@
protected override void ExecuteTask()
{
- XmlDocument document = new XmlDocument();
+ var document = new XmlDocument();
document.Load(_configPath);
ApplyToDocument(document);
@@ -85,7 +81,7 @@
private XmlElement findOverrideElement(XmlElement profileElement, XmlDocument document)
{
string overrideXPath = string.Format("Override[@Type='{0}']", _typeName);
- XmlElement overrideElement = (XmlElement) profileElement.SelectSingleNode(overrideXPath);
+ var overrideElement = (XmlElement) profileElement.SelectSingleNode(overrideXPath);
if (overrideElement == null)
{
overrideElement = document.CreateElement("Override");
@@ -98,7 +94,7 @@
private XmlElement findProfileElement(string profileName, XmlDocument document)
{
string profileXPath = string.Format("Profile[@Name='{0}']", profileName);
- XmlElement profileElement = (XmlElement) document.DocumentElement.SelectSingleNode(profileXPath);
+ var profileElement = (XmlElement) document.DocumentElement.SelectSingleNode(profileXPath);
if (profileElement == null)
{
profileElement = document.CreateElement("Profile");
Modified: trunk/Source/StructureMap.DeploymentTasks/SubstitutionTask.cs
===================================================================
--- trunk/Source/StructureMap.DeploymentTasks/SubstitutionTask.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DeploymentTasks/SubstitutionTask.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -12,25 +12,21 @@
private string _flag;
private string _value;
- public SubstitutionTask() : base()
- {
- }
-
- [TaskAttribute("flag", Required=true)]
+ [TaskAttribute("flag", Required = true)]
public string Flag
{
get { return _flag; }
set { _flag = value; }
}
- [TaskAttribute("value", Required=true)]
+ [TaskAttribute("value", Required = true)]
public string Value
{
get { return _value; }
set { _value = value; }
}
- [TaskAttribute("file", Required=true)]
+ [TaskAttribute("file", Required = true)]
public string FilePath
{
get { return _filePath; }
@@ -47,16 +43,16 @@
{
string xml = string.Empty;
- using (FileStream stream = new FileStream(_filePath, FileMode.Open, FileAccess.Read))
+ using (var stream = new FileStream(_filePath, FileMode.Open, FileAccess.Read))
{
- StreamReader reader = new StreamReader(stream);
+ var reader = new StreamReader(stream);
xml = reader.ReadToEnd();
}
string searchString = string.Format("{{{0}}}", _flag);
xml = xml.Replace(searchString, _value);
- XmlDocument document = new XmlDocument();
+ var document = new XmlDocument();
document.LoadXml(xml);
document.Save(_filePath);
}
Modified: trunk/Source/StructureMap.DeploymentTasks/Versioning/CheckVersionTask.cs
===================================================================
--- trunk/Source/StructureMap.DeploymentTasks/Versioning/CheckVersionTask.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DeploymentTasks/Versioning/CheckVersionTask.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -8,15 +8,11 @@
[TaskName("structuremap.checkversion")]
public class CheckVersionTask : Task, IVersionReport
{
- private ArrayList _exclusionList = new ArrayList();
+ private readonly ArrayList _exclusionList = new ArrayList();
private string _manifestFile;
private bool _succeeded = true;
private string _targetFolder;
- public CheckVersionTask() : base()
- {
- }
-
[TaskAttribute("manifest", Required = true)]
public string ManifestFile
{
@@ -97,8 +93,8 @@
string.Format("Starting version checking of folder {0} against manifest file {1}", _targetFolder,
_manifestFile));
- DirectoryInfo targetDirectoryInfo = new DirectoryInfo(TargetFolder);
- DeployedDirectory actualDirectory = new DeployedDirectory(targetDirectoryInfo);
+ var targetDirectoryInfo = new DirectoryInfo(TargetFolder);
+ var actualDirectory = new DeployedDirectory(targetDirectoryInfo);
DeployedDirectory expectedDirectory = DeployedDirectory.ReadFromXml(_manifestFile);
Modified: trunk/Source/StructureMap.DeploymentTasks/Versioning/DeployedDirectory.cs
===================================================================
--- trunk/Source/StructureMap.DeploymentTasks/Versioning/DeployedDirectory.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DeploymentTasks/Versioning/DeployedDirectory.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -9,7 +9,6 @@
private Hashtable _assemblies;
private Hashtable _childDirectories;
private Hashtable _files;
- private string _name;
public DeployedDirectory()
{
@@ -20,7 +19,7 @@
public DeployedDirectory(DirectoryInfo directory) : this()
{
- _name = directory.Name;
+ Name = directory.Name;
// foreach (DirectoryInfo childDirectory in directory.GetDirectories())
// {
@@ -43,11 +42,7 @@
}
}
- public string Name
- {
- get { return _name; }
- set { _name = value; }
- }
+ public string Name { get; set; }
// public DeployedDirectory[] ChildDeployedDirectories
// {
@@ -83,7 +78,7 @@
{
get
{
- DeployedFile[] children = new DeployedFile[_files.Count];
+ var children = new DeployedFile[_files.Count];
_files.Values.CopyTo(children, 0);
return children;
@@ -102,7 +97,7 @@
{
get
{
- DotNetAssembly[] assemblies = new DotNetAssembly[_assemblies.Count];
+ var assemblies = new DotNetAssembly[_assemblies.Count];
_assemblies.Values.CopyTo(assemblies, 0);
return assemblies;
@@ -155,8 +150,8 @@
public void WriteToXml(string fileName)
{
- XmlSerializer serializer = new XmlSerializer(GetType());
- using (FileStream stream = new FileStream(fileName, FileMode.Create, FileAccess.Write))
+ var serializer = new XmlSerializer(GetType());
+ using (var stream = new FileStream(fileName, FileMode.Create, FileAccess.Write))
{
serializer.Serialize(stream, this);
}
@@ -165,8 +160,8 @@
public static DeployedDirectory ReadFromXml(string fileName)
{
- XmlSerializer serializer = new XmlSerializer(typeof (DeployedDirectory));
- using (FileStream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read))
+ var serializer = new XmlSerializer(typeof (DeployedDirectory));
+ using (var stream = new FileStream(fileName, FileMode.Open, FileAccess.Read))
{
return (DeployedDirectory) serializer.Deserialize(stream);
}
Modified: trunk/Source/StructureMap.DeploymentTasks/Versioning/DeployedFile.cs
===================================================================
--- trunk/Source/StructureMap.DeploymentTasks/Versioning/DeployedFile.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DeploymentTasks/Versioning/DeployedFile.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -31,8 +31,8 @@
public static DeployedFile CreateFile(FileInfo fileInfo)
{
- DeployedFile deployedFile = new DeployedFile(fileInfo.Name);
- SHA1CryptoServiceProvider crypto = new SHA1CryptoServiceProvider();
+ var deployedFile = new DeployedFile(fileInfo.Name);
+ var crypto = new SHA1CryptoServiceProvider();
using (FileStream stream = fileInfo.OpenRead())
{
Modified: trunk/Source/StructureMap.DeploymentTasks/Versioning/DotNetAssembly.cs
===================================================================
--- trunk/Source/StructureMap.DeploymentTasks/Versioning/DotNetAssembly.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DeploymentTasks/Versioning/DotNetAssembly.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -6,9 +6,7 @@
{
public class DotNetAssembly
{
- private string _assemblyName;
private byte[] _publicKey = new byte[0];
- private string _version;
public DotNetAssembly()
{
@@ -17,20 +15,20 @@
public DotNetAssembly(byte[] publicKey, string assemblyName, string version)
{
_publicKey = publicKey;
- _assemblyName = assemblyName;
- _version = version;
+ AssemblyName = assemblyName;
+ Version = version;
}
public DotNetAssembly(string assemblyName, string version)
{
- _assemblyName = assemblyName;
- _version = version;
+ AssemblyName = assemblyName;
+ Version = version;
}
public DotNetAssembly(Assembly assembly)
{
- _assemblyName = assembly.GetName().Name;
- _version = assembly.GetName().Version.ToString();
+ AssemblyName = assembly.GetName().Name;
+ Version = assembly.GetName().Version.ToString();
_publicKey = assembly.GetName().GetPublicKey();
}
@@ -40,17 +38,9 @@
set { _publicKey = value; }
}
- public string AssemblyName
- {
- get { return _assemblyName; }
- set { _assemblyName = value; }
- }
+ public string AssemblyName { get; set; }
- public string Version
- {
- get { return _version; }
- set { _version = value; }
- }
+ public string Version { get; set; }
public static DotNetAssembly TryCreateAssembly(FileInfo fileInfo)
{
Modified: trunk/Source/StructureMap.DeploymentTasks/Versioning/GenerateVersionReport.cs
===================================================================
--- trunk/Source/StructureMap.DeploymentTasks/Versioning/GenerateVersionReport.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.DeploymentTasks/Versioning/GenerateVersionReport.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -10,18 +10,14 @@
private string _directory;
private string _outputPath;
- public GenerateVersionReport() : base()
- {
- }
-
- [TaskAttribute("directory", Required=true)]
+ [TaskAttribute("directory", Required = true)]
public string Directory
{
get { return _directory; }
set { _directory = value; }
}
- [TaskAttribute("manifest", Required=true)]
+ [TaskAttribute("manifest", Required = true)]
public string OutputPath
{
get { return _outputPath; }
@@ -33,8 +29,8 @@
Log(Level.Info,
string.Format("Generating a versioning manifest file for {0} to {1}", _directory, _outputPath));
- DirectoryInfo directoryInfo = new DirectoryInfo(_directory);
- DeployedDirectory deployedDirectory = new DeployedDirectory(directoryInfo);
+ var directoryInfo = new DirectoryInfo(_directory);
+ var deployedDirectory = new DeployedDirectory(directoryInfo);
deployedDirectory.WriteToXml(_outputPath);
}
Modified: trunk/Source/StructureMap.Testing.GenericWidgets/Properties/AssemblyInfo.cs
===================================================================
--- trunk/Source/StructureMap.Testing.GenericWidgets/Properties/AssemblyInfo.cs 2008-10-01 18:29:38 UTC (rev 160)
+++ trunk/Source/StructureMap.Testing.GenericWidgets/Properties/AssemblyInfo.cs 2008-10-02 01:05:46 UTC (rev 161)
@@ -5,24 +5,24 @@
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
-[assembly : AssemblyTitle("StructureMap.Testing.GenericWidgets")]
-[assembly : AssemblyDescription("")]
-[assembly : AssemblyConfiguration("")]
-[assembly : AssemblyCompany("")]
-[assembly : AssemblyProduct("StructureMap.Testing.GenericWidgets")]
-[assembly : AssemblyCopyright("Copyright \xA9 2006")]
-[assembly : AssemblyTrademark("")]
-[assembly : AssemblyCulture("")]
+[assembly: AssemblyTitle("StructureMap.Testing.GenericWidgets")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("StructureMap.Testing.GenericWidgets")]
+[assembly: AssemblyCopyright("Copyright \xA9 2006")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
-[assembly : ComVisible(false)]
+[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly : Guid("1af9fe...
[truncated message content] |