Esempio n. 1
0
 public CoreDumpAnalyzer(IArchiveHandler archiveHandler, IFilesystem filesystem, IProcessHandler processHandler, IHttpRequestHandler requestHandler)
 {
     this.archiveHandler = archiveHandler ?? throw new ArgumentNullException("ArchiveHandler must not be null!");
     this.filesystem     = filesystem ?? throw new ArgumentNullException("Filesystem must not be null!");
     this.processHandler = processHandler ?? throw new ArgumentNullException("ProcessHandler must not be null!");
     this.requestHandler = requestHandler ?? throw new ArgumentNullException("RequestHandler must not be null!");
 }
Esempio n. 2
0
 public GdbAnalyzer(IFilesystem filesystem, IProcessHandler processHandler, IFileInfo coredump, SDResult result)
 {
     this.filesystem     = filesystem ?? throw new ArgumentNullException("FilesystemHelper must not be null!");
     this.processHandler = processHandler ?? throw new ArgumentNullException("ProcessHandler must not be null!");
     this.coredump       = coredump ?? throw new ArgumentNullException("Coredump must not be null!");
     this.analysisResult = result ?? throw new ArgumentNullException("SD Result Path must not be null!");
 }
Esempio n. 3
0
        public void DelegateRequest(int i)
        {
            switch (i)
            {
            case 1:
                ShowProducts(); return;

            case 2:
                ShowProductByName(); return;

            default:
                _processHandler.ProcessRequest(i);
                break;
            }
            switch (_userService.CurrentUser)
            {
            case Guest _ when !(_processHandler is GuestProcessHandler):
                _processHandler = new GuestProcessHandler(_userService);
                break;

            case AuthorizedUser _ when !(_processHandler is UserProcessHandler):
                _processHandler = new UserProcessHandler(_userService, _productService, _orderService);
                break;

            case Admin _ when !(_processHandler is AdminProcessHandler):
                _processHandler = new AdminProcessHandler(_userService, _productService, _orderService);
                break;
            }
        }
 public AccessProcessHandlerDecorator(
     IProcessHandler <AccessMessage <TProcess> > decoratee,
     IPrincipal userContext)
 {
     this.decoratee   = decoratee;
     this.userContext = userContext;
 }
Esempio n. 5
0
        private static void Print(IProcessHandler handler)
        {
            Console.WriteLine("1 - view the list of goods;");
            Console.WriteLine("2 - search for a product by name;");

            switch (handler)
            {
            case GuestProcessHandler _:
                Console.WriteLine("3 - user account registration;");
                Console.WriteLine("4 - login to the online store with an account.");
                break;

            case UserProcessHandler _:
                Console.WriteLine("3 - creating a new order;");
                Console.WriteLine("4 - ordering or cancellation;");
                Console.WriteLine("5 - view order history and delivery status;");
                Console.WriteLine("6 - setting the status of the order \"Received\";");
                Console.WriteLine("7 - change of personal information;");
                Console.WriteLine("8 - sign out of your account.");
                break;

            case AdminProcessHandler _:
                Console.WriteLine("3 - creating a new order");
                Console.WriteLine("4 - ordering;");
                Console.WriteLine("5 - view and change users personal information;");
                Console.WriteLine("6 - adding a new product (name, category, description, cost);");
                Console.WriteLine("7 - change of product information;");
                Console.WriteLine("8 - change the status of the order;");
                Console.WriteLine("9 - sign out of your account.");
                break;
            }
        }
 public Form1()
 {
     InitializeComponent();
     processHandler = new ProcessHandler();
     streamHandler  = new StreamHandler(processHandler);
     processHandler.TranscriptDataAvailable += ProcessHandler_TranscriptDataAvailable;
 }
Esempio n. 7
0
        public void SetUp()
        {
            processStartedEventArgs = CreateProcessStartedEventArgs();

            processListenerMock = Substitute.For <IProcessListener>();
            processHandlerMock  = Substitute.For <IProcessHandler>();
            systemUnderTest     = CreateSystemUnderTest();
        }
