private void Create(KeyRemapMode countKeyRemapMode, params string[] lines) { _textView = CreateTextView(lines); _vimTextBuffer = Vim.CreateVimTextBuffer(_textView.TextBuffer); _registerMap = Vim.RegisterMap; var vimBufferData = CreateVimBufferData( _vimTextBuffer, _textView); _commandUtil = CreateCommandUtil(vimBufferData); var incrementalSearch = new IncrementalSearch( vimBufferData, CommonOperationsFactory.GetCommonOperations(vimBufferData)); var motionCapture = new MotionCapture(vimBufferData, incrementalSearch); _runnerRaw = new CommandRunner( _textView, _registerMap, motionCapture, vimBufferData.LocalSettings, _commandUtil, new StatusUtil(), VisualKind.Character, countKeyRemapMode); _runner = _runnerRaw; }
public UserTests() { Helpers.Loader.ReloadDb(); db = new CommandRunner("dvds"); var userQuery = new Membership.Queries.Membership.UserQuery(db) { Email = "*****@*****.**" }; user = userQuery.Execute(); }
public UpdateBatch(StoreOptions options, ISerializer serializer, ICommandRunner runner) { _options = options; _serializer = serializer; _runner = runner; _commands.Push(new BatchCommand(serializer)); }
public HiloSequence(ICommandRunner runner, string entityName, HiloSettings settings) { _runner = runner; _entityName = entityName; CurrentHi = -1; CurrentLo = 1; MaxLo = settings.MaxLo; Increment = settings.Increment; }
public HiLoSequence(ICommandRunner runner, string entityName, HiloDef def) { _runner = runner; _entityName = entityName; CurrentHi = -1; CurrentLo = 1; MaxLo = def.MaxLo; Increment = def.Increment; }
public HiloSequenceTests() { _container.GetInstance<DocumentCleaner>().CompletelyRemoveAll(); var sql = SchemaBuilder.GetText("mt_hilo"); _runner = _container.GetInstance<ICommandRunner>(); _runner.Execute(sql); theSequence = new HiloSequence(_runner, "foo", new HiloSettings()); }
/// <summary> /// Synchronous run method that will run the command for the given args in a new thread. /// If the command implements ICanBeStopped /// </summary> /// <param name="args"></param> public void Run(string[] args) { _runner = CreateCommandRunner(); try { _runner.Run(args); } finally { _runner = null; } }
public AddReferenceForm(string solutionPath, int targetFramework, IProject project, ICommandRunner runner, IFileSystem fs, IConfigurationManager configManager) { InitializeComponent(); Win32.NearMargin(searchGems.Handle, 4); Win32.FarMargin(searchGems.Handle, 16); Win32.SetCueBanner(searchGems.Handle, "Search Gems"); labelVersion.Text = "Version: " + getAssemblyVersion(); labelTargetFramework.Text = string.Format("Target Framework: .NET Framework {0}.{1}", targetFramework >> 16, targetFramework & 0xFFFF); _views = new Label[] { view0, view1, view2, view3 }; var projectPath = Path.Combine(Path.GetFileName(Path.GetDirectoryName(project.ProjectPath)), Path.GetFileName(project.ProjectPath)); this.Text = "Add Nu Reference to " + projectPath; _configManager = configManager; _pkgManager = new PackageManager(solutionPath, targetFramework, project, runner, fs, _configManager); buildGemList(""); gemToInstall.Focus(); }
private CommandExecutorStat ExecuteArrowSqlCommand( Stream inputStream, Stream outputStream, SqlCommand[] commands) { var stat = new CommandExecutorStat(); ICommandRunner commandRunner = CreateCommandRunner(commands); SerDe.Write(outputStream, (int)SpecialLengths.START_ARROW_STREAM); IpcOptions ipcOptions = ArrowIpcOptions(); ArrowStreamWriter writer = null; Schema resultSchema = null; foreach (ReadOnlyMemory <IArrowArray> input in GetArrowInputIterator(inputStream)) { IArrowArray[] results = commandRunner.Run(input); // Assumes all columns have the same length, so uses 0th for num entries. int numEntries = results[0].Length; stat.NumEntriesProcessed += numEntries; if (writer == null) { Debug.Assert(resultSchema == null); resultSchema = BuildSchema(results); writer = new ArrowStreamWriter(outputStream, resultSchema, leaveOpen: true, ipcOptions); } var recordBatch = new RecordBatch(resultSchema, results, numEntries); writer.WriteRecordBatch(recordBatch); } WriteEnd(outputStream, ipcOptions); writer?.Dispose(); return(stat); }
private void Create(params string[] lines) { _textView = CreateTextView(lines); _vimTextBuffer = Vim.CreateVimTextBuffer(_textView.TextBuffer); _registerMap = Vim.RegisterMap; var vimBufferData = CreateVimBufferData( _vimTextBuffer, _textView); _commandUtil = VimUtil.CreateCommandUtil(vimBufferData); var motionCapture = VimUtil.CreateMotionCapture(vimBufferData); _runnerRaw = new CommandRunner( _textView, _registerMap, motionCapture, _commandUtil, new StatusUtil(), VisualKind.Character); _runner = _runnerRaw; }
// ---------------- Test Helpers ---------------- private IGrabber CreateGrabber(Options options, ICommandRunner runner, string gitConfigCommandArgs = "") { Mock <IGcErrorIgnorer> ignorer = new Mock <IGcErrorIgnorer>(MockBehavior.Strict); ignorer.Setup(m => m.IgnoreGcErrors).Returns(options.IgnoreGcErrors); Mock <ILockBreaker> lockBreaker = new Mock <ILockBreaker>(MockBehavior.Strict); lockBreaker.Setup(m => m.ShouldBreakLocks).Returns(options.BreakLocks); return(new Grabber( _testSvnUrl, options, runner, gitConfigCommandArgs, null, null, ignorer.Object, lockBreaker.Object )); }
public PackageManager(string solutionPath, int targetFramework, IProject project, ICommandRunner runner, IFileSystem fs, IConfigurationManager configManager) { _solutionPath = solutionPath; // lib will be in solution folder _rootPath = Path.GetDirectoryName(_solutionPath); // if parent of solution is src folder, then use solution parent // lib should be sibling of src if (string.Compare(Path.GetFileName(_rootPath), "src", true) == 0) { _rootPath = Path.GetDirectoryName(_rootPath); } _libPath = Path.Combine(_rootPath, "lib"); _targetFramework = targetFramework == 0 ? 0x00020000 : targetFramework; // default to 2.0 _project = project; _runner = runner; _fs = fs; _configManager = configManager; _config = _configManager.GetConfig(); }
// ----------------- Constructor ----------------- public Grabber( string svnUrl, Options options, ICommandRunner commandRunner, string gitConfigCommandArguments, IMessageDisplayer messageDisplayer, ILogger logger, IGcErrorIgnorer ignorer, ILockBreaker lockBreaker ) : base(options, commandRunner, gitConfigCommandArguments, messageDisplayer, logger) { _svnUrl = svnUrl; _metaInfo = new MetaInfo() { RemoteBranches = new List <string>(), LocalBranches = new List <string>(), Tags = new List <string>() }; _gcIgnorer = ignorer; _lockBreaker = lockBreaker; }
private void Create(KeyRemapMode countKeyRemapMode, params string[] lines) { _textView = CreateTextView(lines); _vimTextBuffer = Vim.CreateVimTextBuffer(_textView.TextBuffer); _registerMap = Vim.RegisterMap; var vimBufferData = CreateVimBufferData( _vimTextBuffer, _textView); _commandUtil = CreateCommandUtil(vimBufferData); var incrementalSearch = new IncrementalSearch( vimBufferData, CommonOperationsFactory.GetCommonOperations(vimBufferData)); var motionCapture = new MotionCapture(vimBufferData, incrementalSearch); _runnerRaw = new CommandRunner( vimBufferData, motionCapture, _commandUtil, VisualKind.Character, countKeyRemapMode); _runner = _runnerRaw; }
public RequestCounter(ICommandRunner commandRunner) : this(commandRunner, RequestCounterThreshold.Empty) { }
public NuGetRunner(ICommandRunner commandRunner) { _commandRunner = commandRunner; }
public DevelopmentSchemaCreation(ICommandRunner runner) { _runner = runner; }
public UserQuery(ICommandRunner runner) { Runner = runner; }
private void Create(params string[] lines) { _textView = EditorUtil.CreateView(lines); _factory = new MockRepository(MockBehavior.Strict); _host = _factory.Create<IVimHost>(); _statusUtil = _factory.Create<IStatusUtil>(); _registerMap = new RegisterMap(MockObjectFactory.CreateClipboardDevice(_factory).Object); var capture = new MotionCapture( _host.Object, _textView, new TextViewMotionUtil(_textView, new Vim.LocalSettings(new Vim.GlobalSettings(), _textView)), new MotionCaptureGlobalData()); _runnerRaw = new CommandRunner( _textView, _registerMap, (IMotionCapture)capture, _statusUtil.Object); _runner = _runnerRaw; }
public AddBatchOfActors(ICommandRunner runner) { Runner = runner; }
public RawSalesByDate(ICommandRunner runner) { this.Runner = runner; }
public static BindResult <CommandRunData> Run(this ICommandRunner runner, char c) { return(runner.Run(KeyInputUtil.CharToKeyInput(c))); }
/// <summary> /// Initializes a new instance of the <see cref="ScriptProjectProvider"/> class. /// </summary> /// <param name="commandRunner">The <see cref="ICommandRunner"/> that is responsible for executing the NuGet command.</param> /// <param name="scriptParser">The <see cref="IScriptParser"/> that is responsible for parsing NuGet references from script files.</param> public ScriptProjectProvider(ICommandRunner commandRunner, IScriptParser scriptParser) { this.commandRunner = commandRunner; this.scriptParser = scriptParser; }
/// <summary>ctor</summary> public ServiceCommandRunner(ICommandRunner innerRunner) { _innerRunner = innerRunner; }
public QueryProcessor(ICommandRunner commandRunner, IQueryParser queryParser) { _commandRunner = commandRunner; _queryParser = queryParser; }
public SaveUserCommand(ICommandRunner runner) { Runner = runner; }
public RawSalesByDate(ICommandRunner runner) { this.Runner = runner; }
public DocumentCleaner(ICommandRunner runner, IDocumentSchema schema) { _schema = schema; _runner = runner; }
public ShellExecutionManager(ICommandRunner runner) { _commandRunner = runner; }
public AuthenticateCommand(ICommandRunner runner) { Runner = runner; this.ProviderName = "local"; }
private void Create(params string[] lines) { _textView = EditorUtil.CreateView(lines); _factory = new MockFactory(MockBehavior.Strict); _statusUtil = _factory.Create<IStatusUtil>(); _registerMap = new RegisterMap(); _runnerRaw = new CommandRunner(Tuple.Create( _textView, _registerMap, _statusUtil.Object)); _runner = _runnerRaw; }
public RegisterCommand(ICommandRunner commandRunner) { this.CommandRunner = commandRunner; Status = "pending"; IP = "127.0.0.1"; }
private static void initializeConnection(string connectionId, string[] arguments) { _inspectorProvider = ProbeFactory.Create(connectionId.ToLower(), arguments); }
private static string GetStatusWithRegister(string commandLine, ICommandRunner commandRunner) { if (commandRunner.HasRegisterName && commandRunner.RegisterName.Char.IsSome()) { commandLine = string.Format("{0} \"{1}", commandLine, commandRunner.RegisterName.Char.Value); } return commandLine; }
public PowerShellRunner(ICommandRunner commandRunner) { _commandRunner = commandRunner; }
public DevelopmentSchemaCreation(ICommandRunner runner) { _runner = runner; }
public BookService(LibraryContext context, ICommandRunner commandRunner) { _context = context; _commandRunner = commandRunner; }
public Job(ICommandRunner exeExecuter, ILogger <Job> logger) { _exeExecuter = exeExecuter; _logger = logger; }
protected override CommandExecutorStat ExecuteCore( Stream inputStream, Stream outputStream, SqlCommand[] commands) { var stat = new CommandExecutorStat(); ICommandRunner commandRunner = CreateCommandRunner(commands); // On the Spark side, each object in the following List<> is considered as a row. // See the ICommandRunner comments above for the types for a row. var outputRows = new List <object>(); // If the input is empty (no rows) or all rows have been read, then // SpecialLengths.END_OF_DATA_SECTION is sent as the messageLength. // For example, no rows: // +---+----+ // |age|name| // +---+----+ // +---+----+ int messageLength = 0; while ((messageLength = SerDe.ReadInt32(inputStream)) != (int)SpecialLengths.END_OF_DATA_SECTION) { if ((messageLength > 0) || (messageLength == (int)SpecialLengths.NULL)) { if (messageLength <= 0) { throw new InvalidDataException( $"Invalid message length: {messageLength}"); } // Each row in inputRows is of type object[]. If a null is present in a row // then the corresponding index column of the row object[] will be set to null. // For example, (inputRows.Length == 2) and (inputRows[0][0] == null) // +----+ // | age| // +----+ // |null| // | 11| // +----+ object[] inputRows = PythonSerDe.GetUnpickledObjects(inputStream, messageLength); for (int i = 0; i < inputRows.Length; ++i) { // Split id is not used for SQL UDFs, so 0 is passed. outputRows.Add(commandRunner.Run(0, inputRows[i])); } // The initial (estimated) buffer size for pickling rows is set to the size of // input pickled rows because the number of rows are the same for both input // and output. WriteOutput(outputStream, outputRows, messageLength); stat.NumEntriesProcessed += inputRows.Length; outputRows.Clear(); } } return(stat); }
public SequenceFactory(IDocumentSchema schema, ICommandRunner runner, IDocumentSchemaCreation creation) { _schema = schema; _runner = runner; _creation = creation; }
public IMacroAction With(ILogService log, ICommandRunner runner) { _runner = runner; _log = log; return(this); }
public RequestCounter(ICommandRunner commandRunner, RequestCounterThreshold threshold) { _commandRunner = commandRunner; _threshold = threshold; }
private void Create(params string[] lines) { _textView = CreateTextView(lines); _vimTextBuffer = Vim.CreateVimTextBuffer(_textView.TextBuffer); _registerMap = Vim.RegisterMap; var vimBufferData = CreateVimBufferData( _vimTextBuffer, _textView); _commandUtil = VimUtil.CreateCommandUtil(vimBufferData); var motionCapture = VimUtil.CreateMotionCapture(vimBufferData); _runnerRaw = new CommandRunner( _textView, _registerMap, motionCapture, _commandUtil, new StatusUtil(), VisualKind.Character); _runner = _runnerRaw; }
public MsBuildCommandRunner(ICommandRunner runner, TaskLoggingHelper logger) { Runner = runner; Logger = logger; }
public HomeController( ICommandRunner commandRunner, IGridQueryRunner gridQueryRunner, ISettings settings) : base(commandRunner, gridQueryRunner, settings) { }
public SaveSalesOrder(ICommandRunner runner) { Runner = runner; }
/// <summary> /// Execute command scope on runner /// </summary> /// <param name="commandRunner"></param> public CommandScope Run(ICommandRunner commandRunner) { commandRunner?.Run(this); return(this); }
public static BindResult <CommandRunData> Run(this ICommandRunner runner, VimKey key) { return(runner.Run(KeyInputUtil.VimKeyToKeyInput(key))); }
private void Create(params string[] lines) { _textView = EditorUtil.CreateView(lines); _factory = new MockFactory(MockBehavior.Strict); _statusUtil = _factory.Create<IStatusUtil>(); _registerMap = new RegisterMap(); var capture = new MotionCapture(_textView, new MotionUtil(_textView, new Vim.GlobalSettings())); _runnerRaw = new CommandRunner(Tuple.Create( _textView, _registerMap, (IMotionCapture)capture, _statusUtil.Object)); _runner = _runnerRaw; }
public RuntimeDependencyResolver(ICommandRunner commandRunner, ILoggerFactory loggerFactory) { _commandRunner = commandRunner; _logger = loggerFactory.CreateLogger <RuntimeDependencyResolver>(); }
public ActorQuery(ICommandRunner runner) { this.Runner = runner; }
public SaveSalesOrder(ICommandRunner runner) { Runner = runner; }
private void Create(params string[] lines) { _textView = EditorUtil.CreateView(lines); _factory = new MockRepository(MockBehavior.Strict); _host = _factory.Create<IVimHost>(); _statusUtil = _factory.Create<IStatusUtil>(); _registerMap = VimUtil.CreateRegisterMap(MockObjectFactory.CreateClipboardDevice(_factory).Object); _vimData = new VimData(); var capture = new MotionCapture( _host.Object, _textView, new TextViewMotionUtil( _textView, new MarkMap(new TrackingLineColumnService()), new Vim.LocalSettings(new Vim.GlobalSettings(), _textView)), MockObjectFactory.CreateIncrementalSearch(factory: _factory).Object, _factory.Create<IJumpList>().Object, _vimData, new LocalSettings(new Vim.GlobalSettings(), _textView)); _runnerRaw = new CommandRunner( _textView, _registerMap, (IMotionCapture)capture, _statusUtil.Object); _runner = _runnerRaw; }
public Meter(ICommandRunner runner, ILogger <Meter> logger) { this.runner = runner ?? throw new ArgumentNullException(nameof(runner)); this.logger = logger ?? throw new ArgumentNullException(nameof(logger)); }
private void Create(params string[] lines) { _textView = EditorUtil.CreateView(lines); _factory = new MockRepository(MockBehavior.Strict); _host = _factory.Create<IVimHost>(); _statusUtil = _factory.Create<IStatusUtil>(); _registerMap = VimUtil.CreateRegisterMap(MockObjectFactory.CreateClipboardDevice(_factory).Object); _vimData = new VimData(); var settings = new GlobalSettings(); var localSettings = new LocalSettings(settings, _textView); var motionUtil = VimUtil.CreateTextViewMotionUtil( _textView, settings: localSettings, vimData: _vimData); var capture = new MotionCapture( _host.Object, _textView, MockObjectFactory.CreateIncrementalSearch(factory: _factory).Object, localSettings); _commandUtil = VimUtil.CreateCommandUtil( _textView, motionUtil: motionUtil, statusUtil: _statusUtil.Object, registerMap: _registerMap, vimData: _vimData); _runnerRaw = new CommandRunner( _textView, _registerMap, capture, _commandUtil, _statusUtil.Object, VisualKind.Character); _runner = _runnerRaw; }
public AddBatchOfActors(ICommandRunner runner) { Runner = runner; }
public UserQuery(ICommandRunner runner) { Runner = runner; }
public ActorQuery(ICommandRunner runner) { this.Runner = runner; }
public void Initialize(IPluginContext pluginContext) { this.commandRunner = pluginContext.CommandRunner; this.standAloneCommands = pluginContext.CommandProvider.StandAloneCommands; this.standAloneCommands.CollectionChanged += (sender, e) => { foreach (var command in e.NewItems.OfType<ICommand>()) { IncludeDefaultBindings(command); } }; string extensionPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); var compositionContainer = new CompositionContainer(new DirectoryCatalog(extensionPath)); Recompose(compositionContainer); compositionContainer.ExportsChanged += (sender, e) => Recompose(compositionContainer); SetUp(); }