public ConfigurationController( ISiteService siteService, ILoggingProvider logger) { _siteService = siteService; _logger = logger; }
public static ILoggingProvider CreateInstance() { if (_instance == null) _instance = new MiniLog(); return _instance; }
public bool GetGltfMaterial(BabylonMaterial babylonMaterial, GLTF gltf, ILoggingProvider logger, out GLTFMaterial gltfMaterial) { gltfMaterial = null; IIGameMaterial gameMtl = babylonMaterial.maxGameMaterial; if (gameMtl == null || gameMtl.MaxMaterial == null) { return(false); } IMtl maxMtl = gameMtl.MaxMaterial; IMaxMaterialExporter materialExporter; if (materialExporters.TryGetValue(new ClassIDWrapper(maxMtl.ClassID), out materialExporter) && materialExporter is IMaxGLTFMaterialExporter) { gltfMaterial = ((IMaxGLTFMaterialExporter)materialExporter).ExportGLTFMaterial(this.exportParameters, gltf, gameMtl, (string sourcePath, string textureName) => { return(this.TryWriteImage(gltf, sourcePath, textureName, exportParameters, logger)); }, (string message, Color color) => { logger.RaiseMessage(message, color, 2); }, (string message) => { logger.RaiseWarning(message, 2); }, (string message) => { logger.RaiseError(message, 2); }); if (gltfMaterial == null) { string message = string.Format("Custom glTF material exporter failed to export | Exporter: '{0}' | Material Name: '{1}' | Material Class: '{2}'", materialExporter.GetType().ToString(), gameMtl.MaterialName, gameMtl.ClassName); logger.RaiseWarning(message, 2); return(false); } return(true); } return(false); }
public BusinessService(IDataStoreProvider dataStoreProvider, ILoggingProvider loggingProvider, IWebServiceProvider webServiceProvider) { _dataStoreProvider = dataStoreProvider; _loggingProvider = loggingProvider; _webServiceProvider = webServiceProvider; }
public SiteController( ISiteService siteService, ILoggingProvider logger) { _siteService = siteService; _logger = logger; }
public SurveyController( ISurveyService surveyService, ILoggingProvider logger) { _logger = logger; _surveyService = surveyService; }
public SelfEndpointingSingleGestureRecognizer (string label, Classifier classifier, ILoggingProvider <T> Provider) : base(label, classifier.Dataset as DataSet <T>, Provider, false) { Classifier = classifier; SmoothedData = new SmoothedList <T>(3); // Half-life of the "weight" of a data point: three data points later (pretty fast - this is a light smoothing.) PeakFinder = new PeakFinder <T>(SmoothedData, (seq) => { var Seq = new Sequence <T>() { SourcePath = seq.ToArray() }; var analyzedSeq = Current.Analyze(Seq).Result; // If we've stated that we only care about one gesture class, and it's not that, then we're obviously not there yet. //if (Target != null && Seq.RecognizedAsIndex != Target.index) return double.NaN; if (Target != null && Seq.RecognizedAsName != Target.className) { return(double.NaN); } else { return(analyzedSeq.RecognitionScore); } }, thresholdScore: 1.0, minLength: Classifier.Dataset?.MinSequenceLength ?? 5); InterimInterval = TimeSpan.FromMilliseconds(100); }
/// <summary> /// Initialises a new instance of the <see cref="InstanceScanner" /> /// class. /// </summary> /// <param name="fileSystemProvider"> /// An instance of <see cref="IFileSystemProvider" />. /// </param> /// <param name="loggingProvider"> /// An instance of <see cref="ILoggingProvider" />. /// </param> public InstanceScanner( IFileSystemProvider fileSystemProvider, ILoggingProvider loggingProvider) { this.fileSystemProvider = fileSystemProvider; this.loggingProvider = loggingProvider; }
public LegalController( ILegalService legalService, ILoggingProvider logger) { _legalService = legalService; _logger = logger; }
public DealershipEngine( IDealershipFactory factory, ILoggingProvider loggingProvider, ICommandHandler commandHandler) { if (factory == null) { throw new ArgumentNullException(nameof(factory)); } if (loggingProvider == null) { throw new ArgumentNullException(nameof(loggingProvider)); } if (commandHandler == null) { throw new ArgumentNullException(nameof(commandHandler)); } this.factory = factory; this.loggingProvider = loggingProvider; this.commandHandler = commandHandler; this.users = new HashSet <IUser>(); this.loggedUser = null; }
public AuthenticationEcommerceManager( ICacheProvider cacheProvider, ILoggingProvider logger) { _cacheProvider = cacheProvider; _logger = logger; }
public async Task <IMissionsSource> SetupAsync(string host, int port, string username, string password) { var builder = new ContainerBuilder(); _loggingSource = new LoggingProvider(); IFtpConnection connection = new FtpConnection(log => _loggingSource.OnNext(log)); #if DEBUG connection = new DelayedFtpConnection(connection); #endif await connection .ConnectAsync(host, port, username, password); builder.RegisterType <FtpMissionsSource>().As <IMissionsSource>(); builder.RegisterType <MissionFactory>().As <IMissionFactory>(); builder.RegisterType <MissionFilenameParser>().As <IMissionFilenameParser>(); builder.RegisterType <MissionVersionComparer>().As <IMissionVersionComparer>(); builder.RegisterType <MissionVersionFactory>().As <IMissionVersionFactory>(); builder.RegisterType <TimeProvider>().As <ITimeProvider>(); builder.RegisterInstance(_loggingSource).As <ILoggingProvider>(); builder.RegisterDecorator <LoggingMissionSourceDecorator, IMissionsSource>(); builder.RegisterInstance(connection).As <IFtpConnection>(); var container = builder.Build(); return(container.Resolve <IMissionsSource>()); }
public MainWindowViewModel(IMessenger messenger, IAppService appService, ILoggingProvider loggerProvider) : base(loggerProvider) { Log.Start(); _messenger = messenger; _messenger.RegisterAll(this); _appService = appService; _activeMode = appService.GetDefaultMode(); _activeModule = appService.GetDefaultModule(); FooterText = $"Admin Assistant - V{System.Reflection.Assembly.GetExecutingAssembly().GetName().Version}"; _contractedSidebarState = new SidebarStateSettings(ExpandedContractedStateToggle.Contracted, "fa fa-lg fa-angle-double-right", "cl-navbar-contracted", false); _expandedSidebarState = new SidebarStateSettings(ExpandedContractedStateToggle.Expanded, "fa fa-lg fa-angle-double-left", "cl-navbar-expanded", true); Sidebar = _expandedSidebarState; Modes = _appService.GetModes(); ActiveMode = _appService.GetDefaultMode(); Modules = _appService.GetModules(); ActiveModule = _appService.GetDefaultModule(); ActiveModule.StyleClass = SelectedModuleStyle; Log.Finish(); }
public void LoadFromData(ILoggingProvider logger = null, IINode dataNode = null) { dataNode = dataNode ?? Loader.Core.RootNode; Dictionary <string, string> nodePropDictionary = dataNode.UserPropToDictionary(); string animProp = string.Empty; nodePropDictionary.TryGetValue(s_AnimationListPropertyName, out animProp); if (!string.IsNullOrWhiteSpace(animProp)) { string[] animationPropertyNames = animProp.Split(';'); if (Capacity < animationPropertyNames.Length) { Capacity = animationPropertyNames.Length; } foreach (string propertyNameStr in animationPropertyNames) { if (!nodePropDictionary.ContainsKey(propertyNameStr)) { logger?.RaiseWarning($"Invalid ID {propertyNameStr}, can't deserialize."); // give a chance to other group! continue; } AnimationGroup info = new AnimationGroup(new Guid(propertyNameStr)); info.LoadFromData(propertyNameStr, dataNode, nodePropDictionary); info.LoadFromData(nodePropDictionary[propertyNameStr], dataNode); Add(info); } } }
protected virtual void OnInitialize() { _typeResolver = new AndroidFrameworkTypeResolver(this); _loggingProvider = new DefaultLoggingProvider(); _resourcesProvider = new AndroidResourcesProvider(this); _synchronizationProvider = new AndroidSynchronizationProvider(); _navigationProvider = new AndroidNavigationProvider(_typeResolver, _synchronizationProvider, _resourcesProvider); }
protected virtual void OnInitialize() { _typeResolver = new iOSFrameworkTypeResolver(); _loggingProvider = new DefaultLoggingProvider(); _resourcesProvider = new iOSResourcesProvider(); _synchronizationProvider = new iOSSynchronizationProvider(this); _navigationProvider = new iOSNavigationProvider(NavigationController, _typeResolver, new PlatformProviders(GetNavigationProvider, _synchronizationProvider, _resourcesProvider)); }
private void Initialize(IJobStore jobStore, ISettingsProvider settingsProvider, ILoggingProvider loggingProvider) { this.jobStore = jobStore; this.logger = loggingProvider; this.settings = settingsProvider; this.jobStore.JobActionRequired += new EventHandler <JobActionRequiredEventArgs>(jobStore_JobActionRequired); this.jobStore.JobDeleted += new EventHandler <JobActionRequiredEventArgs>(jobStore_JobDeleted); }
public static AnimationGroupList InitAnimationGroups(ILoggingProvider logger) { AnimationGroupList animationList = new AnimationGroupList(); animationList.LoadFromData(Loader.Core.RootNode); if (animationList.Count > 0) { int timelineStart = Loader.Core.AnimRange.Start / Loader.Global.TicksPerFrame; int timelineEnd = Loader.Core.AnimRange.End / Loader.Global.TicksPerFrame; List <string> warnings = new List <string>(); foreach (AnimationGroup animGroup in animationList) { // ensure min <= start <= end <= max warnings.Clear(); if (animGroup.FrameStart < timelineStart || animGroup.FrameStart > timelineEnd) { warnings.Add("Start frame '" + animGroup.FrameStart + "' outside of timeline range [" + timelineStart + ", " + timelineEnd + "]. Set to timeline start time '" + timelineStart + "'"); animGroup.FrameStart = timelineStart; } if (animGroup.FrameEnd < timelineStart || animGroup.FrameEnd > timelineEnd) { warnings.Add("End frame '" + animGroup.FrameEnd + "' outside of timeline range [" + timelineStart + ", " + timelineEnd + "]. Set to timeline end time '" + timelineEnd + "'"); animGroup.FrameEnd = timelineEnd; } if (animGroup.FrameEnd <= animGroup.FrameStart) { if (animGroup.FrameEnd < animGroup.FrameStart) { // Strict warnings.Add("End frame '" + animGroup.FrameEnd + "' lower than Start frame '" + animGroup.FrameStart + "'. Start frame set to timeline start time '" + timelineStart + "'. End frame set to timeline end time '" + timelineEnd + "'."); } else { // Equal warnings.Add("End frame '" + animGroup.FrameEnd + "' equal to Start frame '" + animGroup.FrameStart + "'. Single frame animation are not allowed. Start frame set to timeline start time '" + timelineStart + "'. End frame set to timeline end time '" + timelineEnd + "'."); } animGroup.FrameStart = timelineStart; animGroup.FrameEnd = timelineEnd; } // Print animation group warnings if any // Nothing printed otherwise if (warnings.Count > 0) { logger.RaiseWarning(animGroup.Name, 1); foreach (string warning in warnings) { logger.RaiseWarning(warning, 2); } } } } return(animationList); }
internal EventTrace(ILoggingProvider provider) { _provider = provider; // Set up a memory logger if the provider allows _loggerName = provider.AttachMemoryLogger(); _disposed = false; }
internal EventTrace(ILoggingProvider provider) { _provider = provider; // Set up a memory logger if the provider allows _loggerName = provider.AttachMemoryLogger(); _disposed = false; }
public static ILoggingProvider CreateInstance() { if (_instance == null) { _instance = new MiniLog(); } return(_instance); }
public ParticipateController( IJourneyService journeyService, ILoggingProvider logger, ISiteService siteService) { _journeyService = journeyService; _logger = logger; _siteService = siteService; }
/// <summary> /// Initialises a new instance of the /// <see cref="OutputFileGenerator" /> class. /// </summary> /// <param name="fileSystemProvider"> /// An instance of <see cref="IFileSystemProvider" />. /// </param> /// <param name="instanceScanner"> /// An instance of <see cref="IInstanceScanner" />. /// </param> /// <param name="loggingProvider"> /// An instance of <see cref="ILoggingProvider" />. /// </param> public OutputFileGenerator( IFileSystemProvider fileSystemProvider, IInstanceScanner instanceScanner, ILoggingProvider loggingProvider) { this.fileSystemProvider = fileSystemProvider; this.instanceScanner = instanceScanner; this.loggingProvider = loggingProvider; }
public LegalController( IConfigurationProvider configProvider, ILegalService legalService, ILoggingProvider logger) { _configProvider = configProvider; _legalService = legalService; _logger = logger; }
public ValidationService( ILoggingProvider logger, IParticipationRepository participationRepository, IFormValidatorProvider validator) { _logger = logger; _participationRepository = participationRepository; _validator = validator; }
public BankAccountRightSidebarViewModel( ILoggingProvider log, IMessenger messenger) : base(log) { _messenger = messenger; AddBankAccount = new RelayCommand(execute: OnAddBankAccountButtonClick); }
protected virtual void OnInitialize(IActivatedEventArgs args) { _loggingProvider = new DefaultLoggingProvider(); _synchronization = new SynchronizationProvider(); _resources = new WindowsRuntimeResourcesProvider(ResourceLoader.GetForViewIndependentUse(Constants.StoreAppsInfrastructureResourceMapId)); _typeResolver = new DefaultMvvmTypeResolver(); _lifecycleProvider = new UwpLifecycleProvider(_typeResolver, _synchronization, _resources); _navigationProvider = CreateNavigationManager(Window.Current, _typeResolver, _synchronization, _resources); }
public bool doStuff(object state, ILoggingProvider logger) { var successful = false; logger.LogMessage(GetStartLogMessage(), LoggingCategory.Task); successful = ResourceOperations.SaveToFileSystem(Descriptor, ExportPath); logger.LogMessage(GetEndLogMessage(successful), LoggingCategory.Task); return(successful); }
/// <summary> /// Initializes a new instance of the <see cref="CacheProvider{TResult}"/> class. /// </summary> /// <param name="distributedCache">The cache from which to get the data.</param> /// <param name="loggingProvider">Provides the contract to logging <see cref="AsyncCachePolicy{TResult}"/> operations</param> public CacheProvider( IDistributedCache distributedCache, ILoggingProvider <TResult> loggingProvider) { distributedCache.ThrowIfNull(nameof(distributedCache)); loggingProvider.ThrowIfNull(nameof(loggingProvider)); this.distributedCache = distributedCache; this.loggingProvider = loggingProvider; }
public AuthenticationEcommerceManager( ICacheProvider cacheProvider, ILoggingProvider logger, IConfiguration configuration) { _cacheProvider = cacheProvider; _logger = logger; _configuration = configuration; _helper = new AuthenticationHelper(configuration); }
public void DetachProvider <T>() where T : ILoggingProvider, new() { if (!_providers.ContainsKey(typeof(T))) { return; } ILoggingProvider provider = _providers[typeof(T)]; provider.Detach(this); }
/// <summary> /// Initializes a new instance of the <see cref="Linq2SqlJobStore"/> class. /// </summary> /// <param name="settingsProvider">The settings provider.</param> /// <param name="loggingProvider">The logging provider.</param> /// <param name="jobStoreSettingsProvider">The job store settings provider.</param> public Linq2SqlJobStore(ISettingsProvider settingsProvider, ILoggingProvider loggingProvider, ILinq2SqlJobStoreSettingsProvider jobStoreSettingsProvider) { connectionString = jobStoreSettingsProvider.ConnectionString; randomizer = new Random((int)DateTime.Now.TimeOfDay.TotalSeconds); logger = loggingProvider; settings = settingsProvider; eventFireWorker.DoWork += new DoWorkEventHandler(eventFireWorker_DoWork); eventFireWorker.RunWorkerAsync(); }
public IEnumerable <string> GetAllLogs() { ILoggingProvider loggingProvider = QuartzAPI.ConfigurationBuilder.GetLoggingProvider(); if (loggingProvider != null) { return(loggingProvider.GetLogs()); } throw new HttpResponseException(HttpStatusCode.InternalServerError); }
/// <summary> /// /// </summary> /// <param name="prov"></param> /// <param name="level"></param> private void AddLogprovider(ILoggingProvider prov, params LogLevel[] level) { foreach (LogLevel lvl in level) { if (!LogProvider.ContainsKey(lvl)) { LogProvider[lvl] = new List <ILoggingProvider>(); } LogProvider[lvl].Add(prov); } }
/// <summary> /// Resolves the Logging Provider for the current application /// </summary> private static void ResolveLoggingProvider() { // TODO: resolve provider through configuration // Try Log4net by default. Fail back to built in trace if log4net is not available. try { loggingProvider = new Log4NetProvider(); } catch (Exception) { loggingProvider = new DefaultProvider(); } }
protected virtual void Dispose(bool disposing) { if (!_disposed) { if (disposing) { _provider.DetatchMemoryLogger(_loggerName); } _provider = null; _disposed = true; } }
//private readonly IConfigurationProvider _configProvider; public LegalService ( IParticipationService votingService, ILoggingProvider logger, ICrmConsumerProvider crmProvider //IConfigurationProvider configProvider ) { _votingService = votingService; _logger = logger; _crmProvider = crmProvider; //_configProvider = configProvider; }
private Supervisor() { try { _LoggingProvider = new TraceListenerLoggingProvider(); try { _ConfigurationManager = new ConfigurationManager(); _TelemetryManager = new TelemetryManager(); _StateManager = new StateManager(); _TimeManager = new TimeManager(); _RequestManager = new RequestManager(); _WorkManager = new WorkManager(); } catch (Exception ex2) { try { _LoggingProvider.WriteEntry(string.Format("{0} [Critical startup error.]", ex2.Message), TraceEventType.Critical); } catch (Exception ex3) { Console.WriteLine("Could not write to the error log."); Console.WriteLine("* {0}", ex3.Message); } throw; } } catch (Exception ex1) { Console.WriteLine("Could not initialize logging subsystem."); Console.WriteLine("* {0}", ex1.Message); throw; } }
/// <summary> /// Initializes a new instance of the <see cref="EventBroker" class./> /// </summary> /// <param name="loggingProvider">The <see cref="ILoggingProvider"/> instance to use.</param> public EventBroker(ILoggingProvider loggingProvider = null) : base() { this.loggingProvider = loggingProvider; }
protected virtual void OnInitialize() { _loggingProvider = new DefaultLoggingProvider(); _typeResolver = new WpfFrameworkTypeResolver(); _navigationProvider = new WpfNavigationProvider(RootNavigationService, _typeResolver, _synchronization, _resources); }
public void UseLogProvider(ILoggingProvider loggingProvider) { _loggingProvider = loggingProvider; }