Beispiel #1
0
 public RToolsSettingsImplementation(ICoreShell coreShell, ISettingsStorage settingStorage, ILoggingPermissions loggingPermissions)
 {
     _coreShell          = coreShell;
     _settingStorage     = settingStorage;
     _loggingPermissions = loggingPermissions;
     _workingDirectory   = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
 }
Beispiel #2
0
 internal Logger(string name, string folder, ILoggingPermissions permissions)
 {
     _name        = name;
     _permissions = permissions;
     _logs        = Lazy.Create(CreateLogs);
     Folder       = folder;
 }
Beispiel #3
0
 public Logger(string name, string folder, IServiceContainer services)
 {
     _name        = name;
     _permissions = services.GetService <ILoggingPermissions>();
     _logs        = Lazy.Create(CreateLogs);
     Folder       = folder;
 }
Beispiel #4
0
 public RSettingsImplementation(IServiceContainer services)
 {
     _services           = services;
     _settingStorage     = services.GetService <ISettingsStorage>();
     _loggingPermissions = services.GetService <ILoggingPermissions>();
     _workingDirectory   = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
 }
Beispiel #5
0
 public static ICoreServices CreateSubstitute(ILoggingPermissions loggingPermissions = null, IFileSystem fs = null, IRegistry registry = null, IProcessServices ps = null)
 {
     return(new CoreServices(
                Substitute.For <ITelemetryService>(),
                loggingPermissions,
                Substitute.For <ISecurityService>(),
                Substitute.For <ITaskService>(),
                UIThreadHelper.Instance,
                Substitute.For <IActionLog>(),
                fs ?? Substitute.For <IFileSystem>(),
                ps ?? Substitute.For <IProcessServices>()));
 }
Beispiel #6
0
 public static ICoreServices CreateSubstitute(ILoggingPermissions loggingPermissions = null, IFileSystem fs = null, IRegistry registry = null, IProcessServices ps = null) {
     return new CoreServices(
         Substitute.For<IApplicationConstants>(),
         Substitute.For<ITelemetryService>(),
         loggingPermissions,
         Substitute.For<ISecurityService>(),
         Substitute.For<ITaskService>(),
         UIThreadHelper.Instance,
         Substitute.For<IActionLog>(),
         fs ?? Substitute.For<IFileSystem>(),
         registry ?? Substitute.For<IRegistry>(),
         ps ?? Substitute.For<IProcessServices>());
 }
Beispiel #7
0
        public CoreServices(IApplicationConstants appConstants
                            , ITelemetryService telemetry
                            , ITaskService tasks
                            , IProcessServices processServices
                            , ILoggingPermissions loggingPermissions
                            , IMainThread mainThread
                            , ISecurityService security)
        {
            LoggingPermissions = loggingPermissions;
            Telemetry          = telemetry;
            Security           = security;
            Tasks = tasks;

            ProcessServices = processServices;
            FileSystem      = new FileSystem();
            MainThread      = mainThread;

            Log = new Logger(appConstants.ApplicationName, Path.GetTempPath(), LoggingPermissions);
        }
Beispiel #8
0
 private void AddBasicServices(IActionLog log = null
                               , ILoggingPermissions loggingPermissions = null
                               , IFileSystem fs      = null
                               , IRegistry registry  = null
                               , IProcessServices ps = null)
 {
     ServiceManager
     .AddService(UIThreadHelper.Instance)
     .AddService(log ?? Substitute.For <IActionLog>())
     .AddService(new SecurityServiceStub())
     .AddService(loggingPermissions ?? Substitute.For <ILoggingPermissions>())
     .AddService(fs ?? new WindowsFileSystem())
     .AddService(registry ?? new RegistryImpl())
     .AddService(ps ?? new ProcessServices())
     .AddService(new TestTaskService())
     .AddService(new TestUIServices())
     .AddService(new TestImageService())
     .AddService(new TestPlatformServices());
 }
Beispiel #9
0
        public CoreServices(ITelemetryService telemetry
                            , ILoggingPermissions permissions
                            , ISecurityService security
                            , ITaskService tasks
                            , IMainThread mainThread
                            , IActionLog log
                            , IFileSystem fs
                            , IProcessServices ps)
        {
            LoggingPermissions = permissions;
            Log = log;

            Telemetry = telemetry;
            Security  = security;
            Tasks     = tasks;

            Process    = ps;
            FileSystem = fs;
            MainThread = mainThread;
        }
Beispiel #10
0
        public CoreServices(
            IApplicationConstants appConstants
            , ITelemetryService telemetry
            , ILoggingPermissions permissions
            , ISecurityService security
            , [Import(AllowDefault = true)] IActionLog log      = null
            , [Import(AllowDefault = true)] IFileSystem fs      = null
            , [Import(AllowDefault = true)] IRegistry registry  = null
            , [Import(AllowDefault = true)] IProcessServices ps = null)
        {
            LoggingServices = new LoggingServices(permissions, appConstants);
            _appConstants   = appConstants;
            _log            = log;

            Telemetry       = telemetry;
            Security        = security;
            ProcessServices = ps ?? new ProcessServices();
            Registry        = registry ?? new RegistryImpl();
            FileSystem      = fs ?? new FileSystem();
        }
