static void RegisterLogging(IEnvironmentInformation environment, ContainerBuilder builder) { if (!environment.GetIsInDesignTime()) { var logPath = !environment.GetIsDebugging() && environment.GetIsRunningDeveloperVersion() ? Path.GetTempFileName() : FileManager.GetFullPathFromTemporaryPath("Shapeshifter.log"); Log.Logger = new LoggerConfiguration() .MinimumLevel.Verbose() .Enrich.WithProperty("ProcessId", Process.GetCurrentProcess().Id) .Enrich.FromLogContext() .WriteTo.Debug( outputTemplate: "{Timestamp:HH:mm:ss.fff} [{Level:u3}] {Message:lj} ({SourceContext:l}){NewLine}{Exception}") .WriteTo.File( logPath, restrictedToMinimumLevel: LogEventLevel.Verbose, fileSizeLimitBytes: int.MaxValue, rollOnFileSizeLimit: false, rollingInterval: RollingInterval.Day, retainedFileCountLimit: 2, shared: true, outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff} [#{ProcessId}] [{SourceContext:l}] [{Level:u3}]{NewLine}{Message:lj}{NewLine}{Exception}{NewLine}") .WriteTo.Sink(new IssueReporterSink(environment)) .CreateLogger(); } builder.RegisterLogger(autowireProperties: true); }
public BitmapClipboardDataControlFactory( IDataSourceService dataSourceService, IEnvironmentInformation environmentInformation) { this.dataSourceService = dataSourceService; this.environmentInformation = environmentInformation; }
internal RegistrationManager( IRegistrationContext registrationContext, IModuleManager moduleManager, IPublicRegistrationService publicRegistrationService, ISdkInformation sdkInformation, IEnvironmentInformation environmentInformation, IServiceContext serviceContext, ISecureRegistrationService secureRegistrationService, IConfigurationManager configurationManager, IEventBus eventBus, IRefreshToken tokenRefresher, ILogger logger, IJsonSerialiser serialiser) { _registrationContext = registrationContext; _moduleManager = moduleManager; _publicRegistrationService = publicRegistrationService; _sdkInformation = sdkInformation; _environmentInformation = environmentInformation; _serviceContext = serviceContext; _secureRegistrationService = secureRegistrationService; _configurationManager = configurationManager; _eventBus = eventBus; _tokenRefresher = tokenRefresher; _logger = logger; _serialiser = serialiser; }
public MainWindow( IMainViewModel viewModel, IMainWindowHandleContainer handleContainer, IEnvironmentInformation environmentInformation, ILogger logger) { this.handleContainer = handleContainer; this.logger = logger; this.viewModel = viewModel; Left = int.MinValue; Top = int.MinValue; Width = 1; Height = 1; SourceInitialized += MainWindow_SourceInitialized; InitializeComponent(); SetupViewModel(); if (environmentInformation.GetIsDebugging()) { Background = Brushes.Transparent; } }
public AnalyticsManager(INotificationManager notificationManager, IEnvironmentInformation environmentInformation, IPersistentStorage persistentStorage, IRegistrationController registrationController) { _notificationManager = notificationManager; _environmentInformation = environmentInformation; _persistentStorage = persistentStorage; _registrationController = registrationController; }
public ClipboardTextDataViewModel( IEnvironmentInformation environmentInformation) { if (environmentInformation.IsInDesignTime) { PrepareDesignMode(); } }
public ClipboardFileCollectionDataViewModel( IEnvironmentInformation environmentInformation) { if (environmentInformation.IsInDesignTime) { PrepareDesignerMode(); } }
public ClipboardFileDataViewModel( IEnvironmentInformation environmentInformation) { if (environmentInformation.GetIsInDesignTime()) { PrepareDesignerMode(); } }
public ApiToken(string apiKey, IEnvironmentInformation environmentInformation, string userkey) { _environmentInformation = environmentInformation; ApiKey = apiKey; UserKey = userkey; }
public IssueReporterSink(IEnvironmentInformation environmentInformation) { logHistory = new LinkedList <string>(); restClient = new RestClient(); reportingSemaphore = new SemaphoreSlim(1); this.environmentInformation = environmentInformation; }
public NamedPipeInstanceCommunicationService([KeyFilter(CommunicationConstants.MessageSenderContainerKey)] IContainer messageSenderContainer, ILog log, StreamFactory streamFactory, IEnvironmentInformation environmentInformation, CancellationToken cancellationToken) { this.messageSenderContainer = messageSenderContainer; this.log = log; this.streamFactory = streamFactory; this.environmentInformation = environmentInformation; this.cancellationToken = cancellationToken; }
public PostPreparationOperation( IUpdateService updateService, IEnvironmentInformation environmentInformation, ITrayPreparationOperation trayPreparationOperation) { this.updateService = updateService; this.environmentInformation = environmentInformation; this.trayPreparationOperation = trayPreparationOperation; }
public DefaultArgumentProcessor( IProcessManager processManager, IInstallWindow installWindow, IEnvironmentInformation environmentInformation) { this.processManager = processManager; this.installWindow = installWindow; this.environmentInformation = environmentInformation; }
public DefaultArgumentProcessor( IInstallWindow installWindow, IEnvironmentInformation environmentInformation, IMaintenanceWindow maintenanceWindow, IUpdateService updateService) { this.installWindow = installWindow; this.environmentInformation = environmentInformation; this.maintenanceWindow = maintenanceWindow; this.updateService = updateService; }
public InterProcessUpdateReceiver(IEnvironmentInformation environmentInformation, StreamFactory streamFactory, ILog log, ICommunicationProtocol externalProtocol, IMessageParser messageParser) { serverName = environmentInformation.InterProcessServerNameBase + environmentInformation.CurrentProcessId.ToString("D", CultureInfo.InvariantCulture); this.streamFactory = streamFactory; this.log = log; this.externalProtocol = externalProtocol; this.messageParser = messageParser; messageParser.HandshakeCompleted += MessageParserOnHandshakeCompleted; StartAndWaitForInterProcessUpdate(); }
public PushMessagingManager(IJsonSerialiser serialiser, ICommonMessagingManager commonMessagingManager, IDonkyCore donkyCore, INotificationManager notificationManager, IEnvironmentInformation environmentInformation, IPushDataContext pushDataContext, IDeviceInteraction deviceInteraction) { _serialiser = serialiser; _commonMessagingManager = commonMessagingManager; _donkyCore = donkyCore; _notificationManager = notificationManager; _environmentInformation = environmentInformation; _pushDataContext = pushDataContext; _deviceInteraction = deviceInteraction; _donkyCore.SubscribeToLocalEvent<AppOpenEvent>(HandleAppOpen); }
private IEnvironmentInformation CreateEnvironmentInformation() { IEnvironmentInformation environmentInformationService = Substitute.For <IEnvironmentInformation>(); if (withUpdateEnabled) { environmentInformationService.InterProcessServerNameBase.Returns(interProcessServerName); environmentInformationService.CurrentProcessId.Returns(13); } return(environmentInformationService); }
public InstallArgumentProcessor( IProcessManager processManager, ICertificateManager certificateManager, ISignHelper signHelper, IEnvironmentInformation environmentInformation, ISettingsViewModel settingsViewModel) { this.processManager = processManager; this.certificateManager = certificateManager; this.signHelper = signHelper; this.environmentInformation = environmentInformation; this.settingsViewModel = settingsViewModel; }
public SourceClipboardQuantityOverlayViewModel( IScreenManager screenManager, IThreadDelay threadDelay, IEnvironmentInformation environmentInformation, IMainViewModel mainViewModel) { this.screenManager = screenManager; this.threadDelay = threadDelay; this.environmentInformation = environmentInformation; this.mainViewModel = mainViewModel; SetupEvents(); }
public UpdateService( IDownloader fileDownloader, IFileManager fileManager, IProcessManager processManager, IEnvironmentInformation environmentInformation, ILogger logger) { client = CreateClient(); this.fileDownloader = fileDownloader; this.fileManager = fileManager; this.processManager = processManager; this.environmentInformation = environmentInformation; this.logger = logger; }
public UpdateService( IDownloader fileDownloader, IFileManager fileManager, IProcessManager processManager, ILogger logger, IGitHubClientFactory clientFactory, IEnvironmentInformation environmentInformation) { client = clientFactory.CreateClient(); this.fileDownloader = fileDownloader; this.fileManager = fileManager; this.processManager = processManager; this.logger = logger; this.environmentInformation = environmentInformation; }
static void RegisterLogStream(IEnvironmentInformation environment, ContainerBuilder builder) { if (!environment.GetIsDebugging()) { builder .RegisterType <FileLogStream>() .AsImplementedInterfaces() .SingleInstance(); } else { builder .RegisterType <DebugLogStream>() .AsImplementedInterfaces() .SingleInstance(); } }
public InstallArgumentProcessor( IProcessManager processManager, ICertificateManager certificateManager, ISignHelper signHelper, IEnvironmentInformation environmentInformation, ISettingsViewModel settingsViewModel, IKeyboardDominanceWatcher keyboardDominanceWatcher, IThreadDelay threadDelay) { this.processManager = processManager; this.certificateManager = certificateManager; this.signHelper = signHelper; this.environmentInformation = environmentInformation; this.settingsViewModel = settingsViewModel; this.keyboardDominanceWatcher = keyboardDominanceWatcher; this.threadDelay = threadDelay; }
public InstallArgumentProcessor( IProcessManager processManager, ICertificateManager certificateManager, ISignHelper signHelper, IEnvironmentInformation environmentInformation, ISettingsViewModel settingsViewModel, IThreadDelay threadDelay, ITrayIconManager trayIconManager) { this.processManager = processManager; this.certificateManager = certificateManager; this.signHelper = signHelper; this.environmentInformation = environmentInformation; this.settingsViewModel = settingsViewModel; this.threadDelay = threadDelay; this.trayIconManager = trayIconManager; }
public MainWindow( IMainViewModel viewModel, IMainWindowHandleContainer handleContainer, IEnvironmentInformation environmentInformation) { this.handleContainer = handleContainer; this.viewModel = viewModel; SourceInitialized += MainWindow_SourceInitialized; InitializeComponent(); SetupViewModel(); if (environmentInformation.GetIsDebugging()) { Background = Brushes.Transparent; } }
protected virtual IEnumerable<AirbrakeVar> BrowserData(IExceptionInformation exInfo, IEnvironmentInformation envInfo) { if (HttpRequest.Browser == null) return Enumerable.Empty<AirbrakeVar>(); return new[] { new AirbrakeVar("Browser.Browser", HttpRequest.Browser.Browser), new AirbrakeVar("Browser.ClrVersion", HttpRequest.Browser.ClrVersion), new AirbrakeVar("Browser.Cookies", HttpRequest.Browser.Cookies), new AirbrakeVar("Browser.Crawler", HttpRequest.Browser.Crawler), new AirbrakeVar("Browser.EcmaScriptVersion", HttpRequest.Browser.EcmaScriptVersion), new AirbrakeVar("Browser.JavaApplets", HttpRequest.Browser.JavaApplets), new AirbrakeVar("Browser.MajorVersion", HttpRequest.Browser.MajorVersion), new AirbrakeVar("Browser.MinorVersion", HttpRequest.Browser.MinorVersion), new AirbrakeVar("Browser.Platform", HttpRequest.Browser.Platform), new AirbrakeVar("Browser.W3CDomVersion", HttpRequest.Browser.W3CDomVersion) }; }
public UpdateService( IDownloader fileDownloader, IFileManager fileManager, IProcessManager processManager, ILogger logger, IGitHubClientFactory clientFactory, IEnvironmentInformation environmentInformation, ISettingsManager settingsManager, IMaintenanceWindow maintenanceWindow) { client = clientFactory.CreateClient(); this.fileDownloader = fileDownloader; this.fileManager = fileManager; this.processManager = processManager; this.logger = logger; this.environmentInformation = environmentInformation; this.settingsManager = settingsManager; this.maintenanceWindow = maintenanceWindow; }
static void RegisterLogging(IEnvironmentInformation environment, ContainerBuilder builder) { builder .RegisterType <Logger>() .PropertiesAutowired(new PropertySelector(), true) .AsImplementedInterfaces() .SingleInstance(); if (!environment.GetIsDebugging()) { builder .RegisterType <FileLogStream>() .PropertiesAutowired(new PropertySelector(), true) .AsImplementedInterfaces() .SingleInstance(); } else { builder .RegisterType <DebugLogStream>() .AsImplementedInterfaces() .SingleInstance(); } }
protected override IEnumerable<AirbrakeVar> Params(IExceptionInformation exInfo, IEnvironmentInformation envInfo) { return BuildVars(HttpRequest.Params); }
protected override IEnumerable<AirbrakeVar> Session(IExceptionInformation exInfo, IEnvironmentInformation envInfo) { return BuildVars(HttpContext.Session); }
protected override string Url(IExceptionInformation exInfo, IEnvironmentInformation envInfo) { return HttpRequest.Url.ToString(); }
protected override IEnumerable<AirbrakeVar> CgiData(IExceptionInformation exInfo, IEnvironmentInformation envInfo) { return EnvironmentData(exInfo, envInfo). Concat(HeadersData(exInfo, envInfo)). Concat(CookiesData(exInfo, envInfo)). Concat(BrowserData(exInfo, envInfo)); }
public ClipboardFileCollectionDataControlFactory( IEnvironmentInformation environmentInformation) { this.environmentInformation = environmentInformation; }
/// <summary> /// Initializes a new client using basic HTTP authentication and non-default dependencies /// </summary> /// <param name="subdomain">The subdomain of the harvest account to connect to</param> /// <param name="username">The username to authenticate with</param> /// <param name="password">The password to authenticate with</param> public HarvestRestClient(string subdomain, string username, string password, IAssemblyInformation assemblyInformation, IEnvironmentInformation environmentInformation, IRestSharpFactory restSharpFactory) : this(subdomain, username, password, null, null, null, null, assemblyInformation, environmentInformation, restSharpFactory) { }
protected virtual IEnumerable<AirbrakeVar> EnvironmentData(IExceptionInformation exInfo, IEnvironmentInformation envInfo) { return new[] { new AirbrakeVar("Environment.MachineName", Environment.MachineName), new AirbrakeVar("Environment.OSversion", Environment.OSVersion), new AirbrakeVar("Environment.Version", Environment.Version) }; }
/// <summary> /// Creates a <see cref="AirbrakeError"/> from the the specified exception. /// </summary> /// <param name="exInfo"></param> /// <param name="envInfo"></param> /// <returns> /// A <see cref="AirbrakeError"/>, created from the the specified exception. /// </returns> protected AirbrakeError Error(IExceptionInformation exInfo, IEnvironmentInformation envInfo) { var error = Activator.CreateInstance<AirbrakeError>(); error.CatchingMethod = exInfo.CatchingMethod; error.Class = exInfo.ExceptionClass.FullName; error.Message = exInfo.Message; error.Backtrace = exInfo.TraceLines.ToArray(); return error; }
/// <summary> /// Initializes a new instance of the <see cref="GlobalContext"/> class. /// </summary> /// <param name="environment">os specific environment information</param> /// <param name="operatingSystem">os specific information</param> /// <param name="process">process information</param> public GlobalContext(IEnvironmentInformation environment, IOperatingSystemInformation operatingSystem, IProcessInformation process) { this.Environment = environment; this.OperatingSystem = operatingSystem; this.Process = process; }
protected virtual AirbrakeRequest Request(IExceptionInformation exInfo, IEnvironmentInformation envInfo) { return new AirbrakeRequest(envInfo.Uri, exInfo.CatchingFile, exInfo.CatchingMethod.Name) { Url = Url(exInfo, envInfo), CgiData = CgiData(exInfo, envInfo).ToArray(), Params = Params(exInfo, envInfo).ToArray(), Session = Session(exInfo, envInfo).ToArray() }; }
protected virtual IEnumerable<AirbrakeVar> Session(IExceptionInformation exInfo, IEnvironmentInformation envInfo) { return Enumerable.Empty<AirbrakeVar>(); }
protected virtual string Url(IExceptionInformation exInfo, IEnvironmentInformation envInfo) { return exInfo.CatchingFile; }
public DefaultWiringModule( IEnvironmentInformation environmentInformation) { this.environmentInformation = environmentInformation; }
public ClipboardImageDataControlFactory( IEnvironmentInformation environmentInformation) { this.environmentInformation = environmentInformation; }
protected virtual IEnumerable<AirbrakeVar> HeadersData(IExceptionInformation exInfo, IEnvironmentInformation envInfo) { return BuildVars(HttpRequest.Headers); }
public SecureRegistrationService(IRegistrationContext registrationContext, IServiceContext serviceContext, IEnvironmentInformation environmentInformation, ISdkInformation sdkInformation, IHttpClient httpClient, IConfigurationManager configurationManager) : base(registrationContext, serviceContext, environmentInformation, sdkInformation, httpClient, configurationManager) { }
public ClipboardTextDataControlFactory( IEnvironmentInformation environmentInformation) { this.environmentInformation = environmentInformation; }
/// <summary> /// Constructs a client for executing all api commands. /// </summary> /// <param name="subdomain">The harvest account subdomain</param> /// <param name="username">The harvest account username (optional for OAuth)</param> /// <param name="password">The harvest account password (optional for OAuth)</param> /// <param name="clientId">The harvest account client OAuth ID (optional for basic auth)</param> /// <param name="clientSecret">The harvest account client OAuth secret (optional for basic auth)</param> /// <param name="accessToken">The harvest account OAuth token (optional for basic auth)</param> /// <param name="dateFormat">The date format of the harvest account (default: yyyy-MM-dd)</param> private HarvestRestClient(string subdomain, string username, string password, string clientId, string clientSecret, string accessToken, string dateFormat, IAssemblyInformation assemblyInformation, IEnvironmentInformation environmentInformation, IRestSharpFactory restSharpFactory) { this.Username = username; this.Password = password; this.ClientId = clientId; this.ClientSecret = clientSecret; this.AccessToken = accessToken; this.DateFormat = dateFormat ?? "yyyy-MM-dd"; this.BaseUrl = "https://" + subdomain + ".harvestapp.com/"; var assemblyVersion = assemblyInformation.Version; var environmentVersion = environmentInformation.Version; var userAgent = string.Format("harvest.net/{0} (.NET {1})", assemblyVersion, environmentVersion); if (username != null && password != null) { _client = restSharpFactory.GetWebClient(BaseUrl, userAgent, username, password); } else if (accessToken != null) { _client = restSharpFactory.GetWebClient(BaseUrl, userAgent, accessToken); } else { _client = restSharpFactory.GetWebClient(BaseUrl, userAgent); } }
/// <summary> /// Initializes a new instance of the <see cref="T:ChilliSource.Mobile.Logging.ApplicationInformationEnricher"/> class. /// </summary> /// <param name="information"><see cref="IEnvironmentInformation"/> implementation holding app information to be logged.</param> /// <param name="userKeyRetriever">Function to retrieve the user key for API authentication.</param> public ApplicationInformationEnricher(IEnvironmentInformation information, Func <string> userKeyRetriever = null) { _information = information; _userKeyRetriever = userKeyRetriever; }