Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
 public UserTests()
 {
     Helpers.Loader.ReloadDb();
       db = new CommandRunner("dvds");
       var userQuery = new Membership.Queries.Membership.UserQuery(db) { Email = "*****@*****.**" };
       user = userQuery.Execute();
 }
Exemplo n.º 3
0
        public UpdateBatch(StoreOptions options, ISerializer serializer, ICommandRunner runner)
        {
            _options = options;
            _serializer = serializer;
            _runner = runner;

            _commands.Push(new BatchCommand(serializer));
        }
Exemplo n.º 4
0
        public HiloSequence(ICommandRunner runner, string entityName, HiloSettings settings)
        {
            _runner = runner;
            _entityName = entityName;

            CurrentHi = -1;
            CurrentLo = 1;
            MaxLo = settings.MaxLo;
            Increment = settings.Increment;
        }
Exemplo n.º 5
0
        public HiLoSequence(ICommandRunner runner, string entityName, HiloDef def)
        {
            _runner = runner;
            _entityName = entityName;

            CurrentHi = -1;
            CurrentLo = 1;
            MaxLo = def.MaxLo;
            Increment = def.Increment;
        }
Exemplo n.º 6
0
        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;
     }
 }
Exemplo n.º 8
0
        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();
        }
Exemplo n.º 9
0
        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);
        }
Exemplo n.º 10
0
        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
                       ));
        }
Exemplo n.º 12
0
        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();
        }
Exemplo n.º 13
0
        // ----------------- 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;
        }
Exemplo n.º 14
0
        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;
        }
Exemplo n.º 15
0
 public RequestCounter(ICommandRunner commandRunner) : this(commandRunner, RequestCounterThreshold.Empty)
 {
 }
Exemplo n.º 16
0
 public NuGetRunner(ICommandRunner commandRunner)
 {
     _commandRunner = commandRunner;
 }
Exemplo n.º 17
0
 public DevelopmentSchemaCreation(ICommandRunner runner)
 {
     _runner = runner;
 }
Exemplo n.º 18
0
 public UserQuery(ICommandRunner runner)
 {
     Runner = runner;
 }
Exemplo n.º 19
0
 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;
 }
Exemplo n.º 20
0
 public AddBatchOfActors(ICommandRunner runner)
 {
     Runner = runner;
 }
Exemplo n.º 21
0
 public RawSalesByDate(ICommandRunner runner)
 {
     this.Runner = runner;
 }
Exemplo n.º 22
0
 public static BindResult <CommandRunData> Run(this ICommandRunner runner, char c)
 {
     return(runner.Run(KeyInputUtil.CharToKeyInput(c)));
 }
Exemplo n.º 23
0
 /// <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;
 }
Exemplo n.º 25
0
 public QueryProcessor(ICommandRunner commandRunner, IQueryParser queryParser)
 {
     _commandRunner = commandRunner;
     _queryParser = queryParser;
 }
Exemplo n.º 26
0
 public SaveUserCommand(ICommandRunner runner)
 {
     Runner = runner;
 }
Exemplo n.º 27
0
 public RawSalesByDate(ICommandRunner runner)
 {
     this.Runner = runner;
 }
Exemplo n.º 28
0
 public DocumentCleaner(ICommandRunner runner, IDocumentSchema schema)
 {
     _schema = schema;
     _runner = runner;
 }
Exemplo n.º 29
0
 public ShellExecutionManager(ICommandRunner runner)
 {
     _commandRunner = runner;
 }
Exemplo n.º 30
0
 public AuthenticateCommand(ICommandRunner runner)
 {
     Runner            = runner;
     this.ProviderName = "local";
 }
Exemplo n.º 31
0
 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;
 }
Exemplo n.º 32
0
 public RegisterCommand(ICommandRunner commandRunner)
 {
     this.CommandRunner = commandRunner;
     Status             = "pending";
     IP = "127.0.0.1";
 }
