public GenerateKeyStore(IFileSystem fileSystem, IKeyStore keyStore, IUserOutput userOutput, IPasswordRegistryLoader passwordLoader)
 {
     _fileSystem     = fileSystem;
     _keyStore       = keyStore;
     _userOutput     = userOutput;
     _passwordLoader = passwordLoader;
 }
Esempio n. 2
0
 /// <summary>
 /// Constructs the command
 /// </summary>
 /// <param name="suiteRoot">Suite root directory</param>
 /// <param name="targetRoot">Target root directory</param>
 /// <param name="extensions">Additional cleaning steps to be performed </param>
 /// <param name="output">User interface output interface</param>
 public CleanCommand([SuiteRoot] IFileSystemDirectory suiteRoot, [TargetRoot] IFileSystemDirectory targetRoot, IEnumerable<ICleanExtension> extensions, IUserOutput output)
 {
     this.suiteRoot = suiteRoot;
     this.targetRoot = targetRoot;
     this.extensions = extensions;
     this.output = output;
 }
Esempio n. 3
0
        public StationControl(IDoorSensor doorSensor, IUserOutput userOutput, IRfidReader rfidReader,
                              IChargeControl chargeControl, ILogger logger, IVerificationUnit verificationUnit)
        {
            //init states
            VACANT_DOOR_CLOSED_NO_PHONE_CONNECTED            = new States.VacantDoorClosedNoPhoneConnected(this);
            VACANT_DOOR_OPEN_NO_PHONE_CONNECTED              = new States.VacantDoorOpenNoPhoneConnected(this);
            VACANT_DOOR_OPEN_PHONE_CONNECTED                 = new States.VacantDoorOpenPhoneConnected(this);
            VACANT_DOOR_CLOSED_PHONE_CONNECTED_AWAITING_RFID = new States.VacantDoorClosedPhoneConnectedAwaitingRFID(this);
            OCCUPIED_DOOR_CLOSED_AWAITING_RFID               = new States.OccupiedDoorClosedAwaitingRFID(this);



            //init properties
            DoorSensor       = doorSensor;
            UserOutput       = userOutput;
            RfidReader       = rfidReader;
            ChargeControl    = chargeControl;
            Logger           = logger;
            VerificationUnit = verificationUnit;


            //Attaching events
            DoorSensor.DoorOpened           += DoorOpenedHandler;
            DoorSensor.DoorClosed           += DoorClosedHandler;
            RfidReader.RfidDetected         += RfidDetectedHandler;
            ChargeControl.PhoneConnected    += PhoneConnectedHandler;
            ChargeControl.PhoneDisconnected += PhoneDisconnectedHandler;


            //Initial state
            SetState(VACANT_DOOR_CLOSED_NO_PHONE_CONNECTED);
        }
Esempio n. 4
0
        public Synchroniser(SyncState syncState,
                            IPeerSyncManager peerSyncManager,
                            IDeltaCache deltaCache,
                            IDeltaHeightWatcher deltaHeightWatcher,
                            IDeltaHashProvider deltaHashProvider,
                            IDeltaDfsReader deltaDfsReader,
                            IDeltaIndexService deltaIndexService,
                            IMapperProvider mapperProvider,
                            IUserOutput userOutput,
                            ILogger logger,
                            int rangeSize        = 20, //cannot go over 20 until udp network fragmentation is fixed
                            IScheduler scheduler = null)
        {
            State               = syncState;
            _peerSyncManager    = peerSyncManager;
            _deltaHeightWatcher = deltaHeightWatcher;
            DeltaCache          = deltaCache;
            _rangeSize          = rangeSize;
            _deltaIndexService  = deltaIndexService;
            _mapperProvider     = mapperProvider;
            _userOutput         = userOutput;

            _deltaHashProvider = deltaHashProvider;

            _logger = logger;

            _syncCompletedReplaySubject = new ReplaySubject <ulong>(1, scheduler ?? Scheduler.Default);
            SyncCompleted = _syncCompletedReplaySubject.AsObservable();
        }
        public static void Main(string[] args)
        {
            var container = LoadContainer();

            _userOutput = container.Resolve <IUserOutput>();
            _commands   = container.Resolve <IKeyGeneratorCommand[]>();

            while (true)
            {
                try
                {
                    ParseCommand(args);
                }
                catch (Exception e)
                {
                    _logger.Error(e, nameof(ParseCommand));
                }

                // Non-interactive command
                if (args.Length != 0)
                {
                    break;
                }
            }
        }
