Esempio n. 1
0
        public SessionController(
            IDispatcherExecute dispatcher,
            CommonServices svc,
            MutantDetailsController mutantDetailsController,
            IMutantsContainer mutantsContainer,
            ITestsContainer testsContainer,
            IFactory<ResultsSavingController> resultsSavingFactory,
            IFactory<TestingProcess> testingProcessFactory,
            IRootFactory<TestingMutant> testingMutantFactory,
            MutationSessionChoices choices)
        {
            _dispatcher = dispatcher;
            _svc = svc;
            _mutantDetailsController = mutantDetailsController;
            _mutantsContainer = mutantsContainer;
            _testsContainer = testsContainer;
            _resultsSavingFactory = resultsSavingFactory;
            _testingProcessFactory = testingProcessFactory;
            _testingMutantFactory = testingMutantFactory;
            _choices = choices;

            _sessionState = SessionState.NotStarted;
            _sessionEventsSubject = new Subject<SessionEventArgs>();
            _subscriptions = new List<IDisposable>();


        }
 public AutoCreationController(
     IDispatcherExecute dispatcher,
     CreationViewModel viewModel,
     ITypesManager typesManager,
     SessionConfiguration sessionConfiguration,
     OptionsModel options,
     IFactory<SessionCreator> sessionCreatorFactory,
     IDispatcherExecute execute,
     CommonServices svc)
 {
     _dispatcher = dispatcher;
     _viewModel = viewModel;
     _typesManager = typesManager;
     _sessionConfiguration = sessionConfiguration;
     _options = options;
     _sessionCreatorFactory = sessionCreatorFactory;
     _execute = execute;
     _svc = svc;
     
     _viewModel.CommandCreateMutants = new SmartCommand(CommandOk,
        () => _viewModel.TypesTreeMutate.Assemblies != null && _viewModel.TypesTreeMutate.Assemblies.Count != 0
              && _viewModel.TypesTreeToTest.TestAssemblies != null && _viewModel.TypesTreeToTest.TestAssemblies.Count != 0
              && _viewModel.MutationsTree.MutationPackages.Count != 0)
            .UpdateOnChanged(_viewModel.TypesTreeMutate, _ => _.Assemblies)
            .UpdateOnChanged(_viewModel.TypesTreeToTest, _ => _.TestAssemblies)
            .UpdateOnChanged(_viewModel.MutationsTree, _ => _.MutationPackages);
 }
        public ResultsSavingController(
            ResultsSavingViewModel viewModel, 
            IFileSystem fs,
            CommonServices svc,
            XmlResultsGenerator generator)
        {
            _viewModel = viewModel;
            _fs = fs;
            _svc = svc;
            _generator = generator;



            _viewModel.CommandSaveResults = new SmartCommand(async () =>
            {
                try
                {
                    await SaveResults();
                }
                catch (OperationCanceledException e)
                {
                    Close();
                }
                catch (Exception e)
                {
                    _log.Error(e);
                }
            },
                canExecute: () => !_viewModel.SavingInProgress)
                .UpdateOnChanged(_viewModel, _ => _.SavingInProgress);

            _viewModel.CommandClose = new SmartCommand(() =>
            {
                if(_cts != null)
                {
                    _cts.Cancel();
                    _viewModel.IsCancelled = true;
                }
                else
                {
                    Close();
                }
            },
                canExecute: () => !_viewModel.IsCancelled)
                .UpdateOnChanged(_viewModel, _ => _.IsCancelled);

            _viewModel.CommandBrowse = new SmartCommand(BrowsePath, 
                canExecute: () => !_viewModel.SavingInProgress)
                .UpdateOnChanged(_viewModel, _ => _.SavingInProgress);

            if (_svc.Settings.ContainsKey("MutationResultsFilePath"))
            {
                _viewModel.TargetPath = _svc.Settings["MutationResultsFilePath"];
            }
           
        }