Exemplo n.º 33
0
 private static void initializeConnection(string connectionId, string[] arguments)
 {
     _inspectorProvider = ProbeFactory.Create(connectionId.ToLower(), arguments);
 }
Exemplo n.º 34
0
        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;
        }
Exemplo n.º 35
0
 public PowerShellRunner(ICommandRunner commandRunner)
 {
     _commandRunner = commandRunner;
 }
Exemplo n.º 36
0
 public DevelopmentSchemaCreation(ICommandRunner runner)
 {
     _runner = runner;
 }
Exemplo n.º 37
0
 public BookService(LibraryContext context, ICommandRunner commandRunner)
 {
     _context       = context;
     _commandRunner = commandRunner;
 }
Exemplo n.º 38
0
 public Job(ICommandRunner exeExecuter, ILogger <Job> logger)
 {
     _exeExecuter = exeExecuter;
     _logger      = logger;
 }
Exemplo n.º 39
0
        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);
        }
Exemplo n.º 40
0
 public SequenceFactory(IDocumentSchema schema, ICommandRunner runner, IDocumentSchemaCreation creation)
 {
     _schema = schema;
     _runner = runner;
     _creation = creation;
 }
Exemplo n.º 41
0
 public IMacroAction With(ILogService log, ICommandRunner runner)
 {
     _runner = runner;
     _log    = log;
     return(this);
 }
Exemplo n.º 42
0
 public RequestCounter(ICommandRunner commandRunner, RequestCounterThreshold threshold)
 {
     _commandRunner = commandRunner;
     _threshold     = threshold;
 }
Exemplo n.º 43
0
        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;
        }
Exemplo n.º 44
0
 public MsBuildCommandRunner(ICommandRunner runner, TaskLoggingHelper logger)
 {
     Runner = runner;
     Logger = logger;
 }
Exemplo n.º 45
0
 public HomeController(
     ICommandRunner commandRunner,
     IGridQueryRunner gridQueryRunner,
     ISettings settings) : base(commandRunner, gridQueryRunner, settings)
 {
 }
Exemplo n.º 46
0
 public SaveSalesOrder(ICommandRunner runner)
 {
     Runner = runner;
 }
Exemplo n.º 47
0
        /// <summary>
        ///     Execute command scope on runner
        /// </summary>
        /// <param name="commandRunner"></param>
        public CommandScope Run(ICommandRunner commandRunner)
        {
            commandRunner?.Run(this);

            return(this);
        }
Exemplo n.º 48
0
 public static BindResult <CommandRunData> Run(this ICommandRunner runner, VimKey key)
 {
     return(runner.Run(KeyInputUtil.VimKeyToKeyInput(key)));
 }
Exemplo n.º 49
0
 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;
 }
Exemplo n.º 50
0
 public RuntimeDependencyResolver(ICommandRunner commandRunner, ILoggerFactory loggerFactory)
 {
     _commandRunner = commandRunner;
     _logger        = loggerFactory.CreateLogger <RuntimeDependencyResolver>();
 }
Exemplo n.º 51
0
 public ActorQuery(ICommandRunner runner)
 {
     this.Runner = runner;
 }
Exemplo n.º 52
0
 public SaveSalesOrder(ICommandRunner runner)
 {
     Runner = runner;
 }
Exemplo n.º 53
0
 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;
 }
Exemplo n.º 54
0
 public Meter(ICommandRunner runner, ILogger <Meter> logger)
 {
     this.runner = runner ?? throw new ArgumentNullException(nameof(runner));
     this.logger = logger ?? throw new ArgumentNullException(nameof(logger));
 }
Exemplo n.º 55
0
 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;
 }
Exemplo n.º 56
0
 public AddBatchOfActors(ICommandRunner runner)
 {
     Runner = runner;
 }
Exemplo n.º 57
0
 public UserQuery(ICommandRunner runner)
 {
     Runner = runner;
 }
Exemplo n.º 58
0
 public ActorQuery(ICommandRunner runner)
 {
     this.Runner = runner;
 }
Exemplo n.º 59
0
        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();
        }