Esempio n. 6
0
 /// <summary>
 /// Checks for warnings in the module, and displays them through the given output interface
 /// </summary>
 /// <param name="output">Output interface</param>
 public void CheckForWarnings(IUserOutput output)
 {
     foreach (var project in projects.Values)
     {
         project.CheckForWarnings(output);
     }
 }
Esempio n. 7
0
 /// <summary>
 /// Constructs the command
 /// </summary>
 /// <param name="targetRoot">Target root directory</param>
 /// <param name="extensions">Additional cleaning steps to be performed </param>
 /// <param name="output">User interface output interface</param>
 /// <param name="predicates">Soft clean predicate registry</param>
 public CleanCommand([TargetRoot] IFileSystemDirectory targetRoot, IEnumerable<ICleanExtension> extensions, IUserOutput output, ISoftCleanPredicates predicates)
 {
     this.targetRoot = targetRoot;
     this.extensions = extensions;
     this.output = output;
     this.predicates = predicates;
 }
Esempio n. 8
0
 /// <summary>
 /// Constructs the command
 /// </summary>
 /// <param name="targetRoot">Target root directory</param>
 /// <param name="extensions">Additional cleaning steps to be performed </param>
 /// <param name="output">User interface output interface</param>
 /// <param name="predicates">Soft clean predicate registry</param>
 public CleanCommand([TargetRoot] IFileSystemDirectory targetRoot, IEnumerable <ICleanExtension> extensions, IUserOutput output, ISoftCleanPredicates predicates)
 {
     this.targetRoot = targetRoot;
     this.extensions = extensions;
     this.output     = output;
     this.predicates = predicates;
 }
Esempio n. 9
0
 public RobotController(IRobot robot, IUserInput input, IUserOutput output, ICommandParser commandParser)
 {
     _robot         = robot;
     _input         = input;
     _output        = output;
     _commandParser = commandParser;
 }
Esempio n. 10
0
 /// <summary>
 /// Constructs the builder
 /// </summary>
 /// <param name="nuget">Interface to the NuGet package manager</param>
 /// <param name="targetRoot">Target root directory</param>
 /// <param name="output">User output interface</param>
 /// <param name="project">The project his reference belong sto</param>
 public NugetReferenceBuilder(INuGet nuget, [TargetRoot] IFileSystemDirectory targetRoot, IUserOutput output, Project project)
 {
     this.nuget = nuget;
     this.targetRoot = targetRoot;
     this.output = output;
     this.project = project;
 }
Esempio n. 11
0
        public void Init()
        {
            _userInput  = Substitute.For <IUserInput>();
            _userOutput = Substitute.For <IUserOutput>();

            _consolePasswordReader = new ConsolePasswordReader(_userOutput, _userInput);
        }
Esempio n. 12
0
 /// <summary>
 /// Constructs the command
 /// </summary>
 /// <param name="suiteRoot">Suite root directory</param>
 /// <param name="targetRoot">Target root directory</param>
 /// <param name="extensions">Additional cleaning steps to be performed </param>
 /// <param name="output">User interface output interface</param>
 public CleanCommand([SuiteRoot] IFileSystemDirectory suiteRoot, [TargetRoot] IFileSystemDirectory targetRoot, IEnumerable <ICleanExtension> extensions, IUserOutput output)
 {
     this.suiteRoot  = suiteRoot;
     this.targetRoot = targetRoot;
     this.extensions = extensions;
     this.output     = output;
 }
Esempio n. 13
0
 /// <summary>
 /// Constructs the build command
 /// </summary>
 /// <param name="buildContextFactory">Interface for creating new build contexts</param>
 /// <param name="projectBuilders">The set of registered project builder factories</param>
 /// <param name="targetRoot">Build target root directory </param>
 /// <param name="targetParser">Command target parser implementation to be used</param>
 public BuildCommand(IBuildContextFactory buildContextFactory, IEnumerable<IProjectBuilderFactory> projectBuilders, [TargetRoot] IFileSystemDirectory targetRoot, ICommandTargetParser targetParser, IUserOutput output)
 {
     this.buildContextFactory = buildContextFactory;
     this.projectBuilders = projectBuilders;
     this.targetRoot = targetRoot;
     this.targetParser = targetParser;
     this.output = output;
 }