Esempio n. 8
0
 public EshopRequestHandler()
 {
     _orderService            = new OrderService();
     _userService             = new UserService();
     _productService          = new ProductService();
     _userService.CurrentUser = new Guest();
     _processHandler          = new GuestProcessHandler(_userService);
 }
        public static ProcessResult Execute(this IProcessHandler handler, string executable, string arguments, int timeout = 30000)
        {
            var setup = new ProcessSetup()
            {
                Executable = executable, Arguments = arguments
            };

            return(handler.Execute(setup, timeout));
        }
        public GdbSharedLibAnalyzer(IFilesystem filesystem, IProcessHandler processHandler, IFileInfo coredump, SDResult result)
        {
            this.filesystem     = filesystem ?? throw new ArgumentNullException("FilesystemHelper must not be null!");
            this.processHandler = processHandler ?? throw new ArgumentNullException("ProcessHandler must not be null!");
            this.coredump       = coredump ?? throw new ArgumentNullException("Coredump must not be null!");

            this.systemContext         = (SDCDSystemContext)result.SystemContext;
            this.systemContext.Modules = new List <SDModule>();
        }
        public StreamHandler(IProcessHandler processhndlr)
        {
            processhandler = processhndlr;
            //channel = GrpcChannel.ForAddress("https://localhost:5001");
            AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
            Uri uri = new Uri("http://wien-hiring.eastus2.cloudapp.azure.com:80");

            channel = GrpcChannel.ForAddress(uri);
            client  = new Acd.DialogScribe.DialogScribeClient(channel);
        }
        public static async Task <ProcessResult> ExecuteAsync(this IProcessHandler handler, string executable, string arguments, CancellationToken cancel = default)
        {
            var setup = new ProcessSetup()
            {
                Executable = executable,
                Arguments  = arguments
            };

            return(await handler.ExecuteAsync(setup, cancel));
        }
Esempio n. 13
0
        public LivePlayer(IProcessHandler proc, ICharacterStateProvider character, IInputHandler input, IPlanProvider planProvider)
        {
            this.proc         = proc;
            this.character    = character;
            this.input        = input;
            this.planProvider = planProvider;

            FoundNodes = new Queue <Node>();
            ViaRoute   = new Queue <Node>();
        }
 public void SetUp()
 {
     screenShooterMock = MockRepository.GenerateStrictMock<IScreenShooter>();
     screenShooterMock.Expect(m => m.Capture("")).IgnoreArguments().Repeat.Once();
     processHandlerStub = MockRepository.GenerateStub<IProcessHandler>();
     processHandlerStub.Expect(m => m.GetCurrentProcess()).Return("process");
     validator = new ProcessCaptureValidator(processHandlerStub, new string[] { "process" });
     processRecorder = new ProcessRecorder(
         new RecordConfiguration() { Name = "", Path = "", Period = 1000 }, validator, screenShooterMock);
 }
Esempio n. 15
0
 public BMBApplication(
     IProcessListener processListener,
     IProcessHandler processHandler,
     IKeyboardListener keyboardListener,
     IKeyboardHandler keyboardHandler)
 {
     this.processListener  = processListener;
     this.processHandler   = processHandler;
     this.keyboardListener = keyboardListener;
     this.keyboardHandler  = keyboardHandler;
 }
Esempio n. 16
0
 public ProcessSuite(
     IProcessManager processManager,
     IProcessHandler handler,
     ProcessConstraint processConstraint,
     float constraintValue
     )
 {
     thisProcessManager    = processManager;
     thisHandler           = handler;
     thisProcessConstraint = processConstraint;
     thisValue             = constraintValue;
 }
