Skip to content

Commit

Permalink
refactoring with ReSharper
Browse files Browse the repository at this point in the history
  • Loading branch information
apetrovskiy committed Nov 3, 2013
1 parent 24851f6 commit 65430ff
Show file tree
Hide file tree
Showing 140 changed files with 35,677 additions and 2,747 deletions.
4 changes: 0 additions & 4 deletions Data/Data/Commands/SQL/GetDtSomethingCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ namespace Data.Commands
[Cmdlet(VerbsCommon.Get, "DtSomething")]
public class GetDtSomethingCommand : PSCmdlet
{
public GetDtSomethingCommand()
{
}

[Parameter(Mandatory = true,
ValueFromPipeline = true,
Position = 0)]
Expand Down
4 changes: 0 additions & 4 deletions Data/Data/Commands/XML/AddDtXmlDataEntryCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ namespace Data.Commands
[Cmdlet(VerbsCommon.Add, "DtXmlDataEntry")]
public class AddDtXmlDataEntryCommand : XMLCmdletBase
{
public AddDtXmlDataEntryCommand()
{
}

#region Parameters
[Parameter(Mandatory = true)]
[ValidateNotNullOrEmpty()]
Expand Down
4 changes: 0 additions & 4 deletions Data/Data/Commands/XML/CompareDtXmlDataCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ namespace Data.Commands
[Cmdlet(VerbsData.Compare, "DtXmlData")]
public class CompareDtXmlDataCommand : XMLCmdletBase
{
public CompareDtXmlDataCommand()
{
}

#region Parameters
[Parameter(Mandatory = true,
ValueFromPipeline = true)]
Expand Down
4 changes: 0 additions & 4 deletions Data/Data/Commands/XML/ImportDtXmlFileCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ namespace Data.Commands
[Cmdlet(VerbsData.Import, "DtXmlFile")]
public class ImportDtXmlFileCommand : XMLCmdletBase
{
public ImportDtXmlFileCommand()
{
}

#region Parameters
[Parameter(Mandatory = true)]
[ValidateNotNullOrEmpty()]
Expand Down
4 changes: 0 additions & 4 deletions Data/Data/Commands/XML/NewDtXmlComparerCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ namespace Data.Commands
[Cmdlet(VerbsCommon.New, "DtXmlComparer")]
public class NewDtXmlComparerCommand : XMLCmdletBase
{
public NewDtXmlComparerCommand()
{
}

protected override void BeginProcessing()
{
DtNewXmlComparerCommand command =
Expand Down
44 changes: 24 additions & 20 deletions Data/Data/Helpers/Inheritance/CommonCmdletBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,24 @@ public class CommonCmdletBase : PSCmdletBase
{
public CommonCmdletBase()
{

if (!UnitTestMode && !ModuleAlreadyLoaded) {
if (UnitTestMode || ModuleAlreadyLoaded) return;
DataFactory.AutofacModule = new DataModule();

DataFactory.Init();

ModuleAlreadyLoaded = true;
/*
if (!UnitTestMode && !ModuleAlreadyLoaded)
{
DataFactory.AutofacModule = new DataModule();
DataFactory.Init();
ModuleAlreadyLoaded = true;
}

*/

//CurrentData.Init();
}

Expand All @@ -42,20 +50,6 @@ protected override void BeginProcessing()

internal static bool ModuleAlreadyLoaded { get; set; }

// 20130430
// protected override void WriteLog(string logRecord)
// {
// Console.WriteLine("Here should be logging Data");
// }

// 20130430
// protected override void WriteLog(string logRecord)
// {
// if (Preferences.AutoLog) {
// TMX.Logger.Info(logRecord);
// }
// }

protected override void WriteLog(LogLevels logLevel, string logRecord)
{
if (Preferences.AutoLog) {
Expand Down Expand Up @@ -85,11 +79,21 @@ protected override void WriteLog(LogLevels logLevel, string logRecord)

protected void WriteLog(LogLevels logLevel, System.Management.Automation.ErrorRecord errorRecord)
{
if (Preferences.AutoLog) {

if (!Preferences.AutoLog) return;
this.WriteLog(logLevel, errorRecord.Exception.Message);
// 20131102
//this.WriteLog(logLevel, "Script: '" + errorRecord.InvocationInfo.ScriptName + "', line: " + errorRecord.InvocationInfo.Line.ToString());
this.WriteLog(logLevel, "Script: '" + errorRecord.InvocationInfo.ScriptName + "', line: " + errorRecord.InvocationInfo.Line);
/*
if (Preferences.AutoLog)
{
this.WriteLog(logLevel, errorRecord.Exception.Message);
this.WriteLog(logLevel, "Script: '" + errorRecord.InvocationInfo.ScriptName + "', line: " + errorRecord.InvocationInfo.Line.ToString());
// 20131102
//this.WriteLog(logLevel, "Script: '" + errorRecord.InvocationInfo.ScriptName + "', line: " + errorRecord.InvocationInfo.Line.ToString());
this.WriteLog(logLevel, "Script: '" + errorRecord.InvocationInfo.ScriptName + "', line: " + errorRecord.InvocationInfo.Line);
}
*/
}

protected override bool CheckSingleObject(PSCmdletBase cmdlet, object outputObject) { return true; }
Expand Down
3 changes: 2 additions & 1 deletion Data/Data/Helpers/UnderlyingCode/Autofac/DataModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ namespace Data
/// </summary>
public class DataModule : Autofac.Module
{
/* ReSharper
public DataModule()
{
}
}*/

internal IContainer container = null;

Expand Down
4 changes: 0 additions & 4 deletions Data/Data/Helpers/UnderlyingCode/XMLHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ namespace Data
/// </summary>
public static class XMLHelper
{
static XMLHelper()
{
}

public static void CreateXMLComparer(XMLCmdletBase cmdlet)
{
cmdlet.WriteVerbose(cmdlet, "creating an XMLComparer object");
Expand Down
Loading

0 comments on commit 65430ff

Please sign in to comment.