Skip to content

Commit a8eefe7

Browse files
committed
2015-04-30
- Adding newer SQL Server version descriptions - Enhancing columnName handling in DataSetResultWriter - Adding Schemas node to SqlServerProvider2005 - Refining AboutForm - Accessing logFileName from AboutForm - Profiling app load time - Fixing SQLite GetDataTypeName before first Read - Foundation-4.5 -> Foundation - Cancel Executing Query: Ctrl+F12 -> Alt+Pause - Cleaning code
1 parent 8d9e107 commit a8eefe7

File tree

55 files changed

+693
-1859
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+693
-1859
lines changed

DataCommander.Foundation/Configuration/NameValueCollectionReader.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ public bool GetBoolean(string name, bool defaultValue)
7878
/// <param name="name"></param>
7979
/// <param name="defaultValue"></param>
8080
/// <returns></returns>
81-
public Double GetDouble(string name, Double defaultValue)
81+
public double GetDouble(string name, double defaultValue)
8282
{
83-
return this.GetValue(name, Double.TryParse, defaultValue);
83+
return this.GetValue(name, double.TryParse, defaultValue);
8484
}
8585

8686
/// <summary>
@@ -150,19 +150,19 @@ public bool TryGetDateTime(string name, IFormatProvider provider, DateTimeStyles
150150
/// <param name="name"></param>
151151
/// <param name="value"></param>
152152
/// <returns></returns>
153-
public bool TryGetDouble(string name, out Double value)
153+
public bool TryGetDouble(string name, out double value)
154154
{
155155
string s;
156156
bool contains = this.tryGetValue(name, out s);
157157

158158
if (contains)
159159
{
160-
bool succeeded = Double.TryParse(s, out value);
160+
bool succeeded = double.TryParse(s, out value);
161161
Contract.Assert(succeeded);
162162
}
163163
else
164164
{
165-
value = default(Double);
165+
value = default(double);
166166
}
167167

168168
return contains;
@@ -176,19 +176,19 @@ public bool TryGetDouble(string name, out Double value)
176176
/// <param name="provider"></param>
177177
/// <param name="value"></param>
178178
/// <returns></returns>
179-
public bool TryGetDouble(string name, NumberStyles style, IFormatProvider provider, out Double value)
179+
public bool TryGetDouble(string name, NumberStyles style, IFormatProvider provider, out double value)
180180
{
181181
string s;
182182
bool contains = this.tryGetValue(name, out s);
183183

184184
if (contains)
185185
{
186-
bool succeeded = Double.TryParse(s, style, provider, out value);
186+
bool succeeded = double.TryParse(s, style, provider, out value);
187187
Contract.Assert(succeeded);
188188
}
189189
else
190190
{
191-
value = default(Double);
191+
value = default(double);
192192
}
193193

194194
return contains;

DataCommander.Foundation/DataCommander.Foundation-4.0.sln

Lines changed: 0 additions & 1385 deletions
This file was deleted.

DataCommander.Foundation/DataCommander.Foundation-4.5.csproj renamed to DataCommander.Foundation/DataCommander.Foundation.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</ApplicationIcon>
1212
<AssemblyKeyContainerName>
1313
</AssemblyKeyContainerName>
14-
<AssemblyName>DataCommander.Foundation-4.5</AssemblyName>
14+
<AssemblyName>DataCommander.Foundation</AssemblyName>
1515
<AssemblyOriginatorKeyFile>
1616
</AssemblyOriginatorKeyFile>
1717
<DefaultClientScript>JScript</DefaultClientScript>
@@ -65,7 +65,7 @@
6565
<ConfigurationOverrideFile>
6666
</ConfigurationOverrideFile>
6767
<DefineConstants>TRACE;DEBUG;FOUNDATION_4_5</DefineConstants>
68-
<DocumentationFile>bin\Debug\DataCommander.Foundation-4.5.xml</DocumentationFile>
68+
<DocumentationFile>bin\Debug\DataCommander.Foundation.xml</DocumentationFile>
6969
<DebugSymbols>true</DebugSymbols>
7070
<FileAlignment>4096</FileAlignment>
7171
<NoStdLib>false</NoStdLib>
@@ -210,7 +210,7 @@
210210
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
211211
<ErrorReport>prompt</ErrorReport>
212212
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
213-
<DocumentationFile>bin\Test\DataCommander.Foundation-4.5.xml</DocumentationFile>
213+
<DocumentationFile>bin\Test\DataCommander.Foundation.xml</DocumentationFile>
214214
<CodeContractsEnableRuntimeChecking>True</CodeContractsEnableRuntimeChecking>
215215
<CodeContractsRuntimeOnlyPublicSurface>False</CodeContractsRuntimeOnlyPublicSurface>
216216
<CodeContractsRuntimeThrowOnFailure>True</CodeContractsRuntimeThrowOnFailure>

DataCommander.Foundation/Diagnostics/Log/AsyncLogFile.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ public AsyncLogFile(
4141

4242
#region ILogFile Members
4343

44+
string ILogFile.FileName
45+
{
46+
get
47+
{
48+
return this.logFile.FileName;
49+
}
50+
}
51+
4452
void ILogFile.Open()
4553
{
4654
Contract.Assert(this.timer == null);

DataCommander.Foundation/Diagnostics/Log/FileLogWriter.cs

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,22 @@ public FileLogWriter(
4141

4242
if (async)
4343
{
44-
this.logFile = new AsyncLogFile( path, encoding, queueCapacity, bufferSize, timerPeriod, formatter, fileAttributes );
44+
this.logFile = new AsyncLogFile(path, encoding, queueCapacity, bufferSize, timerPeriod, formatter, fileAttributes);
4545
}
4646
else
4747
{
48-
this.logFile = new LogFile( path, encoding, bufferSize, autoFlush, formatter, fileAttributes );
48+
this.logFile = new LogFile(path, encoding, bufferSize, autoFlush, formatter, fileAttributes);
49+
}
50+
}
51+
52+
/// <summary>
53+
///
54+
/// </summary>
55+
public string FileName
56+
{
57+
get
58+
{
59+
return this.logFile.FileName;
4960
}
5061
}
5162

@@ -59,29 +70,29 @@ void ILogWriter.Open()
5970
}
6071
catch (Exception e)
6172
{
62-
log.Write( LogLevel.Error, e.ToLogString() );
73+
log.Write(LogLevel.Error, e.ToLogString());
6374
}
6475
}
6576

66-
void ILogWriter.Write( LogEntry logEntry )
77+
void ILogWriter.Write(LogEntry logEntry)
6778
{
6879
try
6980
{
7081
if (this.async)
7182
{
72-
this.logFile.Write( logEntry );
83+
this.logFile.Write(logEntry);
7384
}
7485
else
7586
{
7687
lock (this.logFile)
7788
{
78-
this.logFile.Write( logEntry );
89+
this.logFile.Write(logEntry);
7990
}
8091
}
8192
}
8293
catch (Exception e)
8394
{
84-
log.Write( LogLevel.Error, e.ToString() );
95+
log.Write(LogLevel.Error, e.ToString());
8596
}
8697
}
8798

@@ -93,7 +104,7 @@ void ILogWriter.Flush()
93104
}
94105
catch (Exception e)
95106
{
96-
log.Write( LogLevel.Error, e.ToLogString() );
107+
log.Write(LogLevel.Error, e.ToLogString());
97108
}
98109
}
99110

@@ -105,7 +116,7 @@ void ILogWriter.Close()
105116
}
106117
catch (Exception e)
107118
{
108-
log.Write( LogLevel.Error, e.ToLogString() );
119+
log.Write(LogLevel.Error, e.ToLogString());
109120
}
110121
}
111122

