public Downloader( IConsoleService console, ISettingsStorage settings) { _console = console; _settings = settings; }
public ListInformation([NotNull] IConsoleService console, [NotNull] ICheckerService checkerService) : base("list-information", "list") { Console = console; CheckerService = checkerService; Shortcut = "l"; }
protected static void WriteExitCodeList(IConsoleService console, string title, Func <ExitCode, bool> exitCodePredicate) { var exitCodes = (from field in typeof(ExitCode).GetFields(BindingFlags.Public | BindingFlags.Static) let attr = field.GetCustomAttribute <ReturnableExitCodeAttribute>() where attr != null let code = (ExitCode)field.GetValue(null) ! where exitCodePredicate(code) let decimalCode = ((int)code).ToString() let hexCode = "0x" + Convert.ToString((int)code, 16).PadLeft(8, '0') select(decimalCode, hexCode, description: attr.Description)).ToArray(); console.WriteLine(); console.WriteLine($"{title}:"); if (exitCodes.Length == 0) { console.WriteLine(" In this category no exit codes are returned."); } else { new TableControl(console) { Margin = new(3, 0, 0, 0), ShowColumnHeaders = false, Columns = { new() { WidthMode = ColumnWidthMode.Auto }, new() { WidthMode = ColumnWidthMode.Auto }, new() { WidthMode = ColumnWidthMode.Star }, },
public MainWindow(IGenerator generator, ICallService callService, IAgentService agentService, IConsoleService consoleService, IOptions <AppSettings> settings) { InitializeComponent(); this.generator = generator; this.callService = callService; this.consoleService = consoleService; this.agentService = agentService; this.settings = settings.Value; var allAgents = agentService.GetAllAgents(); foreach (var agent in allAgents) { AgenstList.Items.Add(agent); } Calls = new Queue <Call>(); ActiveCall = new List <Call>(); var newCalls = callService.GenerateCalls(); foreach (var call in newCalls) { Calls.Enqueue(call); } LogConsole.Items.Add(consoleService.CallInfo(Calls.Count())); Task.Factory.StartNew(() => { BeginInvokeExample(); }); }
public GitHubService(IConsoleService consoleService, IProgressService progressService, Dictionary <string, string> configuredKeyValues) : base(new Dictionary <string, string>() { { GitHubUsername, "GitHub username" }, { GitHubPassword, "GitHub password" } }, consoleService, progressService, configuredKeyValues) { }
internal static int LoadToGrid( List <PpvkFileInfo> data, ICollection <ColumnInfo> columns, DataGridView actGridView, IConsoleService console = null) { try { actGridView.Rows.Clear(); foreach (var flatAct in data) { var index = actGridView.Rows.Add(); foreach (var e in columns) { var value = flatAct.GetType().GetProperty(e.Name)?.GetValue(flatAct, null); var isDateType = flatAct.GetType().GetProperty(e.Name)?.PropertyType == typeof(DateTime); var res = DateTime.TryParse(value?.ToString(), out var buf) ? (buf.Equals(DateTime.MinValue) ? String.Empty : buf.ToString()) : string.Empty; actGridView.Rows[index].Cells[e.Name].Value = isDateType ? res : value; } } return(data.Count); } catch (Exception e) { console?.AddException(e); return(0); } }
public FolderService(IConsoleService consoleService, IProgressService progressService, Dictionary <string, string> configuredKeyValues) : base(new Dictionary <string, string>() { { Folder, "Folder" }, { Zipping, "Zip Folder (enter y if you want the folder to be zipped)" } }, consoleService, progressService, configuredKeyValues) { }
private static void AddServiceMetadata( ISettingsStorage settings, IConsoleService console, ServiceHost host) { try { if (bool.TryParse(settings[ArgsKeyList.IsDebugMode], out bool isDebug) && isDebug) { var smb = new ServiceMetadataBehavior { HttpGetEnabled = true, HttpGetUrl = new Uri( $"http://{settings[ArgsKeyList.ServerName]}:{settings[ArgsKeyList.Port]}/mex") }; host.Description.Behaviors.Add(smb); } } catch (Exception e) { console?.AddException(e); console?.AddEvent("MEX does not activated.", ConsoleMessageType.Information); } }
public MainForm( IUnityContainer container, ISettingsStorage settings, IConsoleService console) { _container = container; _settings = settings; _console = console; if (container.Registrations.Any(a => a.RegisteredType == typeof(UpdateClient))) _updateClient = container.Resolve<UpdateClient>(); InitializeComponent(); TopLevel = true; IntitForms(); // Администрирование settingsToolStripMenuItem.Click += (s, e) => StartForm("EditorSettingsStorage"); nodeRolesToolStripMenuItem.Click += (s, e) => StartForm("PackageAdmining"); openHelpToolStripMenuItem.Click += (s, e) => { try { var fileName = $"..\\docs\\help.pdf"; if (!File.Exists(fileName)) throw new FileNotFoundException("Help.pdf not found"); System.Diagnostics.Process.Start(fileName); } catch (Exception ex) { _console.AddException(ex); } }; }
internal static int LoadToGrid( ICollection <FlatAct> data, ICollection <ColumnInfo> columns, DataGridView actGridView, IConsoleService console = null) { try { actGridView.Rows.Clear(); foreach (var flatAct in data) { var index = actGridView.Rows.Add(); foreach (var e in columns) { actGridView.Rows[index].Cells[e.Name].Value = flatAct.GetType().GetProperty(e.Name)?.GetValue(flatAct, null); } } return(data.Count); } catch (Exception e) { console?.AddException(e); return(0); } }
private void OnError(IConsoleService console) { if (_trigger != null) { _trigger.ErrorNotifier.ShowErrorWarning(); } }
/// <summary> /// Create an instance of the hosting class /// </summary> /// <param name="target">target instance</param> public SOSHost(ITarget target) { Target = target; ConsoleService = target.Services.GetService <IConsoleService>(); ModuleService = target.Services.GetService <IModuleService>(); ThreadService = target.Services.GetService <IThreadService>(); MemoryService = target.Services.GetService <IMemoryService>(); _ignoreAddressBitsMask = MemoryService.SignExtensionMask(); string rid = InstallHelper.GetRid(); SOSPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), rid); if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { var debugClient = new DebugClient(this); _interface = debugClient.IDebugClient; } else { var lldbServices = new LLDBServices(this); _interface = lldbServices.ILLDBServices; } _hostWrapper = new HostWrapper(target.Host); _hostWrapper.AddServiceWrapper(SymbolServiceWrapper.IID_ISymbolService, () => new SymbolServiceWrapper(target.Host)); }
public ServiceHostStart(string[] serviceNames, IConsoleService[] consoleServices) { var runServices = Config.GetServiceConfigList().Where(c => serviceNames.Contains(c.Item.Key)).ToArray(); //var runServices = Config.GetServiceConfigList(); if (Config.IsConsoleMode) { foreach (var sc in runServices) { Log.Info(sc.Item.Key); Log.Info(string.Format("{0}: {1}", "HostTypeDeclaration", sc.Item.HostTypeDeclaration)); Log.Info(string.Format("{0}: {1}", "HostTypeFullname", sc.Item.HostTypeFullname)); Log.Info(string.Format("{0}: {1}", "HostTypeAssembly", sc.Item.HostTypeAssembly)); Log.Info(string.Format("{0}: {1}", "ContractTypeDeclaration", sc.Item.ContractTypeDeclaration)); Log.Info(string.Format("{0}: {1}", "ContractTypeFullname", sc.Item.ContractTypeFullname)); Log.Info(string.Format("{0}: {1}", "ContractTypeAssembly", sc.Item.ContractTypeAssembly)); Log.Info(string.Format("{0}: {1}", "ServiceAddressPort", sc.Item.ServiceAddressPort)); Log.Info(string.Format("{0}: {1}", "EndpointName", sc.Item.EndpointName)); Log.Info(string.Format("{0}: {1}", "AuthorizedGroups", sc.Item.AuthorizedGroups)); } sr = new ServiceRunner(runServices); // console services List<IConsoleService> consoleServiceList = new List<IConsoleService>(); consoleServiceList.AddRange(consoleServices); if (consoleServices != null && consoleServices.Any()) sr.AddConsoleServices(consoleServiceList); } }
public Builder([NotNull] IConfiguration configuration, [NotNull] IConsoleService console, [NotNull] IFactory factory, [NotNull] IFileSystem fileSystem, [NotNull] IProjectService projectService, [NotNull, ItemNotNull, ImportMany] IEnumerable <ITask> tasks) : base(configuration, tasks) { Console = console; FileSystem = fileSystem; ProjectService = projectService; Factory = factory; }
public Proxy( IConsoleService console, ISettingsStorage settings) { _console = console; _settings = settings; }
/// <summary> /// Create an instance of the hosting class. Has the lifetime of the target. Depends on the /// context service for the current thread and runtime. /// </summary> /// <param name="services">service provider</param> public SOSHost(IServiceProvider services) { Services = services; Target = services.GetService <ITarget>() ?? throw new DiagnosticsException("No target"); TargetWrapper = new TargetWrapper(services); Target.DisposeOnDestroy(this); ConsoleService = services.GetService <IConsoleService>(); ModuleService = services.GetService <IModuleService>(); ThreadService = services.GetService <IThreadService>(); MemoryService = services.GetService <IMemoryService>(); TargetWrapper.ServiceWrapper.AddServiceWrapper(SymbolServiceWrapper.IID_ISymbolService, () => new SymbolServiceWrapper(services.GetService <ISymbolService>(), MemoryService)); _ignoreAddressBitsMask = MemoryService.SignExtensionMask(); _sosLibrary = services.GetService <SOSLibrary>(); if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { var debugClient = new DebugClient(this); _interface = debugClient.IDebugClient; } else { var lldbServices = new LLDBServices(this); _interface = lldbServices.ILLDBServices; } }
/// <summary> /// Create an instance of the hosting class /// </summary> /// <param name="serviceProvider">Service provider</param> public SOSHost(IServiceProvider serviceProvider) { DataTarget dataTarget = serviceProvider.GetService <DataTarget>(); DataReader = dataTarget.DataReader; _console = serviceProvider.GetService <IConsoleService>(); AnalyzeContext = serviceProvider.GetService <AnalyzeContext>(); _memoryService = serviceProvider.GetService <MemoryService>(); _registerService = serviceProvider.GetService <RegisterService>(); _versionCache = new ReadVirtualCache(_memoryService); string rid = InstallHelper.GetRid(); SOSPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), rid); if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { var debugClient = new DebugClient(this); _ccw = debugClient; _interface = debugClient.IDebugClient; } else { var lldbServices = new LLDBServices(this); _ccw = lldbServices; _interface = lldbServices.ILLDBServices; } }
public CommonTargets(ILoggerFactory loggerFactory, Options options, IProcessHelper processHelper, IConsoleService consoleService) { this.logger = loggerFactory.CreateLogger(nameof(CommonTargets)); this.options = options; this.processHelper = processHelper; this.consoleService = consoleService; }
public BackupWorkflow(IConsoleService consoleService, IProgressService progressService, IStorageService storageService) { _consoleService = consoleService; _storageService = storageService; _progressService = progressService; }
private static Binding GetCustomBinding( ISettingsStorage settings, IConsoleService console) { var tcpBinding = GetNetBinding(console); try { var binding = (CustomBinding)Activator.CreateInstance( typeof(CustomBinding), tcpBinding); var rbe = new ReliableSessionBindingElement(); binding.Elements.Add(rbe); var bme = Activator.CreateInstance <BinaryMessageEncodingBindingElement>(); bme.CompressionFormat = CompressionFormat.GZip; binding.Elements.Add(bme); var tf = Activator.CreateInstance <TransactionFlowBindingElement>(); binding.Elements.Add(tf); return(binding); } catch (Exception e) { console?.AddException(e); return(tcpBinding); } }
public void QueryFormatsAsExpected() { IConsoleService console = Substitute.For <IConsoleService>(); console.QueryYesNo("Foo{0}", "bar").Should().BeFalse(); console.Received(1).Write("Foobar [yes/no] \n"); }
public GeneratedPackagesService(IModeDeploimentService modeDeploimentService, IBackupFile backupFile, IConsoleService consoleService, IUpdateFileService updateFileService, ICmdCordovaService cmdCordovaService, IConfigurationService configurationService, ISelectPathDirectoryService selectPathDirectoryService, IEventAggregator eventAggregator, ILoggerService loggerService) { _modeDeploimentService = modeDeploimentService; _backupFile = backupFile; _consoleService = consoleService; _updateFileService = updateFileService; _cmdCordovaService = cmdCordovaService; _configurationService = configurationService; _selectPathDirectoryService = selectPathDirectoryService; _eventAggregator = eventAggregator; _loggerService = loggerService; _config = _configurationService.GetConfig(); if (!_eventAggregator.GetEvent <CmdIsFinishEvent>().Contains(OnFinishRecevied)) { _eventAggregator.GetEvent <CmdIsFinishEvent>().Subscribe(OnFinishRecevied, false); } }
public ApplicationService( IConsoleService consoleService, IGameService gameService) { _consoleService = consoleService; _gameService = gameService; }
public void AnswersReturnExpected(string answer, bool expected) { IConsoleService console = Substitute.For <IConsoleService>(); console.ReadLine().Returns(answer); console.QueryYesNo(String.Empty).Should().Be(expected); }
public Interactions( IEnumerable <IPlugin> plugins, IConsoleService consoleService) { _plugins = plugins; _consoleService = consoleService; }
protected ConfigureService(Dictionary <string, string> allKeyValues, IConsoleService consoleService, IProgressService progressService, Dictionary <string, string> configuredKeyValues) { AllKeyValues = allKeyValues; ConsoleService = consoleService; ProgressService = progressService; ConfiguredKeyValues = configuredKeyValues; }
public Md5HashComputerFiles( IWorkFlowProducerConsumer consumer, ISettingsStorage settings, IConsoleService console) : base(consumer, settings, console) { _console.AddEvent($"{nameof(Md5HashComputerFiles)} ready."); }
public Router(INzbDroneServiceFactory nzbDroneServiceFactory, IServiceProvider serviceProvider, IConsoleService consoleService, Logger logger) { _nzbDroneServiceFactory = nzbDroneServiceFactory; _serviceProvider = serviceProvider; _consoleService = consoleService; _logger = logger; }
public Factory([NotNull] IConfiguration configuration, [NotNull] ICompositionService compositionService, [NotNull] ITraceService trace, [NotNull] IConsoleService console, [NotNull] IFileSystem fileSystem) { Configuration = configuration; CompositionService = compositionService; Trace = trace; Console = console; FileSystem = fileSystem; }
public SaveForAfcFiles( IWorkFlowProducerConsumer consumer, ISettingsStorage settings, IConsoleService console) : base(consumer, settings, console) { _console.AddEvent($"{nameof(SaveForAfcFiles)} ready."); }
public ActDataHeating( DbContext context, IConsoleService console) { _console = console; _context = (ModelContext)context; StartTask(); }
public void Initialize(StereoCameraCalibrationModel calibration, IConsoleService consoleService) { Calibration = calibration; _capture1 = new TrackerService(consoleService); _capture1.Initialize(Calibration.Camera1); _capture2 = new TrackerService(consoleService); _capture2.Initialize(Calibration.Camera2); }
public ConsoleViewModel(IConsoleService consoleService) { Argument.IsNotNull(() => consoleService); Output = string.Empty; _consoleService = consoleService; _consoleService.LogMessage += OnConsoleServiceLogMessage; }
public Router(INzbDroneServiceFactory nzbDroneServiceFactory, IServiceProvider serviceProvider, IStartupArguments startupArguments, IConsoleService consoleService, IRuntimeInfo runtimeInfo, Logger logger) { _nzbDroneServiceFactory = nzbDroneServiceFactory; _serviceProvider = serviceProvider; _startupArguments = startupArguments; _consoleService = consoleService; _runtimeInfo = runtimeInfo; _logger = logger; }
public CameraViewModel( CameraModel camera, ITrackerService trackerService, ICameraService cameraService, IConsoleService consoleService, HelixCameraVisualizationService visualizationService) { Camera = camera; TrackerService = trackerService; CameraService = cameraService; ConsoleService = consoleService; VisualizationService = visualizationService; CameraService.Initialize(Camera); TrackerService.Initialize(Camera); VisualizationService.Initialize(Camera); if (!IsInDesignMode) { Messenger.Default.Register<AddMotionControllerMessage>(this, message => { TrackerService.AddMotionController(message.MotionController); }); Messenger.Default.Register<RemoveMotionControllerMessage>(this, message => { TrackerService.RemoveMotionController(message.MotionController); }); // add existing controllers foreach (MotionControllerViewModel mcvw in SimpleIoc.Default.GetAllCreatedInstances<MotionControllerViewModel>()) { TrackerService.AddMotionController(mcvw.MotionController); } SimpleIoc.Default.Register(() => this, Camera.GUID, true); Messenger.Default.Send(new AddCameraMessage(Camera)); // try loading previously saved configurations for this camera SimpleIoc.Default.GetInstance<ISettingsService>().LoadCamera(camera); Camera.Calibration = SimpleIoc.Default.GetInstance<SettingsViewModel>().SettingsService.LoadCalibration(Camera.GUID); } }
private void ConsoleOnUpdated(IConsoleService console) { SetIsDirty(); }
public WorkFlowManager(IFactory factory) { _commandLineParser = factory.CommandLineParser; _fileSystem = factory.FileSystem; _consoleService = factory.ConsoleService; }
public InteractiveTask(string prompt, ITaskRegistry registry, IConsoleService consoleService = null) { this.prompt = prompt; this.registry = registry; this.consoleService = consoleService ?? ConsoleHelper.Console; }
public StatusAppender(IConsoleService console, string status) { _console = console; _originalTitle = _console.Title; _console.Title = string.Format(CultureInfo.CurrentUICulture, "{0}: {1}", _originalTitle, status); }
public ConsoleInputReader(IConsoleService consoleService) { _consoleService = consoleService; }
public StatusAppender(IConsoleService console, string status) { this.console = console; this.originalTitle = this.console.Title; this.console.Title = String.Format(CultureInfo.CurrentUICulture, "{0}: {1}", this.originalTitle, status); }
public ClEyeService(IConsoleService consoleService) { ConsoleService = consoleService; }
public IInputFactory WithConsoleService(IConsoleService consoleService) { _consoleService = consoleService; return this; }
public void Initialize(IConsoleService consoleService, ServerModel server) { ConsoleService = consoleService; Server = server; }
public TrackerService(IConsoleService consoleService) { ConsoleService = consoleService; }
public void Initialize(IConsoleService consoleService, ServerModel server, CamerasModel cameras) { base.Initialize(consoleService, server); _cameras = cameras; }
private void ConsoleOnUpdated(IConsoleService console) { _isDirty = true; }
public ServerService(IConsoleService consoleService, ServerModel server, CamerasModel cameras) { Initialize(consoleService, server, cameras); }
public ConsoleServiceClient(IConsoleService service) { this.c = service; }