private FmFactoryEngine(IIoC ioc) { _ioc = ioc; _log = ioc.Resolve<ILogFile>(); _sink = ioc.Resolve<IIoSink>(); _agent = ioc.Resolve<IFunnelsAgent>(); }
private void SetupAutoMoqer(Config config) { ioc = new UnityIoC(config.Container); mocking = new MockingWithMoq(config, ioc); ioc.Setup(this, config, mocking); }
public SchedulerHostedService(IEnumerable <IScheduledTask> scheduledTasks, IIoC ioc, ILog logger) { _ioc = ioc; _logger = logger; _argumentCache = new Dictionary <object, MethodArgumentPair>(); var referenceTime = DateTime.UtcNow; _scheduledTasks = scheduledTasks.Select(t => new SchedulerTaskWrapper { Schedule = CrontabSchedule.Parse(t.Schedule), Task = t, NextRunTime = referenceTime }).ToArray(); foreach (var t in _scheduledTasks) { var type = t.Task.GetType(); _logger.InfoFormat("Adding scheduled task '{0}' for work with schedule '{1}'", type.Name, t.Schedule); if (!type.GetMethods().Any(m => m.Name == "InvokeAsync" && m.ReturnType == typeof(Task))) { var msg = $"{type.Name} does not implement a method named 'InvokeAsync' that returns a Task."; _logger.Error(msg); throw new NotImplementedException(msg); } } }
/// <summary> /// Initialise MVVM with a specific ViewModel using a default NavigationPage /// </summary> /// <typeparam name="TInitiliser">Initialisation class</typeparam> /// <typeparam name="TViewModel">ViewModel to start with</typeparam> /// <param name="ioC">Inversion of Control implementation to use</param> /// <returns>Asynchronous Task</returns> public static async Task InitiliseAsync <TInitiliser, TViewModel>(IIoC ioC, bool includeNavigationPage = true) where TInitiliser : Initiliser where TViewModel : BaseViewModel { await InitiliseAsync <TInitiliser>(ioC, includeNavigationPage); await InitiliseNavigation <TViewModel>(includeNavigationPage); }
public SelectRootDirectoryViewModel(IIoC ioc, IRootDirectoryFacade rootDirectory) : base(ioc) { if (rootDirectory == null) throw new ArgumentNullException(nameof(rootDirectory)); _rootDirectory = rootDirectory; MessageBus.Subscribe<RootDirectoryChanged>(OnRootDirectoryChanged); }
private IoThreads(IIoC ioc) { _log = ioc.Resolve<ILogFile>(); _funnels = ioc.Resolve<IFunnelsManagerEx>(); _config = ioc.Resolve<IFmConfigRa>(); _pool = create_threads(_config.Config.Client.SinkThreadsCount); }
public MainViewModel(IIoC ioc, ISelectRootDirectoryViewModel selectRootDirectoryViewModel, IListNotebooksViewModel listNotebooksViewModel, IListSectionsViewModel listSectionsViewModel, IListPagesViewModel listPagesViewModel, IEditorViewModel editorViewModel, IAddNotebookViewModel addNotebookViewModel, IAddSectionViewModel addSectionViewModel, IAddPageViewModel addPageViewModel, IRootDirectoryFacade rootDirectory, IImageCarouselViewModel imageCarousel ) : base(ioc) { if (selectRootDirectoryViewModel == null) throw new ArgumentNullException(nameof(selectRootDirectoryViewModel)); if (listNotebooksViewModel == null) throw new ArgumentNullException(nameof(listNotebooksViewModel)); if (listSectionsViewModel == null) throw new ArgumentNullException(nameof(listSectionsViewModel)); if (listPagesViewModel == null) throw new ArgumentNullException(nameof(listPagesViewModel)); if (editorViewModel == null) throw new ArgumentNullException(nameof(editorViewModel)); if (addNotebookViewModel == null) throw new ArgumentNullException(nameof(addNotebookViewModel)); if (addSectionViewModel == null) throw new ArgumentNullException(nameof(addSectionViewModel)); if (addPageViewModel == null) throw new ArgumentNullException(nameof(addPageViewModel)); if (rootDirectory == null) throw new ArgumentNullException(nameof(rootDirectory)); if (imageCarousel == null) throw new ArgumentNullException(nameof(imageCarousel)); _rootDirectory = rootDirectory; SelectRootDirectory = selectRootDirectoryViewModel; ListNotebooks = listNotebooksViewModel; ListSections = listSectionsViewModel; ListPages = listPagesViewModel; Editor = editorViewModel; AddNotebook = addNotebookViewModel; AddSection = addSectionViewModel; AddPage = addPageViewModel; ImageCarousel = imageCarousel; MessageBus.Subscribe<RootDirectoryChanged>(OnNewRootDirectory); MessageBus.Subscribe<NotebookSelected>(OnNotebookSelected); MessageBus.Subscribe<SectionSelected>(OnSectionSelected); }
public EditorViewModel(IProcessFacade process, IIoC ioc) : base(ioc) { _process = process; MessageBus.Subscribe <PageSelected>(async msg => await OnPageSelected(msg)); MessageBus.Subscribe <NotebookSelected>(OnNotebookSelected); MessageBus.Subscribe <SectionSelected>(OnSectionSelected); }
public AddPageViewModel(IPageFacade page, IIoC ioc) : base(ioc) { if (page == null) throw new ArgumentNullException(nameof(page)); _page = page; MessageBus.Subscribe<SectionSelected>(OnSectionSelected); }
public EditorViewModel(IProcessFacade process, IIoC ioc) : base(ioc) { _process = process; MessageBus.Subscribe<PageSelected>(async msg => await OnPageSelected(msg)); MessageBus.Subscribe<NotebookSelected>(OnNotebookSelected); MessageBus.Subscribe<SectionSelected>(OnSectionSelected); }
public MicroSliverDependencyResolver(IIoC ioc) { if (ioc == null) { throw new ArgumentNullException("ioc"); } _ioc = ioc; }
/// <summary> /// Init AppContext /// </summary> private void InitAppContext() { _appContext = Container.GetExportedValue <IAppContext>(); (_appContext as XAppContext).AddObject <ICommunicationProxy>(AppContextObjectName.DefaultCommunicationProxy, this._communicationProxy); this._ioC = this.Container.GetExportedValue <IIoC <CompositionContainer> >(); this._ioC.Container = this.Container; }
public ImageCarouselViewModel(IImageFacade image, IIoC ioc) : base(ioc) { if (image == null) throw new ArgumentNullException(nameof(image)); _image = image; Images = new ObservableCollection<Bitmap>(); MessageBus.Subscribe<PageSelected>(async msg => await OnPageSelected(msg)); }
private RemoteDispatcher(string myself, IIoC ioc) { _myself = myself; _counters = new Counters(); _log = ioc.Resolve<ILogFile>(); _json = ioc.Resolve<IJsonEngine>(); _rrepo = ioc.Resolve<IRemoteRepo>(); _messenger = ioc.Resolve<IMessengerEngine>(); }
public SelectRootDirectoryViewModel(IIoC ioc, IRootDirectoryFacade rootDirectory) : base(ioc) { if (rootDirectory == null) { throw new ArgumentNullException(nameof(rootDirectory)); } _rootDirectory = rootDirectory; MessageBus.Subscribe <RootDirectoryChanged>(OnRootDirectoryChanged); }
public AddPageViewModel(IPageFacade page, IIoC ioc) : base(ioc) { if (page == null) { throw new ArgumentNullException(nameof(page)); } _page = page; MessageBus.Subscribe <SectionSelected>(OnSectionSelected); }
private FunnelsShop(StoreInfo info, IIoC ioc) { _info = info; _sink = ioc.Resolve<IIoSink>(); _que = ioc.Resolve<IIoQueue>(); _io = ioc.Resolve<IIoConnector>(); _writer = IoWriter.New(ioc, info); _reader = IoReader.New(ioc, info); }
public MainViewModel(INavigationService navigation, IIoC ioc, Type initialViewModel) : base(navigation) { _ioc = ioc; if(initialViewModel != null) { Navigation.Navigate( initialViewModel ); } }
private void ConfigureApplication(IIoC container) { if (Device.OS != TargetPlatform.WinPhone) { AppResources.Culture = container.Get <ILocalize>().GetCurrentCultureInfo(); } var viewFactory = container.Get <IViewFactory>(); _application.MainPage = new NavigationPage(viewFactory.Get <IHomePageViewModel>() as Page); }
public AddSectionViewModel(ISectionFacade section, IIoC ioc) : base(ioc) { if (section == null) { throw new ArgumentNullException(nameof(section)); } _section = section; MessageBus.Subscribe <NotebookSelected>(OnNotebookSelected); }
public HomePage(IIoC ioC, IViewFactory viewFactory) { _ioC = ioC; _viewFactory = viewFactory; InitializeComponent(); OnInitializeAsync += HomePage_OnInitializeAsync; if (OnInitializeAsync != null) { OnInitializeAsync.Invoke(); } }
private SignalsAgent(IIoC ioc) { _log = ioc.Resolve<ILogFile>(); _configRa = ioc.Resolve<ISignalsConfigRa>(); _signals = ioc.Resolve<ISignalsManagerEx>(); _agentUri = make_agent_uri(_configRa.Values); var target = wcf.SignalsAgent.New(this); _host = WcfHost<comm.ISignalsAgent>.NewAsync(_log, target); }
public ListPagesViewModel(ISectionFacade section, IPageFacade page, IIoC ioc) : base(ioc) { if (section == null) throw new ArgumentNullException(nameof(section)); if (page == null) throw new ArgumentNullException(nameof(page)); _section = section; _page = page; Pages = new ItemChangeAwareObservableCollection<PageDto>(); MessageBus.Subscribe<SectionSelected>(async msg => await OnSectionSelected(msg)); MessageBus.Subscribe<PageCreated>(async msg => await OnPageCreated(msg)); }
public ImageCarouselViewModel(IImageFacade image, IIoC ioc) : base(ioc) { if (image == null) { throw new ArgumentNullException(nameof(image)); } _image = image; Images = new ObservableCollection <Bitmap>(); MessageBus.Subscribe <PageSelected>(async msg => await OnPageSelected(msg)); }
public static void Init(IIoC ioc) { ioc.Register <IConnectionStringProvider, ConnectionStringProvider>(); ioc.Register <IUnitOfWork, EfUnitOfWork>(); ioc.Register <IDbContextFactory, DbContextFactory>(); ioc.Register <IRepositoryFactory, RepositoryFactory>(); ioc.Register <IDbVersionProvider, DbVersionProvider>(); OrmInitializer.Init(); ioc.Get <IPredefinedDataManager>().Register("_02_", new ForumInitializer()); }
public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom) { _applicationObject = (DTE2)application; _addInInstance = (AddIn)addInInst; _ioc = new IoC(_applicationObject); switch (connectMode) { case ext_ConnectMode.ext_cm_UISetup: AddContextMenusToVisualStudio(); break; } }
private HelloPulseBeat(IIoC ioc, Config myConfig) { _myConfig = myConfig; _signals = ioc.Resolve<ISignalsManagerEx>(); var configRa = ioc.Resolve<ISignalsConfigRa>(); var config = configRa.Values; _log = ThrottledLog.NewSync(config.ThrottledLogTtl, ioc.Resolve<ILogFile>()); _period = config.Client.HelloMsgPeriod; _timer = new Timer(pulse); }
public ListNotebooksViewModel(INotebookFacade notebook, IIoC ioc) : base(ioc) { if (notebook == null) { throw new ArgumentNullException(nameof(notebook)); } _notebook = notebook; Notebooks = new ItemChangeAwareObservableCollection <NotebookDto>(); MessageBus.Subscribe <RootDirectoryChanged>(async msg => await OnNewRootDirectory(msg)); MessageBus.Subscribe <NotebookCreated>(async msg => await OnNotebookCreated(msg)); MessageBus.Subscribe <SectionCreated>(async msg => await OnSectionCreated(msg)); }
public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom) { _applicationObject = (DTE2) application; _addInInstance = (AddIn) addInInst; _ioc = new IoC(_applicationObject); switch (connectMode) { case ext_ConnectMode.ext_cm_UISetup: AddContextMenusToVisualStudio(); break; } }
public ListSectionsViewModel(INotebookFacade notebook, IIoC ioc) : base(ioc) { if (notebook == null) { throw new ArgumentNullException(nameof(notebook)); } _notebook = notebook; Sections = new ItemChangeAwareObservableCollection <SectionDto>(); MessageBus.Subscribe <NotebookSelected>(async msg => await OnNotebookSelected(msg)); MessageBus.Subscribe <SectionCreated>(async msg => await OnSectionCreated(msg)); MessageBus.Subscribe <PageCreated>(async msg => await OnPageCreated(msg)); }
private FunnelsAgent(IIoC ioc) { _log = ioc.Resolve<ILogFile>(); _config = ioc.Resolve<IFmConfigRa>(); var agentId = Guid.NewGuid(); int port = find_free_port(); var uri = _config.MakeAgentUri(agentId, port); _info = new AgentInfo {AgentId = agentId, Uri = uri}; var funnels = ioc.Resolve<IFunnelsManagerEx>(); var target = wcf.FunnelsAgent.New(funnels); _host = WcfHost<comm.IFunnelsAgent>.NewAsync(_log, target); }
public ListPagesViewModel(ISectionFacade section, IPageFacade page, IIoC ioc) : base(ioc) { if (section == null) { throw new ArgumentNullException(nameof(section)); } if (page == null) { throw new ArgumentNullException(nameof(page)); } _section = section; _page = page; Pages = new ItemChangeAwareObservableCollection <PageDto>(); MessageBus.Subscribe <SectionSelected>(async msg => await OnSectionSelected(msg)); MessageBus.Subscribe <PageCreated>(async msg => await OnPageCreated(msg)); }
private static void SetupInversionOfControl() { _ioc = Locator.GetContainer(); _ioc.Register <ICertificateIdentifier, CertificateIdentifier>() .Extend() .WithSpecific <string>(ConfigurationManager.AppSettings["Encryption-Certificate-Identifier"]); _ioc.Register <CertificateObtainerSettings>() .Extend() .WithSpecific <StoreName>(StoreName.My) .WithSpecific <StoreLocation>(StoreLocation.LocalMachine) .WithSpecific <X509FindType>(X509FindType.FindBySerialNumber) .WithResolveStrategy(ConstructorResolveStrategy.Complex); _ioc.Register <ICertificateObtainer, CertificationStoreExactCertificateObtainer>() .Extend() .WithResolveStrategy(ConstructorResolveStrategy.Complex); _ioc.Register <RsaCertificateEncryptor>(provider => new RsaCertificateEncryptor(provider.Resolve <ICertificateObtainer>(), RSAEncryptionPadding.OaepSHA1)); }
private MessengerEngine(IIoC ioc) { _msg2failureHandler = new Dictionary<Type, Action<comm.IoMsg>> { {typeof(comm.PublishMsg), msg => update_failure_counters((comm.PublishMsg) msg)}, {typeof(comm.FilterInfo), msg => update_failure_counters((comm.FilterInfo) msg)}, {typeof(comm.TopicFilterMsg), msg => update_failure_counters((comm.TopicFilterMsg) msg)}, {typeof(comm.HeartbeatMsg), msg => update_failure_counters((comm.HeartbeatMsg) msg)} }; _counters = new Counters(); _configRa = ioc.Resolve<ISignalsConfigRa>(); var config = _configRa.Values; _cachedConfig = config; _log = ThrottledLog.NewSync(config.ThrottledLogTtl, ioc.Resolve<ILogFile>()); _hubUri = _configRa.MakeHubUri(); _connector = ioc.Resolve<IAgentConnector>(); _agents = AgentsRepo.NewSync(); }
protected ConductorViewModel(IIoC ioc, IWindowManager windowManager, IMessageBus messageBus, ILogger log) { if (ioc == null) { throw new ArgumentNullException(nameof(ioc)); } if (windowManager == null) { throw new ArgumentNullException(nameof(windowManager)); } if (messageBus == null) { throw new ArgumentNullException(nameof(messageBus)); } if (log == null) { throw new ArgumentNullException(nameof(log)); } MessageBus = messageBus; IoC = ioc; WindowManager = windowManager; Log = log; }
public static IRemoteDispatcher New(string myself, IIoC ioc) { return new RemoteDispatcher(myself, ioc); }
private FunnelsResolver(IIoC ioc) { _log = ioc.Resolve<ILogFile>(); }
/// <summary> /// Initialise MVVM Mappings but does not load a default page /// </summary> /// <typeparam name="TInitiliser">Initialisation class</typeparam> /// <param name="ioC">Inversion of Control implementation to use</param> /// <returns>Asynchronous Task</returns> public static async Task InitiliseAsync <TInitiliser>(IIoC ioC, bool includeNavigationPage = true) where TInitiliser : Initiliser { IoC = ioC; IoC.Register(Activator.CreateInstance <TInitiliser>()); }
public AddNotebookViewModel(INotebookFacade notebook, IRootDirectoryFacade rootDirectory, IIoC ioc) : base(ioc) { if (notebook == null) throw new ArgumentNullException(nameof(notebook)); _notebook = notebook; _rootDirectory = rootDirectory; }
public static ILocalDispatcher New(IIoC ioc) { return new LocalDispatcher(ioc); }
public AddNotebookViewModel(INotebookFacade notebook, IRootDirectoryFacade rootDirectory, IIoC ioc) : base(ioc) { if (notebook == null) { throw new ArgumentNullException(nameof(notebook)); } _notebook = notebook; _rootDirectory = rootDirectory; }
/// <summary> /// Initializes the viewmodel locator and sets its internal IIoC container for use with view model instantiation. Requires assembly for object instantiation. /// </summary> /// <param name="ioc">The container containing the mappings.</param> /// <param name="ExecutingAssembly">The executing assembly of the class implementing this view model locator.</param> public void LoadIoC(IIoC ioc, Assembly ExecutingAssembly) { _ioc = ioc; assemblyName = ExecutingAssembly.FullName; }
public static IIoThreads New(IIoC ioc) { return new IoThreads(ioc); }
private AgentsEngine(IIoC ioc) { _log = ioc.Resolve<ILogFile>(); _repo = ioc.Resolve<IHubRepo>(); _messenger = ioc.Resolve<IMessengerEngine>(); }
private LocalDispatcher(IIoC ioc) { _counters = new Counters(); _log = ioc.Resolve<ILogFile>(); _lrepo = ioc.Resolve<ILocalRepo>(); }
public static IHeloPulseBeat New(IIoC ioc, Config config = null) { return new HelloPulseBeat(ioc, config ?? new Config()); }
public IoCContainerRegistry(IIoC ioc) { this.ioc = ioc; SetupIoCContainer(); }
public PageFactory(IIoC ioC, IViewModelViewMappings mappings) { Mappings = mappings; IoC = ioC; }
public static IFunnelsResolver New(IIoC ioc) { return new FunnelsResolver(ioc); }
public static IIoC Register(this IIoC ioc, Type type, params object[] args) { return(ioc.Register(type, args)); }
public static IFmFactoryEngine New(IIoC ioc) { return new FmFactoryEngine(ioc); }
public MockingWithMoq(Config config, IIoC ioc) { this._ioc = ioc; RegisteredMocks = new Dictionary <Type, object>(); _mockRepository = new MockRepository(config.MockBehavior); }
public ViewFactory(IIoC provider) { _provider = provider; }
private AgentConnector(IIoC ioc) { _counters = new Counters(); _log = ioc.Resolve<ILogFile>(); }
public static IMessengerEngine New(IIoC ioc) { return new MessengerEngine(ioc); }
public static IAgentConnector New(IIoC ioc) { return new AgentConnector(ioc); }
public static IFunnelsShop New(StoreInfo info, IIoC ioc) { return new FunnelsShop(info, ioc); }
public static IIoC Register <T>(this IIoC ioc, params object[] args) { return(ioc.Register(typeof(T), args)); }
public static IAgentsEngine New(IIoC ioc) { return new AgentsEngine(ioc); }
/// <summary> /// Holds a reference to an IIoC objects to clear web requests cache. /// </summary> public static void ManageIoC(IIoC ioc) { IoC = ioc; }