Esempio n. 14
0
 /// <summary>
 /// Constructs the build command
 /// </summary>
 /// <param name="buildContextFactory">Interface for creating new build contexts</param>
 /// <param name="projectBuilders">The set of registered project builder factories</param>
 /// <param name="targetRoot">Build target root directory </param>
 /// <param name="targetParser">Command target parser implementation to be used</param>
 public BuildCommand(IBuildContextFactory buildContextFactory, IEnumerable <IProjectBuilderFactory> projectBuilders, [TargetRoot] IFileSystemDirectory targetRoot, ICommandTargetParser targetParser, IUserOutput output)
 {
     this.buildContextFactory = buildContextFactory;
     this.projectBuilders     = projectBuilders;
     this.targetRoot          = targetRoot;
     this.targetParser        = targetParser;
     this.output = output;
 }
Esempio n. 15
0
 public void DumpStats(IUserOutput output)
 {
     output.Message("Builder store statistics");
     output.Indent();
     output.Message("Total number of created builders: {0}", addCount);
     output.Message("Number of unique builders: {0}", instances.Count);
     output.Unindent();
 }
Esempio n. 16
0
 public FSRepositoryReferenceBuilder(Suite suite, IFSRepositoryFingerprintFactory fingerprintFactory, IFileSystemRepositoryAccess repository, [TargetRoot] IFileSystemDirectory targetRoot, IUserOutput output)
 {
     this.suite = suite;
     this.fingerprintFactory = fingerprintFactory;
     this.repository         = repository;
     this.targetRoot         = targetRoot;
     this.output             = output;
 }
Esempio n. 17
0
        /// <summary>
        /// Formatted message output
        /// </summary>
        /// <param name="output">Output interface to be used</param>
        /// <param name="format">Format string, used by <see cref="string.Format(string,object)"/></param>
        /// <param name="args">Parameters of the string formatting</param>
        public static void Message(this IUserOutput output, string format, params object[] args)
        {
            Contract.Requires(output != null);
            Contract.Requires(format != null);
            Contract.Requires(args != null);

            output.Message(string.Format(format, args));
        }
Esempio n. 18
0
        public InnoSetupProductPackager(IInnoSetupCompiler compiler, Suite suite, IUserOutput output)
        {
            Contract.Requires(compiler != null);
            Contract.Requires(suite != null);

            this.compiler = compiler;
            this.suite = suite;
            this.output = output;
        }
Esempio n. 19
0
        private void CreateCommon()
        {
            IHintField hintField = m_HintFieldFactory.Create(m_MineField);

            m_PlayingField = m_PlayingFieldFactory.Create(m_MineField);

            m_UserOutput = m_UserOutputFactory.Create(hintField,
                                                      m_PlayingField);
        }