Esempio n. 17
0
        /// <summary>
        /// Registers the pipelinec components
        /// </summary>
        /// <returns></returns>
        public IProcessHandler RegisterOutBoundHandlers(PaymentTypes metaKey)
        {
            string handlerList = string.Empty;

            switch (metaKey)
            {
            //Below configuration can be fetched from any api
            case PaymentTypes.PHYSICALPRODUCT:
                handlerList = "PhysicalProductPackingSlipHandler,ProcessCommissionPaymentHandler,ResponseHandler"; break;

            case PaymentTypes.BOOKS:
                handlerList = "CreateDuplicateSlipForRoyaldepartmentHandler,ProcessCommissionPaymentHandler,ResponseHandler"; break;

            case PaymentTypes.MEMBERSHIPACTIVATE:
                handlerList = "ActivateMemeberShipHandler,NotifyEmailHandler,ResponseHandler"; break;

            case PaymentTypes.MEMBERSHIPUPGRADE:
                handlerList = "UpgradeMembershipHandler,NotifyEmailHandler,ResponseHandler"; break;

            case PaymentTypes.VIDEO:
                handlerList = "AddFirstAidVideoHandler,PhysicalProductPackingSlipHandler,ResponseHandler"; break;

            default:
                return(null);
            }
            try
            {
                var outBoundhandlers = handlerList.Split(',');
                outBoundhandlers = outBoundhandlers.Where(x => !string.IsNullOrWhiteSpace(x)).ToArray();
                IProcessHandler currentHandler   = null;
                IProcessHandler previoustHandler = null;
                //Create a handler chain execution based on the requirement
                for (int i = outBoundhandlers.Length - 1; i >= 0; i--)
                {
                    //Get the handlers class using named instance
                    currentHandler = _serviceAcessor(outBoundhandlers[i]);
                    if (i != outBoundhandlers.Length - 1 && previoustHandler != null)
                    {
                        currentHandler.Next(previoustHandler.Invoke);
                    }
                    previoustHandler = currentHandler;
                }
                Handler = previoustHandler;
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, $"RegisterOutBoundHandlers|Exception:{ex.Message}");
            }

            return(Handler);
        }
Esempio n. 18
0
 public ConstArg(
     IProcessManager processManager,
     ProcessConstraint constraint,
     float value,
     IProcessHandler handler,
     IProcessSuite suite
     ) : base(
         processManager,
         constraint,
         value
         )
 {
     thisHandler = handler;
     thisSuite   = suite;
 }
 public QueryBuilderDependencies(
     IProcessHandler processHandler,
     IDbConnection context,
     INamingStrategyService namingStrategyService,
     IFilterParser <T> filterParser,
     Lazy <IJoinHandler> joinHandler,
     Lazy <ISortHandler> sortHandler,
     Lazy <IPropertyParser> propertyParser
     )
 {
     ProcessHandler = processHandler;
     Context        = context;
     NamingStrategy = namingStrategyService;
     FilterParser   = filterParser;
     JoinHandler    = joinHandler;
     SortHandler    = sortHandler;
     PropertyParser = propertyParser;
 }
Esempio n. 20
0
 public CoreQueryBuilderDependencies(
     IProcessHandler processHandler,
     IDbConnection context,
     Lazy <IServiceProvider> serviceProvider,
     INamingStrategyService namingStrategyService,
     IFilterParser <T> filterParser,
     Lazy <IJoinHandler> joinHandler,
     Lazy <ISortHandler> sortHandler,
     Lazy <IPropertyParser> propertyParser
     ) : base(
         processHandler,
         context,
         namingStrategyService,
         filterParser,
         joinHandler,
         sortHandler,
         propertyParser)
 {
     ServiceProvider = serviceProvider;
 }
 public AutofacQueryBuilderDependencies(
     IProcessHandler processHandler,
     IDbConnection context,
     Lazy <ILifetimeScope> scope,
     INamingStrategyService namingStrategyService,
     IFilterParser <T> filterParser,
     Lazy <IJoinHandler> joinHandler,
     Lazy <ISortHandler> sortHandler,
     Lazy <IPropertyParser> propertyParser
     ) : base(
         processHandler,
         context,
         namingStrategyService,
         filterParser,
         joinHandler,
         sortHandler,
         propertyParser)
 {
     Scope = scope;
 }
        /// <summary>
        /// Execute process pipeline.
        /// </summary>
        /// <param name="request">Process request.</param>
        /// <param name="handler">Process handler.</param>
        /// <param name="token">Cancellation token.</param>
        /// <returns>Task.</returns>
        public Task ExecutePipline(ProcessRequest <TState> request, IProcessHandler <TState> handler, CancellationToken token)
        {
            var delegates = new List <Func <ProcessMiddlewareDelegate, ProcessMiddlewareDelegate> >();

            foreach (var middleware in middlewares)
            {
                delegates.Add(next =>
                {
                    return(() => middleware.Execute(request, next, token));
                });
            }

            ProcessMiddlewareDelegate execute = () => handler.Handle(request, token);

            foreach (var @delegate in delegates)
            {
                execute = @delegate(execute);
            }

            return(execute());
        }