Esempio n. 4
0
 public SessionCreator(
     ITypesManager typesManager,
     IOperatorsManager operatorsManager,
     CommonServices svc,
     IMessageService reporting)
 {
     _typesManager     = typesManager;
     _operatorsManager = operatorsManager;
     _svc       = svc;
     _reporting = reporting;
     Events     = new Subject <object>();
 }
Esempio n. 5
0
        public OptionsController(
            OptionsViewModel viewModel,
            CommonServices svc,
            IOptionsManager optionsManager)
        {
            _viewModel      = viewModel;
            _svc            = svc;
            _optionsManager = optionsManager;

            _viewModel.CommandSave  = new SmartCommand(SaveResults);
            _viewModel.CommandClose = new SmartCommand(Close);
        }
        public OptionsController(
            OptionsViewModel viewModel, 
            CommonServices svc,
            IOptionsManager optionsManager)
        {
            _viewModel = viewModel;
            _svc = svc;
            _optionsManager = optionsManager;

            _viewModel.CommandSave = new SmartCommand(SaveResults);
            _viewModel.CommandClose = new SmartCommand(Close);
        }
        private void mniUpdateSelected_Click(object sender, RoutedEventArgs e)
        {
            Cursor = Cursors.Wait;
            CommonServices.UpdateFromWeb(new List <ThumbItem> {
                CoverFlow.SelectedItem as ThumbItem
            });
            RoutedEventArgs args = new RoutedEventArgs(SaveEventCf);

            RaiseEvent(args);
            Cursor = null;
            new MessageBoxYesNo("Done", false, false).ShowDialog();
        }
Esempio n. 8
0
 public SessionCreator(
    ITypesManager typesManager,
     IOperatorsManager operatorsManager,
     CommonServices svc,
     IMessageService reporting)
 {
     _typesManager = typesManager;
     _operatorsManager = operatorsManager;
     _svc = svc;
     _reporting = reporting;
     Events = new Subject<object>();
 }