Esempio n. 20
0
        public SimpleRpcClient(IUserOutput userOutput,
                               IPasswordRegistry passwordRegistry,
                               X509Certificate2 certificate,
                               ILogger logger,
                               SigningContext signingContextProvider)
        {
            _logger      = logger;
            _certificate = certificate;

            var fileSystem = new FileSystem();

            var consolePasswordReader = new ConsolePasswordReader(userOutput, new ConsoleUserInput());
            var passwordManager       = new PasswordManager(consolePasswordReader, passwordRegistry);

            var cryptoContext = new FfiWrapper();

            var hashProvider = new HashProvider(HashingAlgorithm.GetAlgorithmMetadata("keccak-256"));

            var peerSettings = Substitute.For <IPeerSettings>();

            peerSettings.NetworkType.Returns(signingContextProvider.NetworkType);

            var localKeyStore = new LocalKeyStore(passwordManager, cryptoContext, fileSystem, hashProvider, _logger);

            var keyRegistry = new KeyRegistry();
            var keySigner   = new KeySigner(localKeyStore, cryptoContext, keyRegistry);

            var memoryCacheOptions        = new MemoryCacheOptions();
            var memoryCache               = new MemoryCache(memoryCacheOptions);
            var changeTokenProvider       = new TtlChangeTokenProvider(10000);
            var messageCorrelationManager = new RpcMessageCorrelationManager(memoryCache, _logger, changeTokenProvider);
            var peerIdValidator           = new PeerIdValidator(cryptoContext);

            var nodeRpcClientChannelFactory =
                new RpcClientChannelFactory(keySigner, messageCorrelationManager, peerIdValidator, peerSettings);

            var eventLoopGroupFactoryConfiguration = new EventLoopGroupFactoryConfiguration
            {
                TcpClientHandlerWorkerThreads = 4
            };

            var tcpClientEventLoopGroupFactory = new TcpClientEventLoopGroupFactory(eventLoopGroupFactoryConfiguration);

            var handlers = new List <IRpcResponseObserver>
            {
                new BroadcastRawTransactionResponseObserver(_logger),
                new GetVersionResponseObserver(_logger)
            };

            _rpcClientFactory =
                new RpcClientFactory(nodeRpcClientChannelFactory, tcpClientEventLoopGroupFactory, handlers);

            //PeerId for RPC/TCP is currently redundant.
            var publicKey = keyRegistry.GetItemFromRegistry(KeyRegistryTypes.DefaultKey).GetPublicKey().Bytes;

            _senderPeerId = publicKey.BuildPeerIdFromPublicKey(IPAddress.Any, 1026);
        }
        private void CreateCommon()
        {
            HintField = m_HintFieldFactory(m_MineField); // todo test setting field

            m_PlayingField = m_PlayingFieldFactory(m_MineField);

            m_UserOutput = m_UserOutputFactory(HintField,
                                               m_PlayingField);
        }
Esempio n. 22
0
 /// <summary>
 /// Creates the model loader
 /// </summary>
 /// <param name="suiteFactory">Factory interface to create new suite instances</param>
 /// <param name="parametersLoaders">Parameter loader implementations</param>
 /// <param name="output">Output interface to issue warnings</param>
 /// <param name="pluginLoader">Plugin loader interface</param>
 /// <param name="environmentVariableContext">Environment variable context</param>
 /// <param name="suiteValidator">Suite validator interface</param>
 public LocalYamlModelLoader(ISuiteFactory suiteFactory, IEnumerable<IYamlProjectParametersLoader> parametersLoaders, IUserOutput output, IPluginLoader pluginLoader, IEnvironmentVariableContext environmentVariableContext, ISuiteValidator suiteValidator)
     : base(suiteFactory, parametersLoaders, output, pluginLoader, environmentVariableContext, suiteValidator)
 {
     Contract.Requires(suiteFactory != null);
     Contract.Requires(output != null);
     Contract.Requires(pluginLoader != null);
     Contract.Requires(environmentVariableContext != null);
     Contract.Requires(suiteValidator!= null);
 }
Esempio n. 23
0
        public InnoSetupProductPackager(IInnoSetupCompiler compiler, Suite suite, IUserOutput output)
        {
            Contract.Requires(compiler != null);
            Contract.Requires(suite != null);

            this.compiler = compiler;
            this.suite    = suite;
            this.output   = output;
        }
Esempio n. 24
0
 /// <summary>
 /// Constructs the test command
 /// </summary>
 /// <param name="buildContextFactory">Factory interface to create build contexts</param>
 /// <param name="targetRoot">Target file system directory</param>
 /// <param name="projectBuilders">Available project builders</param>
 /// <param name="testRunners">Available test runners</param>
 /// <param name="output">Output interface for the dependency dump functionality</param>
 /// <param name="targetParser">User-given target string parser</param>
 /// <param name="coreBuilderFactory">Factory for core builder types</param>
 public TestCommand(IBuildContextFactory buildContextFactory, [TargetRoot] IFileSystemDirectory targetRoot, IEnumerable<IProjectBuilderFactory> projectBuilders, IEnumerable<ITestRunner> testRunners, IUserOutput output, ICommandTargetParser targetParser, ICoreBuilderFactory coreBuilderFactory)
 {
     this.buildContextFactory = buildContextFactory;
     this.targetRoot = targetRoot;
     this.projectBuilders = projectBuilders;
     this.testRunners = testRunners;
     this.output = output;
     this.targetParser = targetParser;
     this.coreBuilderFactory = coreBuilderFactory;
 }