DataCommander.Foundation/Diagnostics/Log/FoundationLogFactory.cs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,26 @@ public FoundationLogFactory(bool forInternalUse)
6060

6161
#region IApplicationLog Members
6262

63+
string ILogFactory.FileName
64+
{
65+
get
66+
{
67+
string fileName;
68+
var fileLogWriter = this.multipeLog.LogWriters.Select(w => w.logWriter).OfType<FileLogWriter>().FirstOrDefault();
69+
70+
if (fileLogWriter != null)
71+
{
72+
fileName = fileLogWriter.FileName;
73+
}
74+
else
75+
{
76+
fileName = null;
77+
}
78+
79+
return fileName;
80+
}
81+
}
82+
6383
ILog ILogFactory.GetLog(string name)
6484
{
6585
return new FoundationLog(this, name);
@@ -162,6 +182,7 @@ private static LogWriter ReadLogWriter(ConfigurationNode node)
162182
FileAttributes.ReadOnly | FileAttributes.Hidden, out fileAttributes);
163183
var fileLogWriter = new FileLogWriter(path, Encoding.UTF8, async, queueCapacity, bufferSize,
164184
timerPeriod, autoFlush, fileAttributes);
185+
165186
logWriter = new LogWriter
166187
{
167188
logWriter = fileLogWriter
@@ -194,6 +215,14 @@ public MultipleLog(IEnumerable<LogWriter> logWriters)
194215
this.logWriters = logWriters.ToArray();
195216
}
196217

218+
public LogWriter[] LogWriters
219+
{
220+
get
221+
{
222+
return this.logWriters;
223+
}
224+
}
225+
197226
#region IDisposable Members
198227

199228
public void Dispose()

DataCommander.Foundation/Diagnostics/Log/ILogFactory.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
/// </summary>
88
public interface ILogFactory : IDisposable
99
{
10+
/// <summary>
11+
///
12+
/// </summary>
13+
string FileName { get; }
14+
1015
/// <summary>
1116
///
1217
/// </summary>

DataCommander.Foundation/Diagnostics/Log/ILogFile.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ namespace DataCommander.Foundation.Diagnostics
44

55
internal interface ILogFile : IDisposable
66
{
7+
string FileName { get; }
8+
79
void Open();
810

911
void Write(LogEntry entry);

DataCommander.Foundation/Diagnostics/Log/LogFile.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,14 @@ public void Write(DateTime date, string text)
129129

130130
#region ILogFile Members
131131

132+
public string FileName
133+
{
134+
get
135+
{
136+
return this.fileName;
137+
}
138+
}
139+
132140
void ILogFile.Open()
133141
{
134142
string begin = this.formatter.Begin();

DataCommander.Foundation/Diagnostics/Log/NullApplicationLog.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,15 @@ public static NullApplicationLog Instance
2020

2121
#region IApplicationLog Members
2222

23-
ILog ILogFactory.GetLog( string name )
23+
string ILogFactory.FileName
24+
{
25+
get
26+
{
27+
return null;
28+
}
29+
}
30+
31+
ILog ILogFactory.GetLog(string name)
2432
{
2533
return NullLog.Instance;
2634
}
@@ -35,4 +43,4 @@ void IDisposable.Dispose()
3543

3644
#endregion
3745
}
38-
}
46+
}

0 commit comments

Comments
 (0)