Esempio n. 9
0
 public JsonResult ForgotPassword(string EmailId)
 {
     try
     {
         var i = cs.GetforgotPassword(EmailId);
         return(Json(i, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         CommonServices.ErrorLogging(ex);
         throw ex;
     }
 }
Esempio n. 10
0
        /// <summary>The mod entry point, called after the mod is first loaded.</summary>
        /// <param name="helper">Provides simplified APIs for writing mods.</param>
        public override void Entry(IModHelper helper)
        {
            // Add services
            CommonServices = new CommonServices(Monitor, helper.Translation, helper.Reflection, helper.Content);

            // Start services
            var mailGenerator = new MailGenerator();

            helper.Content.AssetEditors.Add(mailGenerator);

            mailDeliveryService = new MailDeliveryService(mailGenerator);
            mailDeliveryService.Start();
        }
Esempio n. 11
0
 public MutationExecutor(
     OptionsModel options,
     MutationSessionChoices choices,
     CommonServices svc
     )
 {
     _svc           = svc;
     _operatorUtils = new OperatorUtils();
     _options       = options;
     _filter        = choices.Filter;
     _mutOperators  = choices.SelectedOperators;
     _sharedTargets = new MultiDictionary <IMutationOperator, MutationTarget>();
 }
        private void mniUpdateSelected_Click(object sender, RoutedEventArgs e)
        {
            Cursor = Cursors.Wait;
            IEnumerable <ThumbItem> items = MainStack.SelectedItems.Cast <ThumbItem>();

            CommonServices.UpdateFromWeb(items);
            UpdateThumbItems(items);
            RoutedEventArgs args = new RoutedEventArgs(UpdateEvent);

            RaiseEvent(args);
            Cursor = null;
            ShowVisibleItems(MainStack);
        }
Esempio n. 13
0
 public JsonResult SaveEmailTemplateData(EmailTemplate UM)
 {
     try
     {
         var user = MS.SaveEmailTemplateData(UM);
         return(Json(user, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         CommonServices.ErrorLogging(ex);
         throw ex;
     }
 }
Esempio n. 14
0
 public async Task UpdateAsync <T>(T dtoToUpdate) where T : DtoBase
 {
     try
     {
         var collection = this._mongoDatabase.GetCollection <T>(GetCollectionName <T>());
         await collection.ReplaceOneAsync(x => x.Id == dtoToUpdate.Id, dtoToUpdate);
     }
     catch (Exception ex)
     {
         this._logger.LogError(CommonServices.GetDefaultErrorTrace(ex));
         throw;
     }
 }
Esempio n. 15
0
 public async Task InsertAsync <T>(T dtoToInsert) where T : DtoBase
 {
     try
     {
         var collection = this._mongoDatabase.GetCollection <T>(GetCollectionName <T>());
         await collection.InsertOneAsync(dtoToInsert);
     }
     catch (Exception ex)
     {
         this._logger.LogError(CommonServices.GetDefaultErrorTrace(ex));
         throw;
     }
 }
Esempio n. 16
0
 public JsonResult EditEmailTempData(int TemplateId)
 {
     try
     {
         var user = MS.EditEmailTemplateData(TemplateId);
         return(Json(user, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         CommonServices.ErrorLogging(ex);
         throw ex;
     }
 }
Esempio n. 17
0
 public MutationExecutor(
     OptionsModel options,
 MutationSessionChoices choices, 
 CommonServices svc
 )
 {
     _svc = svc;
     _operatorUtils = new OperatorUtils();
     _options = options;
     _filter = choices.Filter;
     _mutOperators = choices.SelectedOperators;
     _sharedTargets = new MultiDictionary<IMutationOperator, MutationTarget>();
 }
Esempio n. 18
0
        public void Run()
        {
            uint method = 0x4c1;

            this.TrEntry(method);
            Thread.CurrentThread.Name = "ReconnectThread";
            Thread.SetData(Thread.GetNamedDataSlot("MQ_CLIENT_THREAD_TYPE"), 3);
            try
            {
                while (true)
                {
                    ManagedHconn remoteHconn = this.BestHconn();
                    base.TrText(method, "Hconn found for reconnection = " + remoteHconn.Value);
                    if (this.Reconnect(remoteHconn))
                    {
                        this.ReconnectionComplete(remoteHconn);
                        base.TrText(method, "Reconnection Completed");
                    }
                    else if (remoteHconn.HasFailed())
                    {
                        this.ReleaseHconn(remoteHconn);
                    }
                    else
                    {
                        remoteHconn.ReconnectionAttempts++;
                        int index = remoteHconn.ReconnectionAttempts - 1;
                        if (index >= this.rcnTimes.Length)
                        {
                            index = this.rcnTimes.Length - 1;
                        }
                        remoteHconn.NextReconnect = NmqiTools.GetCurrentTimeInMs() + Convert.ToInt64(this.rcnTimes[index]);
                        base.TrText(method, string.Concat(new object[] { "Reconnection details: Hconn : ", remoteHconn.Value, " Reconnection times : ", remoteHconn.ReconnectionAttempts, "NextReconnectionTime : ", remoteHconn.NextReconnect }));
                    }
                }
            }
            catch (Exception exception)
            {
                base.TrException(method, exception);
                CommonServices.SetValidInserts();
                CommonServices.ArithInsert1   = 1;
                CommonServices.CommentInsert1 = "ReconnectThread::Run";
                CommonServices.CommentInsert2 = exception.Message;
                CommonServices.CommentInsert3 = exception.StackTrace;
                base.FFST("%Z% %W%  %I% %E% %U%", "%C%", method, 1, 0x20009546, 0);
            }
            finally
            {
                Thread.SetData(Thread.GetNamedDataSlot("MQ_CLIENT_THREAD_TYPE"), 0);
                base.TrExit(method);
            }
        }
Esempio n. 19
0
        public async Task <IActionResult> CreateArticolo([FromBody] ArticoloJson articoloToCreate)
        {
            try
            {
                await this._articoloOrchestrator.CreateArticoloAsync(articoloToCreate, this.CommandInfo.Who, this.CommandInfo.When);

                return(this.Created("articoli", new PostResult("/", "")));
            }
            catch (Exception ex)
            {
                this._logger.LogError($"[ArticoliController.CreateArticolo] - {CommonServices.GetErrorMessage(ex)}");
                return(this.BadRequest($"[ArticoliController.CreateArticolo] - {CommonServices.GetErrorMessage(ex)}"));
            }
        }
Esempio n. 20
0
        public Putty()
        {
            string libFileName = Environment.Is64BitProcess ? "SimpleRemote.Lib.putty64.dll.Compress" : "SimpleRemote.Lib.putty.dll.Compress";

            _memoryModule = MemoryModule.Create(CommonServices.GetCompressResBytes(libFileName));
            Init          = _memoryModule.GetProcDelegate <Putty_Init>("Putty_Init");
            Create        = _memoryModule.GetProcDelegate <Putty_Create>("Putty_Create");
            GetError      = _memoryModule.GetProcDelegate <Putty_GetError>("Putty_GetError");
            SetCallback   = _memoryModule.GetProcDelegate <Putty_SetCallback>("Putty_SetCallback");
            Move          = _memoryModule.GetProcDelegate <Putty_Move>("Putty_Move");
            GetHwnd       = _memoryModule.GetProcDelegate <Putty_GetHwnd>("Putty_GetHwnd");
            Exit          = _memoryModule.GetProcDelegate <Putty_Exit>("Putty_Exit");
            Show          = _memoryModule.GetProcDelegate <Putty_Show>("Putty_Show");
        }
        public async Task AppendToStreamAsync(IAggregate aggregate, long expectedVersion, IEnumerable <EventData> events)
        {
            try
            {
                var filter = Builders <NoSqlEventData> .Filter.Eq("_id", aggregate.Id.ToString());

                var documentsResult = await this._documentUnitOfWork.NoSqlEventDataRepository.FindAsync(filter);

                if (!documentsResult.Any())
                {
                    var noSqlDocument = NoSqlEventData.CreateNoSqlEventData(aggregate);
                    await this._documentUnitOfWork.NoSqlEventDataRepository.InsertOneAsync(noSqlDocument);

                    for (var i = 0; i <= 5; i++)
                    {
                        documentsResult = await this._documentUnitOfWork.NoSqlEventDataRepository.FindAsync(filter);

                        if (!documentsResult.Any())
                        {
                            break;
                        }

                        Thread.Sleep(100);
                    }
                }

                if (!documentsResult.Any())
                {
                    return;
                }

                var noSqlAggregate = documentsResult.First();
                var eventDatas     = events as EventData[] ?? events.ToArray();
                foreach (var eventData in eventDatas)
                {
                    var commitPosition = await this.GetLastPositionAsync();

                    commitPosition.IncrementCommitPosition();
                    await this.SavePositionAsync(commitPosition);

                    noSqlAggregate.AppendEvent(eventData, commitPosition);
                }

                await this._documentUnitOfWork.NoSqlEventDataRepository.ReplaceOneAsync(filter, noSqlAggregate);
            }
            catch (Exception ex)
            {
                throw new Exception(CommonServices.GetErrorMessage(ex));
            }
        }
Esempio n. 22
0
        private async void Button_Update_Click(object sender, RoutedEventArgs e)
        {
            if (Button_Update.Content.ToString() == "检查更新")
            {
                Button_Update.Content = "检查中"; Button_Update.IsEnabled = false;
                try
                {
                    if (await UpdateServices.Check())
                    {
                        Text_Describe.Text = $"最新版本:{UpdateServices.RemoteVersion}({UpdateServices.RemoteUpdated.ToString("yyyy.MM.dd")})";
                        var logStr = await UpdateServices.GetUpdateLog();

                        TextBox_Log.Visibility = Visibility.Visible;
                        TextBox_Log.Text       = logStr;
                        Button_Update.Content  = "下载中";
                        await UpdateServices.Download();

                        Button_Update.Content = "立即更新"; Button_Update.IsEnabled = true;
                    }
                    else
                    {
                        Text_Describe.Text    = "当前已经是最新版本";
                        Button_Update.Content = "检查更新"; Button_Update.IsEnabled = true;
                    }
                }
                catch (Exception ex)
                {
                    MainWindow.ShowMessageDialog("错误", ex.Message);
                    Button_Update.Content = "检查更新"; Button_Update.IsEnabled = true;
                }
                return;
            }
            if (Button_Update.Content.ToString() == "立即更新")
            {
                try
                {
                    string exeFile = Path.Combine(UserSettings.AppDataDir, "AutoUpdate.exe");
                    File.WriteAllBytes(exeFile, CommonServices.GetCompressResBytes("SimpleRemote.Lib.AutoUpdate.exe.Compress"));
                    string updateFile = Path.Combine(UserSettings.AppDataDir, "Update.zip");
                    string unzipPath  = AppDomain.CurrentDomain.BaseDirectory;
                    Process.Start(exeFile, $"{updateFile} {unzipPath} {Assembly.GetEntryAssembly().Location}");
                    Application.Current.MainWindow.Close();
                }
                catch (Exception ex)
                {
                    MainWindow.ShowMessageDialog("错误", ex.Message);
                    Button_Update.Content = "检查更新"; Button_Update.IsEnabled = true;
                }
            }
        }
        public async Task Cannot_CreateOrdineCliente_Without_ClienteId()
        {
            var ordineClienteOrchestrator = this._container.Resolve <IOrdineClienteOrchestrator>();
            var ordineCliente             = new OrdineClienteJson
            {
                ClienteId            = string.Empty,
                DataInserimento      = DateTime.UtcNow,
                DataPrevistaConsegna = DateTime.UtcNow.AddMonths(3)
            };

            Exception ex = await Assert.ThrowsAnyAsync <Exception>(() =>
                                                                   ordineClienteOrchestrator.CreateOrdineClienteAsync(ordineCliente, this._who, this._when));

            Assert.Equal(DomainExceptions.ClienteIdNullException, CommonServices.GetErrorMessage(ex));
        }
Esempio n. 24
0
 private void CoverFlow_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     if (MySettings.ItemDbClick == "Launch")
     {
         string results = CommonServices.OpenFile(CoverFlow.SelectedItem as ThumbItem);
         if (string.IsNullOrWhiteSpace(results) == false)
         {
             new MessageBoxYesNo(results, false, true).ShowDialog();
         }
     }
     else
     {
         UpdateItem(CoverFlow.SelectedItem as ThumbItem);
     }
 }
Esempio n. 25
0
        public async Task <IActionResult> ModificaDescrizione([FromBody] ArticoloJson articolo)
        {
            try
            {
                await this._articoloOrchestrator.ModificaDescrizioneArticoloAsync(articolo, this.CommandInfo.Who,
                                                                                  this.CommandInfo.When);

                return(this.NoContent());
            }
            catch (Exception ex)
            {
                this._logger.LogError($"[ArticoliController.GetArticoloDetailsById] - {CommonServices.GetErrorMessage(ex)}");
                throw new Exception($"[ArticoliController.GetArticoloDetailsById] - {CommonServices.GetErrorMessage(ex)}");
            }
        }
Esempio n. 26
0
        internal static string GetTranslatedExceptionMessage(string objectId, uint returnCode, uint insert)
        {
            string   str;
            string   str2;
            string   str3;
            DateTime now            = DateTime.Now;
            int      extendedLength = 1;

            CommonServices.SetValidInserts();
            CommonServices.ArithInsert1 = insert;
            uint control = 2;

            CommonServices.GetMessage(objectId, returnCode, control, out str, out str2, out str3, 1, extendedLength, extendedLength);
            return(str);
        }
Esempio n. 27
0
        public async Task <IActionResult> CreateCliente([FromBody] ClienteJson cliente)
        {
            try
            {
                await this._clienteOrchestrator.CreateClienteAsync(cliente, this.CommandInfo.Who, this.CommandInfo.When);

                var clienteUri = $"{GetUri(this.Request)}";
                return(this.Created("clienti", new PostResult(clienteUri, "")));
            }
            catch (Exception ex)
            {
                this._logger.LogError($"[ClientiController.CreateCliente] - {CommonServices.GetErrorMessage(ex)}");
                return(this.BadRequest($"[ClientiController.CreateCliente] - {CommonServices.GetErrorMessage(ex)}"));
            }
        }
Esempio n. 28
0
        public NUnitXmlTestService(
            IFactory <NUnitTestsRunContext> testsRunContextFactory,
            ISettingsManager settingsManager,
            INUnitWrapper nUnitWrapper,
            CommonServices svc)

        {
            _testsRunContextFactory = testsRunContextFactory;
            _settingsManager        = settingsManager;
            _nUnitWrapper           = nUnitWrapper;
            _svc = svc;

            _nunitConsolePath = FindConsolePath();
            _log.Info("Set NUnit Console path: " + _nunitConsolePath);
        }
Esempio n. 29
0
        public async Task DeleteAsync <T>(string id) where T : DtoBase
        {
            try
            {
                var collection = this._mongoDatabase.GetCollection <T>(GetCollectionName <T>());
                var filter     = Builders <T> .Filter.Eq("_id", id);

                await collection.FindOneAndDeleteAsync(filter);
            }
            catch (Exception ex)
            {
                this._logger.LogError(CommonServices.GetDefaultErrorTrace(ex));
                throw;
            }
        }
Esempio n. 30
0
 public void ProcessRequest(HttpContext context)
 {
     try
     {
         if (context.IsWebSocketRequest)
         {
             context.AcceptWebSocketRequest(new SetOnlineHandler());
         }
         context = null;
     }
     catch (Exception ex)
     {
         CommonServices.ErrorLogging(ex);
     }
 }
Esempio n. 31
0
        public async Task <IEnumerable <T> > FindAsync <T>(Expression <Func <T, bool> > filter = null) where T : DtoBase
        {
            try
            {
                var collection = this._mongoDatabase.GetCollection <T>(GetCollectionName <T>()).AsQueryable();

                return(await Task.Run(() => filter != null
                                      ?collection.Where(filter)
                                      : collection));
            }
            catch (Exception ex)
            {
                this._logger.LogError(CommonServices.GetDefaultErrorTrace(ex));
                throw;
            }
        }
Esempio n. 32
0
        public async Task Cannot_CreateArticolo_Without_ArticoloDescrizione()
        {
            var articoloOrchestrator = this._container.Resolve <IArticoloOrchestrator>();
            var articoloJson         = new ArticoloJson
            {
                ArticoloId          = string.Empty,
                ArticoloDescrizione = string.Empty,
                UnitaMisura         = "NR",
                ScortaMinima        = 1
            };

            Exception ex = await Assert.ThrowsAnyAsync <Exception>(() =>
                                                                   articoloOrchestrator.CreateArticoloAsync(articoloJson, this._who, this._when));

            Assert.Equal(DomainExceptions.ArticoloDescrizioneNullException, CommonServices.GetErrorMessage(ex));
        }
        public async Task <EventPosition> GetLastPositionAsync()
        {
            try
            {
                var filter          = Builders <NoSqlPosition> .Filter.Empty;
                var documentsResult = await this._documentUnitOfWork.NoSqlPositionRepository.FindAsync(filter);

                return(documentsResult.Any()
                    ? new EventPosition(documentsResult.First().CommitPosition)
                    : new EventPosition(0));
            }
            catch (Exception ex)
            {
                throw new Exception(CommonServices.GetErrorMessage(ex));
            }
        }
Esempio n. 34
0
        /// <summary>
        /// Provides a static method for creating a standalone <see cref="SqlWebHookStore"/> instance.
        /// </summary>
        /// <param name="logger">The <see cref="ILogger"/> instance to use.</param>
        /// <param name="encryptData">Indicates whether the data should be encrypted using <see cref="IDataProtector"/> while persisted.</param>
        /// <returns>An initialized <see cref="SqlWebHookStore"/> instance.</returns>
        public static IWebHookStore CreateStore(ILogger logger, bool encryptData)
        {
            SettingsDictionary settings = CommonServices.GetSettings();
            IWebHookStore      store;

            if (encryptData)
            {
                IDataProtector protector = DataSecurity.GetDataProtector();
                store = new SqlWebHookStore(settings, protector, logger);
            }
            else
            {
                store = new SqlWebHookStore(settings, logger);
            }
            return(store);
        }
        public void ModificaArticoloHandler()
        {
            var descrizioneModificataEventHandler =
                this._container.Resolve <IHandleRequests <DescrizioneArticoloModificata> >();

            var articoloId  = new ArticoloId(Guid.NewGuid().ToString());
            var descrizione = new ArticoloDescrizione("Nuova Descrizione");

            var descrizioneArticoloModificata =
                new DescrizioneArticoloModificata(articoloId, descrizione, this._who, this._when);

            Exception ex = Assert.Throws <Exception>(() =>
                                                     descrizioneModificataEventHandler.Handle(descrizioneArticoloModificata));

            Assert.Equal($"Articolo {articoloId.GetValue()} Non Trovato!", CommonServices.GetErrorMessage(ex));
        }
Esempio n. 36
0
        public override void GoFullScreen(bool state)
        {
            //将窗口句柄设置或检索为控件显示的任何对话框的父窗口
            var parentHwnd = CommonServices.HWNDtoRemotableHandle(new WindowInteropHelper(Window.GetWindow(this)).Handle);

            MsRdpClientOcx.set_UIParentWindowHandle(ref parentHwnd);

            if (MsRdpClient7 != null)
            {
                MsRdpClient7.FullScreen = state;
            }
            else
            {
                MsRdpClient9.FullScreen = state;
            }
        }
Esempio n. 37
0
        public MsTestRunContext(
            MsTestResultsParser parser,
            IProcesses processes,
            CommonServices svc,
            //----------
            string xUnitPath,
            string assemblyPath,
            TestsSelector testsSelector)
        {
            _parser = parser;
            _processes = processes;
            _svc = svc;
            _assemblyPath = assemblyPath;
            _testsSelector = testsSelector;
            _nUnitConsolePath = xUnitPath;
            _cancellationTokenSource = new CancellationTokenSource();

        }
        public XUnitTestsRunContext(
            XUnitResultsParser parser,
            IProcesses processes,
            CommonServices svc,
            //----------
            string xUnitPath,
            string assemblyPath,
            TestsSelector testsSelector)
        {
            _parser = parser;
            _processes = processes;
            _svc = svc;
            _assemblyPath = assemblyPath;
            _testsSelector = testsSelector;
            _nUnitConsolePath = xUnitPath;// @"C:\PLIKI\DOWNLOAD\xunit-2.0-beta-3\src\xunit.console\bin\Debug\xunit.console.exe";
            _cancellationTokenSource = new CancellationTokenSource();

           // var testsSelector = new TestsSelector();
           // _selectedTests = testsSelector.GetIncludedTests(loadContext.Namespaces);
            //_log.Debug("Created tests to run: " + _selectedTests.TestsDescription);
        }
        public NUnitTestsRunContext(
            OptionsModel options,
            IProcesses processes,
            CommonServices svc, 
            NUnitResultsParser parser,
            //----------
            string nUnitConsolePath,
            string assemblyPath,
            TestsSelector testsSelector)
        {
            _options = options;
            _parser = parser;
            _processes = processes;
            _svc = svc;
            _assemblyPath = assemblyPath;
            _nUnitConsolePath = nUnitConsolePath;
            _testsSelector = testsSelector;
            _cancellationTokenSource = new CancellationTokenSource();

           // var testsSelector = new TestsSelector();
          //  _selectedTests = testsSelector.GetIncludedTests(loadContext.Namespaces);
          //  _log.Debug("Created tests to run: " + _selectedTests.TestsDescription);
        }
Esempio n. 40
0
 protected void OnCommandSent( object sender, CommonServices.CommandSentEventArgs e )
 {
     if( e.Command.StartsWith( "sendString:" ) )
     {
         SendString( e.Command.Substring( "sendString:".Length ) );
     }
     else if( e.Command.StartsWith( "sendKey:" ) )
     {
         var keyString = e.Command.Substring( "sendKey:".Length );
         Native.KeyboardKeys result;
         if( Enum.TryParse<Native.KeyboardKeys>( keyString, true, out result ) )
         {
             SendKeyboardKey( result );
         }
     }
 }
Esempio n. 41
0
        public MainController(
            IObservable<EventType> environmentEvents1,
            IFactory<OptionsController> optionsController,
            MainViewModel viewModel,
            ContinuousConfigurator continuousConfigurator,
            IOptionsManager optionsManager,
            IHostEnviromentConnection host,
            CommonServices svc)
        {
            _optionsController = optionsController;
            _viewModel = viewModel;
            _continuousConfigurator = continuousConfigurator;
            _optionsManager = optionsManager;
            _host = host;
            _sessionFinished = new Subject<string>();
            _controlSource = new Subject<ControlEvent>();
            _svc = svc;

            _viewModel.CommandCreateNewMutants = new SmartCommand(() => RunMutationSession(),
                () => _viewModel.OperationsState.IsIn(OperationsState.None, OperationsState.Finished, OperationsState.Error))
                .UpdateOnChanged(_viewModel, () => _viewModel.OperationsState);

            _viewModel.CommandPause = new SmartCommand(PauseOperations, 
                () => _viewModel.OperationsState.IsIn(OperationsState.Testing))
                .UpdateOnChanged(_viewModel, () => _viewModel.OperationsState);

            _viewModel.CommandStop = new SmartCommand(StopOperations,
                () => _viewModel.OperationsState.IsIn(OperationsState.Mutating, OperationsState.PreCheck,
                    OperationsState.Testing, OperationsState.TestingPaused, OperationsState.Pausing))
                .UpdateOnChanged(_viewModel, () => _viewModel.OperationsState);

            _viewModel.CommandContinue = new SmartCommand(ResumeOperations,
                () => _viewModel.OperationsState == OperationsState.TestingPaused)
                .UpdateOnChanged(_viewModel, () => _viewModel.OperationsState);

            _viewModel.CommandSaveResults = new SmartCommand(SaveResults, () =>
                _viewModel.OperationsState == OperationsState.Finished)
                .UpdateOnChanged(_viewModel, () => _viewModel.OperationsState);

            _viewModel.CommandOptions = new SmartCommand(() => ShowOptions(),
                () => _viewModel.OperationsState.IsIn(OperationsState.None, OperationsState.Finished, OperationsState.Error))
                .UpdateOnChanged(_viewModel, () => _viewModel.OperationsState);
            _viewModel.CommandTest = new SmartCommand(Test);


            _disp = new List<IDisposable>
                    {
                        environmentEvents1
                            .Where(e => e == EventType.HostOpened)
                            .Subscribe(type =>
                            {
                                Initialize();
                                continuousConfigurator.CreateConfiguration();
                            }),
                        environmentEvents1
                            .Where(e => e == EventType.HostClosed)
                            .Subscribe(type =>
                            {
                                continuousConfigurator.DisposeConfiguration();
                                Deactivate();
                            }),
                        environmentEvents1
                            .Where(e => e == EventType.BuildBegin)
                            .Subscribe(type => continuousConfigurator.DisposeConfiguration()),

                        environmentEvents1
                            .Where(e => e == EventType.BuildDone)
                            .Subscribe(type => continuousConfigurator.CreateConfiguration()),

                        _optionsManager.Events
                            .Where(e => e == OptionsManager.EventType.Updated)
                            .Subscribe(t =>
                            {
                                continuousConfigurator.DisposeConfiguration();
                                continuousConfigurator.CreateConfiguration();
                            }),
                    };

        }