Esempio n. 25
0
        /// <summary>
        /// Constructs the help command
        /// </summary>
        /// <param name="commandFactory">Factory to create command instances</param>
        /// <param name="commandEnumerator">Interface to get all the available commands</param>
        /// <param name="output">The user output interface where help content will be printed</param>
        public HelpCommand(ICommandFactory commandFactory, ICommandEnumerator commandEnumerator, IUserOutput output)
        {
            Contract.Requires(commandFactory != null);
            Contract.Requires(commandEnumerator != null);
            Contract.Requires(output != null);

            this.commandEnumerator = commandEnumerator;
            this.commandFactory = commandFactory;
            this.output = output;
        }
Esempio n. 26
0
        /// <summary>
        /// Constructs the help command
        /// </summary>
        /// <param name="commandFactory">Factory to create command instances</param>
        /// <param name="commandEnumerator">Interface to get all the available commands</param>
        /// <param name="output">The user output interface where help content will be printed</param>
        public HelpCommand(ICommandFactory commandFactory, ICommandEnumerator commandEnumerator, IUserOutput output)
        {
            Contract.Requires(commandFactory != null);
            Contract.Requires(commandEnumerator != null);
            Contract.Requires(output != null);

            this.commandEnumerator = commandEnumerator;
            this.commandFactory    = commandFactory;
            this.output            = output;
        }
Esempio n. 27
0
 /// <summary>
 /// Constructs the test command
 /// </summary>
 /// <param name="buildContextFactory">Factory interface to create build contexts</param>
 /// <param name="targetRoot">Target file system directory</param>
 /// <param name="projectBuilders">Available project builders</param>
 /// <param name="testRunners">Available test runners</param>
 /// <param name="output">Output interface for the dependency dump functionality</param>
 /// <param name="targetParser">User-given target string parser</param>
 /// <param name="coreBuilderFactory">Factory for core builder types</param>
 public TestCommand(IBuildContextFactory buildContextFactory, [TargetRoot] IFileSystemDirectory targetRoot, IEnumerable <IProjectBuilderFactory> projectBuilders, IEnumerable <ITestRunner> testRunners, IUserOutput output, ICommandTargetParser targetParser, ICoreBuilderFactory coreBuilderFactory)
 {
     this.buildContextFactory = buildContextFactory;
     this.targetRoot          = targetRoot;
     this.projectBuilders     = projectBuilders;
     this.testRunners         = testRunners;
     this.output             = output;
     this.targetParser       = targetParser;
     this.coreBuilderFactory = coreBuilderFactory;
 }
Esempio n. 28
0
        public void DisplayPlayingField_CallsConsoleForTitle_WhenCalled()
        {
            // Arrange
            IUserOutput sut = CreateSut();

            // Act
            sut.DisplayPlayingField();

            // Assert
            m_Console.Received().WriteLine("Minefield:");
        }
Esempio n. 29
0
        public void DisplayPlayingField_CallsConsole_WhenCalled()
        {
            // Arrange
            IUserOutput sut = CreateSut();

            // Act
            sut.DisplayPlayingField();

            // Assert
            m_Console.Received().WriteLine(Arg.Any <string>());
        }
Esempio n. 30
0
        public CommandProcessor([NotNull] IUserInput userInput, [NotNull] IUserOutput userOutput,
                                [NotNull][ItemNotNull] IReadOnlyList <ICommand> commands)
        {
            ThrowIf.Variable.IsNull(userInput, nameof(userInput));
            ThrowIf.Variable.IsNull(userOutput, nameof(userOutput));
            ThrowIf.Variable.IsNull(commands, nameof(commands));

            _userInput  = userInput;
            _userOutput = userOutput;
            _commands   = commands.ToDictionary(x => x.Name.ToLower());
        }
        public void Setup()
        {
            _doorSensor       = Substitute.For <IDoorSensor>();
            _userOutput       = Substitute.For <IUserOutput>();
            _rfidReader       = Substitute.For <IRfidReader>();
            _chargeControl    = Substitute.For <IChargeControl>();
            _usbCharger       = Substitute.For <IUSBCharger>();
            _logger           = Substitute.For <ILogger>();
            _verificationUnit = Substitute.For <IVerificationUnit>();

            _uut = new StationControl(_doorSensor, _userOutput, _rfidReader, _chargeControl, _logger, _verificationUnit);
        }
