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
/************************************************************************************** | |
Version: 1.0.1 | |
Delegate Extension Methods | |
***************************************************************************************/ | |
using System; | |
using System.Windows.Forms; | |
public static class ControlExtension | |
{ |
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
using System.Collections.Generic; | |
using System.Data; | |
using System.Linq; | |
using System.Text; | |
using Dapper; | |
public class Repository | |
{ | |
private readonly Func<IDbConnection> _connection; |
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 async override void Run() | |
{ | |
if (string.IsNullOrEmpty(_socketObserver.Server) || (_socketObserver.Port == 0)) | |
{ | |
Logging("Socket NOT ready. Server address or port is not set."); | |
return; | |
} | |
_cts = new CancellationTokenSource(); |
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
internal class FromSerialPort : BasedSource | |
{ | |
private readonly CommPort _commPort; | |
private static System.IO.Ports.SerialPort _serialPort; | |
public FromSerialPort(CommPort commPort) | |
{ | |
if (commPort == null) throw new ArgumentNullException("CommPort"); | |
_commPort = commPort; |
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
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "Log4NetConfiguration.exe.xml", Watch = true)] |
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
Function (NumberVar interval) | |
NumberVar Days := Truncate(interval / 86400); | |
NumberVar Hours := Truncate(Remainder(interval, 86400) / 3600); | |
NumberVar Minutes := Truncate(Remainder(interval, 3600) / 60); | |
NumberVar Seconds := Remainder(interval, 60); | |
Totext(Days,'##') +'.'+ Totext(Hours,'00') +':'+ Totext(Minutes,'00') +':'+ Totext(Seconds,'00') |
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
using System; | |
using System.Collections.Generic; | |
using System.Reflection; | |
namespace CallCosting.Reporting | |
{ | |
public class ReportFactory | |
{ | |
public ReportFactory() | |
{ |
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
[Test] | |
public void Run_With_InboxMessages_Should_Call_Repo_Save() | |
{ | |
//Arrange | |
var apiConfig = new ApiConfig(); | |
apiConfig.SetCommPort(new CommPort()); | |
var fakeApi = A.Fake<ISmsApi>(); | |
var fakeLogging = A.Fake<ILogging>(); | |
var fakeOutgoingsmsRepo = A.Fake<ISmsOutgoingRepository>(); |
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
internal class DependencyConfigure | |
{ | |
public static void Initialize() | |
{ | |
var builder = new ContainerBuilder(); | |
DependencyResolver.SetResolver(new AutofacDependencyResolver(RegisterServices(builder))); | |
} | |
private static IContainer RegisterServices(ContainerBuilder builder) | |
{ |
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
using System.Collections.Generic; | |
using System.Linq; | |
namespace Sample | |
{ | |
public class ConnectionMapping<T> | |
{ | |
private readonly Dictionary<T, HashSet<string>> _connections = | |
new Dictionary<T, HashSet<string>>(); |