本文整理汇总了C#中IClock类的典型用法代码示例。如果您正苦于以下问题:C# IClock类的具体用法?C# IClock怎么用?C# IClock使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IClock类属于命名空间,在下文中一共展示了IClock类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DefaultVirtualPathMonitor
public DefaultVirtualPathMonitor(IClock clock, IVirtualPathProvider virtualPathProvider)
{
_clock = clock;
_virtualPathProvider = virtualPathProvider;
_thunk = new Thunk(this);
Logger = NullLogger.Instance;
}
示例2: FrmCajaResumida
public FrmCajaResumida(IFormFactory formFactory, IGestionAdministrativaUow uow, IReporteNegocio reporteNegocio, IClock clock)
{
Uow = uow;
_reporteNegocio = reporteNegocio;
_clock = clock;
InitializeComponent();
}
示例3: ContentHub
public ContentHub(Work<IContentManager> workContentManager,
Work<IAuthenticationService> workAuthenticationService,
IClock clock) {
_workContentManager = workContentManager;
_workAuthenticationService = workAuthenticationService;
_clock = clock;
}
示例4: CreateAccountForm
public CreateAccountForm(ParkingDatabase db, IClock clock, IMailer mailer)
{
Database = db;
FormClock = clock;
Mailer = mailer;
InitializeComponent();
}
示例5: RecordPhonecall
public RecordPhonecall(IPayAsYouGoAccountRepository payAsYouGoAccountRepository,
IDocumentSession unitOfWork, IClock clock)
{
_payAsYouGoAccountRepository = payAsYouGoAccountRepository;
_unitOfWork = unitOfWork;
_clock = clock;
}
示例6: GetInstance
public static CommandMetrics GetInstance(string name, CommandProperties properties, IClock clock)
{
Contract.Assert(!String.IsNullOrEmpty(name));
Contract.Assert(properties != null);
return _metrics.GetOrAdd(name, n => new CommandMetrics(n, properties, clock));
}
示例7: MultiClampCommander
public MultiClampCommander(uint serialNumber, uint channel, IClock clock)
{
SerialNumber = serialNumber;
Channel = channel;
Clock = clock;
UInt32 lParam = MulticlampInterop.MCTG_Pack700BSignalIDs(this.SerialNumber, this.Channel); // Pack the above two into an UInt32
int result = Win32Interop.PostMessage(Win32Interop.HWND_BROADCAST, MulticlampInterop.MCTG_OPEN_MESSAGE, (IntPtr)Win32Interop.MessageEvents.WindowHandle, (IntPtr)lParam);
Win32Interop.MessageEvents.WatchMessage(Win32Interop.WM_COPYDATA, (sender, evtArgs) =>
{
// WM_COPYDATA LPARAM is a pointer to a COPYDATASTRUCT structure
Win32Interop.COPYDATASTRUCT cds;
cds = (Win32Interop.COPYDATASTRUCT)
Marshal.PtrToStructure(evtArgs.Message.LParam, typeof(Win32Interop.COPYDATASTRUCT));
// WM_COPYDATA structure (COPYDATASTRUCT)
// dwData -- RegisterWindowMessage(MCTG_REQUEST_MESSAGE_STR)
// cbData -- size (in bytes) of the MC_TELEGRAPH_DATA structure being sent
// lpData -- MC_TELEGRAPH_DATA*
MulticlampInterop.MC_TELEGRAPH_DATA mtd;
mtd = (MulticlampInterop.MC_TELEGRAPH_DATA)Marshal.PtrToStructure(cds.lpData, typeof(MulticlampInterop.MC_TELEGRAPH_DATA));
var md = new MulticlampInterop.MulticlampData(mtd);
OnParametersChanged(md);
});
}
示例8: FillLastMonthData
// fill the database with fake data for last month, using a test clock
public static void FillLastMonthData(ParkingDatabase database, IClock testClock)
{
try
{
// fill with database with fake data
for (int i = 0; i < 80; i++)
{
CustomerAccount testAccount = new CustomerAccount(RandomString(), RandomString(), "555-555-5555",
RandomString() + "@tester.com", "password");
Billing.CreditCard.CreditCardType randomCardType = (Billing.CreditCard.CreditCardType)random.Next(3);
Billing.CreditCard testCard = new Billing.CreditCard(1234123412349876, Billing.CreditCard.CreditCardType.MASTERCARD);
Accounts.Vehicle testVehicle = new Accounts.Vehicle(RandomString() + " " + RandomString(),
RandomString());
DateTime startDate = new DateTime(2012, 11, 25, 10, 0, 0); // 11-25-12 @ 10a
DateTime testResDate = RandomTime(startDate);
database.AddAccount(testAccount);
database.AddCreditCard(testCard, testAccount.CustomerID);
database.AddVehicle(testVehicle, testAccount.CustomerID);
ParkingReservation testReservation = new ParkingReservation(testAccount, testVehicle,
testResDate, 120);
// generate a random transaction date in the past
int hours = random.Next(1, 500);
TimeSpan timeSpan = new TimeSpan(hours, 0, 0);
DateTime transactionDate = testResDate.Subtract(timeSpan);
// add reservation (and transaction) to database
database.AddReservation(testReservation, testCard.CardID, transactionDate);
}
}
catch (Exception)
{ } // confict when adding reservation (ignore)
}
示例9: Post
public Post(string username, IList<string> messages, IUserRepository userRepository, IClock clock)
{
Username = username;
Messages = messages;
_userRepository = userRepository;
_clock = clock;
}
示例10: PaypalApiService
public PaypalApiService(
IPaypalSettingsService settingsService,
IClock clock) {
_settingsService = settingsService;
_clock = clock;
T = NullLocalizer.Instance;
}
示例11: Init
public void Init() {
var builder = new ContainerBuilder();
builder.RegisterType<MembershipService>().As<IMembershipService>();
builder.RegisterType<UserService>().As<IUserService>();
builder.RegisterInstance(_clock = new StubClock()).As<IClock>();
builder.RegisterType<DefaultContentQuery>().As<IContentQuery>();
builder.RegisterType<DefaultContentManager>().As<IContentManager>();
builder.RegisterType(typeof(SettingsFormatter)).As<ISettingsFormatter>();
builder.RegisterType<ContentDefinitionManager>().As<IContentDefinitionManager>();
builder.RegisterType<DefaultContentManagerSession>().As<IContentManagerSession>();
builder.RegisterType<UserPartHandler>().As<IContentHandler>();
builder.RegisterType<StubWorkContextAccessor>().As<IWorkContextAccessor>();
builder.RegisterType<OrchardServices>().As<IOrchardServices>();
builder.RegisterAutoMocking(MockBehavior.Loose);
builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>));
builder.RegisterInstance(new Mock<IMessageEventHandler>().Object);
builder.RegisterType<DefaultMessageManager>().As<IMessageManager>();
builder.RegisterInstance(_channel = new MessagingChannelStub()).As<IMessagingChannel>();
builder.RegisterType<DefaultShapeTableManager>().As<IShapeTableManager>();
builder.RegisterType<DefaultShapeFactory>().As<IShapeFactory>();
builder.RegisterType<StubExtensionManager>().As<IExtensionManager>();
builder.RegisterType<DefaultContentDisplay>().As<IContentDisplay>();
builder.RegisterType<DefaultEncryptionService>().As<IEncryptionService>();
builder.RegisterInstance(ShellSettingsUtility.CreateEncryptionEnabled());
_session = _sessionFactory.OpenSession();
builder.RegisterInstance(new TestSessionLocator(_session)).As<ISessionLocator>();
_container = builder.Build();
_membershipService = _container.Resolve<IMembershipService>();
_userService = _container.Resolve<IUserService>();
}
示例12: Index
public ActionResult Index(IClock clock, IDocumentSession session)
{
if (clock == null) throw new ArgumentNullException("clock");
ViewBag.Message = "Welcome to Highway Christian Church!";
return View();
}
示例13: FrmVentasReservadasListado
public FrmVentasReservadasListado(IClock clock, IFormFactory formFactory, IMessageBoxDisplayService messageBoxDisplayService, ILaPazUow uow,
IVentaReservadaNegocio ventaReservadaNegocio,
IFormRegistry formRegistry)
{
Uow = uow;
SortColumn = "FechaAlta";
SortDirection = "DESC";
SortColumnMappings = new Dictionary<string, string>();
//SortColumnMappings["TipoDocumentoDi"] = "TiposDocumentosIdentidad.Abreviatura";
FormFactory = formFactory;
Uow = uow;
FormRegistry = formRegistry;
_clock = clock;
_messageBoxDisplayService = messageBoxDisplayService;
_ventaReservadaNegocio = ventaReservadaNegocio;
InitializeComponent();
InicializarPaginador();
//Fix para centrar columnas.
this.GrillaFacturasReservadas.CellFormatting += this.Grilla_CellFormatting;
MainGrid = GrillaFacturasReservadas;
this.MainPager = FacturaPager;
this.Spinner = ucProgressSpinner1;
}
示例14: BuildHeaderWriter
internal BuildHeaderWriter(IClock clock, IBuildEnvironment buildEnvironment, IOutput output, ICmdArguments cmdArguments)
{
_clock = clock;
_buildEnvironment = buildEnvironment;
_output = output;
_cmdArguments = cmdArguments;
}
示例15: AdvancedSitemapService
public AdvancedSitemapService(
IRepository<SitemapRouteRecord> routeRepository,
IRepository<SitemapSettingsRecord> settingsRepository,
IRepository<SitemapCustomRouteRecord> customRouteRepository,
IContentManager contentManager,
ICacheManager cacheManager,
ISignals signals,
IClock clock,
IContentDefinitionManager contentDefinitionManager,
IEnumerable<ISitemapRouteFilter> routeFilters,
IEnumerable<ISitemapRouteProvider> routeProviders,
ISiteService siteService,
IEnumerable<ISpecializedSitemapProvider> specializedSitemapProviders)
{
_routeRepository = routeRepository;
_settingsRepository = settingsRepository;
_customRouteRepository = customRouteRepository;
_contentManager = contentManager;
_cacheManager = cacheManager;
_signals = signals;
_clock = clock;
_contentDefinitionManager = contentDefinitionManager;
_routeFilters = routeFilters;
_routeProviders = routeProviders;
_siteService = siteService;
_specializedSitemapProviders = specializedSitemapProviders;
}