Esempio n. 32
0
        public void DisplayPlayingField_CallsDisplayPlayingFieldField_WhenCalled()
        {
            // Arrange
            IUserOutput sut = CreateSut();

            // Act
            sut.DisplayPlayingField();

            // Assert
            // ReSharper disable once ReturnValueOfPureMethodIsNotUsed
            m_DisplayPlayingField.Received().ToString();
        }
Esempio n. 33
0
        /// <summary>
        /// Checks for warnings in the suite, and displays them through the given output interface
        /// </summary>
        /// <param name="output">Output interface</param>
        public void CheckForWarnings(IUserOutput output)
        {
            foreach (var module in modules.Values)
            {
                module.CheckForWarnings(output);
            }

            foreach (var product in products.Values)
            {
                product.CheckForWarnings(output);
            }
        }
Esempio n. 34
0
 public override void Dump(IUserOutput output)
 {
     output.Message(String.Format("Subtask {0}", subtask));
     output.Indent();
     try
     {
         subtask.Dependencies.Dump(output);
     }
     finally
     {
         output.Unindent();
     }
 }
Esempio n. 35
0
        /// <summary>
        /// Initializes the yaml loader
        /// </summary>
        /// <param name="suiteFactory">Factory interface to create new suite instances</param>
        /// <param name="parametersLoaders">Parameter loader implementations</param>
        /// <param name="output">Output interface to issue warnings</param>
        protected YamlModelLoaderBase(ISuiteFactory suiteFactory, IEnumerable <IYamlProjectParametersLoader> parametersLoaders, IUserOutput output)
        {
            Contract.Requires(suiteFactory != null);
            Contract.Requires(output != null);
            Contract.Ensures(this.suiteFactory == suiteFactory);
            Contract.Ensures(this.parametersLoaders == parametersLoaders);

            this.suiteFactory      = suiteFactory;
            this.parametersLoaders = parametersLoaders;
            this.output            = output;

            parser = new YamlParser();
        }
Esempio n. 36
0
        public LoadNoteCommand([NotNull] INotebook notebook, [NotNull] IUserFileInput userFileInput,
                               [NotNull] IUserOutput userOutput, [NotNull] IFileLoader fileLoader)
        {
            ThrowIf.Variable.IsNull(notebook, nameof(notebook));
            ThrowIf.Variable.IsNull(userFileInput, nameof(userFileInput));
            ThrowIf.Variable.IsNull(userOutput, nameof(userOutput));
            ThrowIf.Variable.IsNull(fileLoader, nameof(fileLoader));

            _notebook      = notebook;
            _userFileInput = userFileInput;
            _userOutput    = userOutput;
            _fileLoader    = fileLoader;
        }
Esempio n. 37
0
 public override void Dump(IUserOutput output)
 {
     output.Message(String.Format("Subtask {0}", subtask));
     output.Indent();
     try
     {
         subtask.Dependencies.Dump(output);
     }
     finally
     {
         output.Unindent();
     }
 }
Esempio n. 38
0
        /// <summary>
        /// Initializes the yaml loader
        /// </summary>
        /// <param name="suiteFactory">Factory interface to create new suite instances</param>
        /// <param name="parametersLoaders">Parameter loader implementations</param>
        /// <param name="output">Output interface to issue warnings</param>
        protected YamlModelLoaderBase(ISuiteFactory suiteFactory, IEnumerable<IYamlProjectParametersLoader> parametersLoaders, IUserOutput output)
        {
            Contract.Requires(suiteFactory != null);
            Contract.Requires(output != null);
            Contract.Ensures(this.suiteFactory == suiteFactory);
            Contract.Ensures(this.parametersLoaders == parametersLoaders);

            this.suiteFactory = suiteFactory;
            this.parametersLoaders = parametersLoaders;
            this.output = output;

            parser = new YamlParser();
        }
Esempio n. 39
0
        /// <summary>
        /// Checks for warnings in the project, and displays them through the given output interface
        /// </summary>
        /// <param name="output">Output interface</param>
        public void CheckForWarnings(IUserOutput output)
        {
            bool hasFiles = sourceSets.Values.Any(sourceSet => sourceSet.Files.Any());

            if (!hasFiles)
            {
                output.Warning(String.Format("{0} has no source files", ToString()),
                               new[]
                {
                    String.Format("The source files must be organized into source sets"),
                    String.Format("The source sets must be placed in {0}", RelativeRootDirectory)
                });
            }
        }