Beispiel #11
0
        public CoreServices(IApplicationConstants appConstants
            , ITelemetryService telemetry
            , ILoggingPermissions permissions
            , ISecurityService security
            , ITaskService tasks
            , IMainThread mainThread
            , IActionLog log
            , IFileSystem fs
            , IRegistry registry
            , IProcessServices ps) {

            LoggingServices = new LoggingServices(permissions, appConstants);
            Log = log;

            Telemetry = telemetry;
            Security = security;
            Tasks = tasks;

            ProcessServices = ps;
            Registry = registry;
            FileSystem = fs;
            MainThread = mainThread;
        }
Beispiel #12
0
 private void AddBasicServices(IActionLog log = null
                               , ILoggingPermissions loggingPermissions = null
                               , IFileSystem fs      = null
                               , IRegistry registry  = null
                               , IProcessServices ps = null)
 {
     ServiceManager
     .AddService(this)
     .AddService(UIThreadHelper.Instance.MainThread)
     .AddService(log ?? Substitute.For <IActionLog>())
     .AddService(new SecurityServiceStub())
     .AddService(loggingPermissions ?? Substitute.For <ILoggingPermissions>())
     .AddService(fs ?? new WindowsFileSystem())
     .AddService <IOutputService, TestOutputService>()
     .AddService(registry ?? new RegistryImpl())
     .AddService(ps ?? new WindowsProcessServices())
     .AddService(UIThreadHelper.Instance.TaskService)
     .AddService(new TestUIServices(UIThreadHelper.Instance.ProgressDialog))
     .AddService(new TestImageService())
     .AddService(new TestPlatformServices())
     .AddService(new TestApplication())
     .AddService(new TestIdleTimeService());
 }
Beispiel #13
0
 public SendMailCommand(Guid group, int id, ILoggingPermissions permissions, ICoreServices services) :
     base(group, id)
 {
     _permissions = permissions;
     Services     = services;
 }
Beispiel #14
0
 internal Logger(string appName, ILoggingPermissions permissions, IActionLogWriter writer) {
     _appName = appName;
     _permissions = permissions;
     _writer = writer;
 }
Beispiel #15
0
 public FeedbackCommandTest()
 {
     _lp       = Substitute.For <ILoggingPermissions>();
     _services = TestCoreServices.CreateSubstitute();
 }
Beispiel #16
0
 public ReportIssueCommand(ICoreServices services)
     : base(RGuidList.RCmdSetGuid, RPackageCommandId.icmdReportIssue)
 {
     _permissions = services.LoggingPermissions;
     _pss         = services.ProcessServices;
 }
Beispiel #17
0
 public FeedbackCommandTest() {
     _lp = Substitute.For<ILoggingPermissions>();
     _services = TestCoreServices.CreateSubstitute(_lp);
 }
Beispiel #18
0
 public ReportIssueCommand(IServiceContainer services)
     : base(RGuidList.RCmdSetGuid, RPackageCommandId.icmdReportIssue)
 {
     _permissions = services.GetService <ILoggingPermissions>();
     _pss         = services.GetService <IProcessServices>();
 }
Beispiel #19
0
 public ReportIssueCommand(ILoggingPermissions permissions, IProcessServices pss)
     : base(RGuidList.RCmdSetGuid, RPackageCommandId.icmdReportIssue)
 {
     _permissions = permissions;
     _pss         = pss;
 }
Beispiel #20
0
 internal Logger(IActionLogWriter defaultWriter, ILoggingPermissions permissions)
 {
     _writer      = defaultWriter;
     _permissions = permissions;
     _logs        = Lazy.Create(CreateLogs);
 }
Beispiel #21
0
 public SendFrownCommand(ILoggingPermissions permissions, ICoreServices services) :
     base(RGuidList.RCmdSetGuid, RPackageCommandId.icmdSendFrown, permissions, services)
 {
 }
Beispiel #22
0
 internal Logger(string appName, ILoggingPermissions permissions, IActionLogWriter writer)
 {
     _appName     = appName;
     _permissions = permissions;
     _writer      = writer;
 }
 public RToolsSettingsImplementation(ISettingsStorage settings, ICoreShell coreShell) {
     _settings = settings;
     _loggingPermissions = coreShell.Services.LoggingServices.Permissions;
     _workingDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
 }
 public RToolsSettingsImplementation(ISettingsStorage settings, ICoreShell coreShell)
 {
     _settings           = settings;
     _loggingPermissions = coreShell.Services.LoggingPermissions;
     _workingDirectory   = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
 }
Beispiel #25
0
 public ReportIssueCommand(ICoreServices services)
     : base(RGuidList.RCmdSetGuid, RPackageCommandId.icmdReportIssue) {
     _permissions = services.LoggingServices.Permissions;
     _pss = services.ProcessServices;
 }
Beispiel #26
0
 public LoggingServices(ILoggingPermissions permissions, IApplicationConstants appConstants)
 {
     Permissions   = permissions;
     _appConstants = appConstants;
 }
Beispiel #27
0
 public LoggingServices(ILoggingPermissions permissions, IApplicationConstants appConstants) {
     Permissions = permissions;
     _appConstants = appConstants;
 }