This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Code": "6150", | |
"xs:schema": { | |
"@": { | |
"id": "NewDataSet", | |
"targetNamespace": "SECURITY_GROUPS", | |
"xmlns:mstns": "SECURITY_GROUPS", | |
"xmlns": "SECURITY_GROUPS", | |
"xmlns:xs": "http://www.w3.org/2001/XMLSchema", | |
"xmlns:msdata": "urn:schemas-microsoft-com:xml-msdata", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyClass | |
{ | |
public IDb MyDB {get;set;} | |
public MyClass(ISys A) {} | |
public DoSomething() | |
{ | |
if (MyDB != null) | |
.. | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (int i = 0; i < 100; i++) | |
{ | |
ManualResetEvent allGo = new ManualResetEvent(false); | |
var model = new MyClass(); | |
object starter = new object(); | |
int waiting = 20; | |
int failures = 0; | |
Exception firstException = null; | |
Thread[] threads = new Thread[20]; | |
for (int j = 0; j < 10; j++) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LoggingRule rule2 = new LoggingRule("*", fileTarget); | |
rule2.EnableLoggingForLevel(LogLevel.Info); | |
LoggingRule rule3 = new LoggingRule("*", debugfileTarget); | |
rule3.EnableLoggingForLevel(LogLevel.Debug); | |
rule3.EnableLoggingForLevel(LogLevel.Error); | |
rule3.EnableLoggingForLevel(LogLevel.Fatal); | |
rule3.EnableLoggingForLevel(LogLevel.Trace); | |
rule3.EnableLoggingForLevel(LogLevel.Warn); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainEntryPointClass : BaseClass | |
{ | |
private ILogic Logic; | |
public MainEntryPointClass(ILogic Logic) | |
{ | |
this.Logic = Logic; | |
} | |
public MainEntryPointClass () : this(new Logic(new Timer(), new FileLogger())) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainEntryPointClass : BaseClass | |
{ | |
private ILogic Logic; | |
public MainEntryPointClass(ILogic Logic) | |
{ | |
this.Logic = Logic; | |
} | |
public MainEntryPointClass () : this(new Logic()) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainEntryPointClass : BaseClass | |
{ | |
private ILogic Logic; | |
private IFileLogger FileLogger; | |
public MainEntryPointClass () : this(new Logic()) | |
{ | |
} | |
public IFileLogger FileLogger { get; set; } // For property injection for TDD or (e.g.) AutoFac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainEntryPointClass : BaseClass | |
{ | |
private ILogicFactory LogicFactory; | |
public MainEntryPointClass(ILogicFactory LogicFactory) | |
{ | |
LogicFactory = LogicFactory; | |
} | |
public MainEntryPointClass() : this(new LogicFactory()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Logger : ILogger | |
{ | |
public void WriteData(string Data) | |
{ | |
var task = Task.Factory.Startnew(() => WriteDataAsync(Data)); | |
} | |
private void WriteDataAsync(string Data) | |
{ | |
//Write to file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void DoSomething(string Data) | |
{ | |
int localVar = int.Parse(Data.ToString)); //BOOM! Exception | |
} | |
//I need to make sure I handle this otherwise users aren't going to be happy | |
public void DoSomething(string Data) | |
{ | |
try |
OlderNewer