Esempio n. 40
0
        /// <summary>
        /// Initializes the main bari process
        /// </summary>
        /// <param name="output">User output interface to write messages to</param>
        /// <param name="parameters">User defined parameters describing the process to be performed</param>
        /// <param name="loader">The suite model loader implementation to be used</param>
        /// <param name="commandFactory">Factory for command objects</param>
        /// <param name="explorer">Suite explorer runner</param>
        /// <param name="binding">Interface to bind new dependencies</param>
        public MainProcess(IUserOutput output, IParameters parameters, ISuiteLoader loader, ICommandFactory commandFactory, ExplorerRunner explorer, IBindingRoot binding)
        {
            Contract.Requires(output != null);
            Contract.Requires(parameters != null);
            Contract.Requires(commandFactory != null);
            Contract.Requires(loader != null);
            Contract.Requires(explorer != null);

            this.output = output;
            this.parameters = parameters;
            this.loader = loader;
            this.commandFactory = commandFactory;
            this.explorer = explorer;
            this.binding = binding;
        }
Esempio n. 41
0
 public override void Dump(IUserOutput output)
 {
     output.Message(String.Format("Multiple dependencies ({0} subdeps)", dependencies.Count));
     output.Indent();
     try
     {
         foreach (var dep in dependencies)
         {
             dep.Dump(output);
         }
     }
     finally
     {
         output.Unindent();
     }
 }
Esempio n. 42
0
 public override void Dump(IUserOutput output)
 {
     output.Message("Project {0}.{1}'s properties:", project.Module.Name, project.Name);
     output.Indent();
     try
     {
         foreach (var prop in properties)
         {
             output.Message(prop);
         }
     }
     finally
     {
         output.Unindent();
     }
 }
Esempio n. 43
0
        /// <summary>
        /// Initializes the yaml loader
        /// </summary>
        /// <param name="suiteFactory">Factory interface to create new suite instances</param>
        /// <param name="parametersLoaders">Parameter loader implementations</param>
        /// <param name="output">Output interface to issue warnings</param>
        /// <param name="pluginLoader">Plugin loader interface</param>
        /// <param name="environmentVariableContext">Environment variable context</param>
        /// <param name="validator">Suite validator interface</param>
        protected YamlModelLoaderBase(ISuiteFactory suiteFactory, IEnumerable<IYamlProjectParametersLoader> parametersLoaders, IUserOutput output, IPluginLoader pluginLoader, IEnvironmentVariableContext environmentVariableContext, ISuiteValidator validator)
        {
            Contract.Requires(suiteFactory != null);
            Contract.Requires(output != null);
            Contract.Requires(pluginLoader != null);
            Contract.Requires(environmentVariableContext != null);
            Contract.Requires(validator != null);
            Contract.Ensures(this.suiteFactory == suiteFactory);
            Contract.Ensures(this.parametersLoaders == parametersLoaders);

            this.suiteFactory = suiteFactory;
            this.parametersLoaders = parametersLoaders;
            this.output = output;
            this.pluginLoader = pluginLoader;
            this.validator = validator;

            versioningEnvironmentVariableContext = new VersioningEnvironmentVariableContext(environmentVariableContext);
            parser = new YamlParser();
        }
Esempio n. 44
0
 public override void Dump(IUserOutput output)
 {
     output.Message(String.Format("Source set structure *{0}* ({1} files)", sourceSet.Type, sourceSet.Files.Count()));
 }
Esempio n. 45
0
 /// <summary>
 /// Dumps debug information about this dependency to the output
 /// </summary>
 public abstract void Dump(IUserOutput output);