Esempio n. 23
0
 public DebugSymbolAnalysis(IFilesystem filesystem, IProcessHandler processHandler, SDResult result)
 {
     this.filesystem     = filesystem ?? throw new ArgumentNullException("Filesystem must not be null!");
     this.processHandler = processHandler ?? throw new ArgumentNullException("ProcessHandler must not be null!");
     this.analysisResult = result ?? throw new ArgumentNullException("SD Result must not be null!");
 }
Esempio n. 24
0
 public LivePlayer(IProcessHandler proc, ICharacterStateProvider character, IInputHandler input) : this(proc, character, input, null)
 {
 }
Esempio n. 25
0
 public ServiceManager(IProcessHandler process_handler)
 {
     ProcessHandler              = process_handler;
     ProcessHandler.ProcessExit += HandleProcessExit;
 }
Esempio n. 26
0
 public App(ILog Logger, IEnumerable <DispatchDetails> dispatchDetails, IProcessHandler processHandler)
 {
     this.dispatchDetails = dispatchDetails;
     this.Logger          = Logger;
     this.processHandler  = processHandler;
 }
Esempio n. 27
0
 public TestRunner()
 {
     m_processHandler = new GUnitFramework.Implementation.ExternalProcessHandler();
 }
Esempio n. 28
0
 public RequestHandler(IProcessHandler processHandler)
 {
     _processHandler = processHandler;
 }
 public ProcessCaptureValidator(IProcessHandler processHandler, IList<string> processes)
 {
     this.processHandler = processHandler;
     this.validProcesses = processes;
 }
 /// <summary>
 /// Starts a process, optionally waits for it to exit before continuing execution.
 /// </summary>
 /// <param name="process_handler">The IProcessHandler that will start the process.</param>
 /// <param name="psi">The ProcessStartInfo that defines the parameters of the newly started process.</param>
 /// <param name="time">If -1, continue execution immediately after starting process.
 /// Else, waits the process to exit for this many milliseconds. If the process does not exit in the given timeframe,
 /// the process is killed, and a ResultType of Timeout is returned.</param>
 public RunUnregisteredProcessTask(IProcessHandler process_handler, ProcessStartInfo psi, int time = -1)
 {
     ProcessHandler   = process_handler;
     ProcessStartInfo = psi;
     ExecutionTime    = time;
 }
Esempio n. 31
0
 public DebugSymbolResolver(IFilesystem filesystem, IHttpRequestHandler requestHandler, IProcessHandler processHandler)
 {
     this.filesystem     = filesystem ?? throw new ArgumentNullException("Filesystem Helper must not be null!");
     this.requestHandler = requestHandler ?? throw new ArgumentNullException("RequestHandler must not be null!");
     this.processHandler = processHandler ?? throw new ArgumentNullException("ProcessHandler must not be null!");
 }
Esempio n. 32
0
 public VendorWindowHandler(IProcessHandler proc, IInputHandler input)
 {
     this.proc  = proc;
     this.input = input;
 }