Esempio n. 46
0
        /// <summary>
        /// The public constructor.
        /// </summary>
        /// <param name="ui">The UI module to use.</param>
        /// <param name="eventDispatcher">The event dispatcher to use.</param>
        /// <param name="surfaceComm">The Surface protocol communication module to use.</param>
        /// <param name="kryptonite">The Kryptonite module to use for an authenticated key-exchange and secure deploying of Bottom protocol messages.</param>
        /// <param name="bottom">The Bottom module to use for encrypting communication sessions.</param>
        public Core(IUserOutput ui, IEventDispatcher eventDispatcher, ISurfaceCommunication surfaceComm, IKryptoniteExternalCommunication kryptonite, IBottomExternalCommunication bottom)
        {
            this.ui = ui;
            this.eventDispatcher = eventDispatcher;
            this.surfaceComm = surfaceComm;
            this.kryptonite = kryptonite;
            this.bottom = bottom;

            this.activeCalls = new Dictionary<string, CallSession>();

            //set callbacks
            eventDispatcher.callStartedHandlers.Add(onNewCall);
            eventDispatcher.callEndedHandlers.Add(onEndCall);
            surfaceComm.surfaceMessageHandlers.Add(onSurfaceMessage);

            //init modules
            if (bottom.setUp() != true)
            {
                Logger.log(TLogLevel.logUser, "Fatal Error: Failed to initialize in-process module.");
            }

            if (kryptonite.setUp() != true)
            {
                Logger.log(TLogLevel.logUser, "Fatal Error: Failed to initialize crypto module.");
            }
        }
Esempio n. 47
0
 public ProjectBuildScriptRunner([TargetRoot] IFileSystemDirectory targetRoot, IReferenceBuilderFactory referenceBuilderFactory, IBuildContextFactory buildContextFactory, IUserOutput output, IParameters parameters)
     : base(targetRoot, referenceBuilderFactory, buildContextFactory)
 {
     this.output = output;
     this.parameters = parameters;
 }
 public override void Dump(IUserOutput output)
 {
     output.Message(string.Format("FS repo: `{0}`", path));
 }
Esempio n. 49
0
 public AddonInfoCommand(IUserOutput output)
 {
     this.output = output;
 }
Esempio n. 50
0
 public SelfUpdateCommand(IUserOutput output)
 {
     this.output = output;
 }
Esempio n. 51
0
 public override void Dump(IUserOutput output)
 {
     output.Message("no dependencies");
 }
Esempio n. 52
0
 public override void Dump(IUserOutput output)
 {
     output.Message("Reference {0}", reference.Uri);
 }
Esempio n. 53
0
 public override void Dump(IUserOutput output)
 {
     output.Message(String.Format("Script source `{0}`", buildScript.Name));
 }
Esempio n. 54
0
 ///<summary>
 ///Dumps the dependencies of the builder
 ///</summary>
 ///<param name="rootBuilder">The root builder</param>
 ///<param name="output">Output to dump information to</param>
 public void DumpDependencies(IBuilder rootBuilder, IUserOutput output)
 {
     rootBuilder.Dependencies.Dump(output);
 }
Esempio n. 55
0
 public override void Dump(IUserOutput output)
 {
     output.Message("Builder UID {0}", builder.Uid);
 }
Esempio n. 56
0
        /// <summary>
        /// Constructs the info command instance
        /// </summary>
        /// <param name="output">Interface for writing messages to the user</param>
        public InfoCommand(IUserOutput output)
        {
            Contract.Requires(output != null);

            this.output = output;
        }
Esempio n. 57
0
 /// <summary>
 /// Creates the model loader
 /// </summary>
 /// <param name="suiteFactory">Factory interface to create new suite instances</param>
 /// <param name="parametersLoaders">Parameter loader implementations</param>
 /// <param name="output">Output interface to issue warnings</param>
 public InMemoryYamlModelLoader(ISuiteFactory suiteFactory, IEnumerable<IYamlProjectParametersLoader> parametersLoaders, IUserOutput output)
     : base(suiteFactory, parametersLoaders, output)
 {
     Contract.Requires(suiteFactory != null);
     Contract.Requires(output != null);
 }
Esempio n. 58
0
 public override void Dump(IUserOutput output)
 {
     output.Message(String.Format("Project {0}.{1}'s parameter block {2}", project.Module.Name, project.Name, blockName));
 }
Esempio n. 59
0
 ///<summary>
 ///Dumps the dependencies of the builder
 ///</summary>
 ///<param name="rootBuilder">The root builder</param>
 ///<param name="output">Output to dump information to</param>
 public void DumpDependencies(IBuilder rootBuilder, IUserOutput output)
 {
     Contract.Requires(rootBuilder != null);
     Contract.Requires(output != null);
 }