Exemple #1
0
        public void Config()
        {
            try
            {
                CodeSharp.Core.Configuration.ConfigWithEmbeddedXml(null
                    , "application_config"
                    , Assembly.GetExecutingAssembly()
                    , "Taobao.Workflow.Activities.Test.ConfigFiles")
                    .RenderProperties()
                    .Castle(o => this.Resolve(o.Container));
                //设置容器
                Taobao.Activities.ActivityUtilities.Container(new Taobao.Workflow.Activities.Application.Container());
                Taobao.Activities.Hosting.WorkflowInstance.IsEnableDebug = false;
            }
            catch (InvalidOperationException e)
            {
                if (!e.Message.Contains("不可重复初始化配置"))
                    Console.WriteLine(e.Message);
            }

            this._log = DependencyResolver.Resolve<ILoggerFactory>().Create(this.GetType());
            this._userService = DependencyResolver.Resolve<IUserService>();
            this._processService = DependencyResolver.Resolve<IProcessService>();
            this._processTypeService = DependencyResolver.Resolve<IProcessTypeService>();
            this._workItemService = DependencyResolver.Resolve<IWorkItemService>();
            this._timeZoneService = DependencyResolver.Resolve<ITimeZoneService>();
            this._resumptionService = DependencyResolver.Resolve<ISchedulerService>();
            this._scheduler = DependencyResolver.Resolve<IScheduler>();
            this._sessionManager = DependencyResolver.Resolve<Castle.Facilities.NHibernateIntegration.ISessionManager>();
            this._managementApi = DependencyResolver.Resolve<Taobao.Workflow.Activities.Management.ITFlowEngine>();
            this._clientApi = DependencyResolver.Resolve<Taobao.Workflow.Activities.Client.ITFlowEngine>();
        }
Exemple #2
0
 public Service(IDocumentService documentService, IProcessService processService, ISubProcessService subProcessService, IClassificationService classificationService)
 {
     this.documentService = documentService;
     this.processService = processService;
     this.subProcessService = subProcessService;
     this.classificationService = classificationService;
 }
 public ClassificationController(IClassificationService classificationService, ISubProcessService subProcessService, IProcessService processService)
 {
     this.classificationService = classificationService;
     this.subProcessService = subProcessService;
     this.processService = processService;
     this.service = new Service(this.subProcessService);
 }
Exemple #4
0
        public ScriptTask(
            string safeDirectoryPathForScripts,
            TaskConfiguration taskConfiguration,
            IProcessService processService)
        {
            Guard.Requires<ArgumentNullException>(safeDirectoryPathForScripts != null);
            Guard.Requires<ArgumentException>(
                Directory.Exists(safeDirectoryPathForScripts) == true,
                "Path specified for SafeDirectoryPathForScripts does not exist");

            Guard.Requires<ArgumentNullException>(taskConfiguration != null);
            Guard.Requires<TaskConfigurationException>(taskConfiguration.EntryExists(ScriptName) == true);
            Guard.Requires<TaskConfigurationException>(
                taskConfiguration.ReadEntryValue(ScriptName) != null && 
                taskConfiguration.ReadEntryValue(ScriptName) != string.Empty);

            filePath = Path.Combine(safeDirectoryPathForScripts, taskConfiguration.ReadEntryValue(ScriptName).ToString());
            Guard.Requires<FileNotFoundException>(File.Exists(filePath) == true);

            Guard.Requires<ArgumentNullException>(processService != null);

            this.taskConfiguration = taskConfiguration;
            this.safeDirectoryPathForScripts = safeDirectoryPathForScripts;
            this.processService = processService;
        }
Exemple #5
0
        public AppDataService(IMessageService messageService, ISaveFileService saveFileService, 
            IProcessService processService, IDirectoryService directoryService, IFileService fileService)
        {
            Argument.IsNotNull(() => messageService);
            Argument.IsNotNull(() => saveFileService);
            Argument.IsNotNull(() => processService);
            Argument.IsNotNull(() => directoryService);
            Argument.IsNotNull(() => fileService);

            _messageService = messageService;
            _saveFileService = saveFileService;
            _processService = processService;
            _directoryService = directoryService;
            _fileService = fileService;

            ExclusionFilters = new List<string>(new []
            {
                "licenseinfo.xml",
                "*.log"
            });

            var applicationDataDirectory = Catel.IO.Path.GetApplicationDataDirectory();

            _directoryService.Create(applicationDataDirectory);

            ApplicationDataDirectory = applicationDataDirectory;
        }
Exemple #6
0
 public Service(IProcessService processService, ISubProcessService subProcessService, IClassificationService classificationService, IRoleService roleService)
 {
     this.subProcessService = subProcessService;
     this.processService = processService;
     this.classificationService = classificationService;
     this.roleService = roleService;
 }
Exemple #7
0
        public RibbonViewModel(INavigationService navigationService, IUIVisualizerService uiVisualizerService,
            ICommandManager commandManager, IRecentlyUsedItemsService recentlyUsedItemsService, IProcessService processService,
            IMessageService messageService, ISelectDirectoryService selectDirectoryService)
        {
            Argument.IsNotNull(() => navigationService);
            Argument.IsNotNull(() => uiVisualizerService);
            Argument.IsNotNull(() => commandManager);
            Argument.IsNotNull(() => recentlyUsedItemsService);
            Argument.IsNotNull(() => processService);
            Argument.IsNotNull(() => messageService);
            Argument.IsNotNull(() => selectDirectoryService);

            _navigationService = navigationService;
            _uiVisualizerService = uiVisualizerService;
            _recentlyUsedItemsService = recentlyUsedItemsService;
            _processService = processService;
            _messageService = messageService;
            _selectDirectoryService = selectDirectoryService;

            OpenProject = new Command(OnOpenProjectExecute);
            OpenRecentlyUsedItem = new Command<string>(OnOpenRecentlyUsedItemExecute);
            OpenInExplorer = new Command<string>(OnOpenInExplorerExecute);
            UnpinItem = new Command<string>(OnUnpinItemExecute);
            PinItem = new Command<string>(OnPinItemExecute);

            ShowKeyboardMappings = new Command(OnShowKeyboardMappingsExecute);

            commandManager.RegisterCommand("File.Open", OpenProject, this);

            var assembly = AssemblyHelper.GetEntryAssembly();
            Title = assembly.Title();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="LicenseViewModel" /> class.
        /// </summary>
        /// <param name="licenseInfo">The single license model.</param>
        /// <param name="navigationService">The navigation service.</param>
        /// <param name="processService">The process service.</param>
        /// <param name="licenseService">The license service.</param>
        /// <param name="licenseValidationService">The license validation service.</param>
        /// <param name="uiVisualizerService">The uiVisualizer service.</param>
        /// <param name="messageService">The message service.</param>
        /// <exception cref="ArgumentNullException">The <paramref name="licenseInfo" /> is <c>null</c>.</exception>
        /// <exception cref="ArgumentNullException">The <paramref name="navigationService" /> is <c>null</c>.</exception>
        /// <exception cref="ArgumentNullException">The <paramref name="processService" /> is <c>null</c>.</exception>
        /// <exception cref="ArgumentNullException">The <paramref name="licenseService" /> is <c>null</c>.</exception>
        /// <exception cref="ArgumentNullException">The <paramref name="uiVisualizerService" /> is <c>null</c>.</exception>
        public LicenseViewModel(LicenseInfo licenseInfo, INavigationService navigationService, IProcessService processService,
            ILicenseService licenseService, ILicenseValidationService licenseValidationService, IUIVisualizerService uiVisualizerService, 
            IMessageService messageService)
        {
            Argument.IsNotNull(() => licenseInfo);
            Argument.IsNotNull(() => navigationService);
            Argument.IsNotNull(() => processService);
            Argument.IsNotNull(() => licenseService);
            Argument.IsNotNull(() => licenseValidationService);
            Argument.IsNotNull(() => uiVisualizerService);
            Argument.IsNotNull(() => messageService);

            _navigationService = navigationService;
            _processService = processService;
            _licenseService = licenseService;
            _licenseValidationService = licenseValidationService;
            _uiVisualizerService = uiVisualizerService;
            _messageService = messageService;

            LicenseInfo = licenseInfo;
            Title = licenseInfo.Title;

            XmlData = new ObservableCollection<XmlDataModel>();

            Paste = new TaskCommand(OnPasteExecuteAsync);
            ShowClipboard = new Command(OnShowClipboardExecute);
            PurchaseLinkClick = new Command(OnPurchaseLinkClickExecute);
            AboutSiteClick = new Command(OnAboutSiteClickExecute);
            RemoveLicense = new TaskCommand(OnRemoveLicenseExecuteAsync, OnRemoveLicenseCanExecute);
        }
Exemple #9
0
        public AboutViewModel(AboutInfo aboutInfo, IProcessService processService, IUIVisualizerService uiVisualizerService,
            IMessageService messageService)
        {
            Argument.IsNotNull(() => aboutInfo);
            Argument.IsNotNull(() => processService);
            Argument.IsNotNull(() => uiVisualizerService);
            Argument.IsNotNull(() => messageService);
            
            _processService = processService;
            _uiVisualizerService = uiVisualizerService;
            _messageService = messageService;

            var assembly = aboutInfo.Assembly;
            var version = VersionHelper.GetCurrentVersion(assembly);
            var buildDateTime = assembly.GetBuildDateTime();

            Title = assembly.Title();
            Version = string.Format("v {0}", version);
            BuildDateTime = string.Format("Built on {0}", buildDateTime);
            UriInfo = aboutInfo.UriInfo;
            Copyright = assembly.Copyright();
            CompanyLogoUri = aboutInfo.CompanyLogoUri;
            ImageSourceUrl = aboutInfo.LogoImageSource;
            ShowLogButton = aboutInfo.ShowLogButton;
            AppIcon = assembly.ExtractLargestIcon();
            OpenUrl = new Command(OnOpenUrlExecute, OnOpenUrlCanExecute);
            OpenLog = new TaskCommand(OnOpenLogExecuteAsync);
            ShowSystemInfo = new Command(OnShowSystemInfoExecute);
            EnableDetailedLogging = new Command(OnEnableDetailedLoggingExecute);
        }
Exemple #10
0
        public AboutViewModel(AboutInfo aboutInfo, IProcessService processService, IUIVisualizerService uiVisualizerService,
            IMessageService messageService, ILanguageService languageService)
        {
            Argument.IsNotNull(() => aboutInfo);
            Argument.IsNotNull(() => processService);
            Argument.IsNotNull(() => uiVisualizerService);
            Argument.IsNotNull(() => messageService);
            Argument.IsNotNull(() => languageService);

            _processService = processService;
            _uiVisualizerService = uiVisualizerService;
            _messageService = messageService;
            _languageService = languageService;

            var assembly = aboutInfo.Assembly;
            var version = aboutInfo.DisplayVersion;
            var buildDateTime = aboutInfo.BuildDateTime.Value;

            Title = aboutInfo.Name;
            Version = string.Format("v {0}", aboutInfo.DisplayVersion);
            BuildDateTime = string.Format(languageService.GetString("Orchestra_BuiltOn"), buildDateTime);
            UriInfo = aboutInfo.UriInfo;
            Copyright = aboutInfo.Copyright;
            CompanyLogoUri = aboutInfo.CompanyLogoUri;
            ImageSourceUrl = aboutInfo.LogoImageSource;
            ShowLogButton = aboutInfo.ShowLogButton;
            AppIcon = aboutInfo.AppIcon;
            OpenUrl = new Command(OnOpenUrlExecute, OnOpenUrlCanExecute);
            OpenLog = new TaskCommand(OnOpenLogExecuteAsync);
            ShowSystemInfo = new Command(OnShowSystemInfoExecute);
            EnableDetailedLogging = new Command(OnEnableDetailedLoggingExecute);
        }
 public WorkflowMappingController(IWorkflowService workflowService, IRoleService roleService, IWorkflowMappingService workflowMappingService, IProcessService processService)
 {
     this.workflowService = workflowService;
     this.roleService = roleService;
     this.workflowMappingService = workflowMappingService;
     this.processService = processService;
     this.service = new Service(this.workflowService, roleService);
 }
 public ConverterService(IWorkflowConverterFactory factory
     , IProcessService processService
     , IWorkflowParser workflowParser)
 {
     this._factory = factory;
     this._processService = processService;
     this._workflowParser = workflowParser;
 }
 public AdminController(IConfigurationService config, IIndexerManagerService i, IServerService ss, ISecuityService s, IProcessService p, ICacheService c)
 {
     this.config = config;
     indexerService = i;
     serverService = ss;
     securityService = s;
     processService = p;
     cacheService = c;
 }
Exemple #14
0
 public WorkflowController(IWorkflowService workflowService, IProcessService processService, ISubProcessService subProcessService, IClassificationService classificationService, IRoleService roleService)
 {
     this.workflowService = workflowService;
     this.processService = processService;
     this.subProcessService= subProcessService;;
     this.classificationService= classificationService;
     this.roleService = roleService;
     this.service = new Service(this.processService, this.subProcessService, this.classificationService, this.roleService);
 }
 public SubProcessCompleteWaitingResumption(ILoggerFactory factory
      , IWorkflowParser parser
      , IProcessService processService
      , ISchedulerService resumption)
 {
     this._log = factory.Create(typeof(SubProcessCompleteWaitingResumption));
     this._parser = parser;
     this._processService = processService;
     this._resumption = resumption;
 }
        public ServerService(IIndexerManagerService i, IProcessService p, ISerializeService s, IConfigurationService c, Logger l)
        {
            indexerService = i;
            processService = p;
            serializeService = s;
            configService = c;
            logger = l;

            LoadConfig();
        }
 public WorkflowMappingController(IProcessService processService, ISubProcessService subProcessService, IClassificationService classificationService, IWorkflowService workflowService, IDocumentMappingService documentMappingService, IDocumentService documentService, INodeService nodeService)
 {
     this.processService = processService;
     this.subProcessService = subProcessService;
     this.classificationService = classificationService;
     this.workflowService = workflowService;
     this.documentMappingService = documentMappingService;
     this.documentService = documentService;
     this.nodeService = nodeService;
     this.service = new Service(documentService, processService, subProcessService, classificationService);
 }
        public OpenFilePickerViewModel(IOpenFileService selectFileService, IProcessService processService)
        {
            Argument.IsNotNull(() => selectFileService);
            Argument.IsNotNull(() => processService);

            _selectFileService = selectFileService;
            _processService = processService;

            OpenDirectory = new Command(OnOpenDirectoryExecute, OnOpenDirectoryCanExecute);
            SelectFile = new Command(OnSelectFileExecute);
        }
        public AutomaticSupportService(IProcessService processService, IDispatcherService dispatcherService)
        {
            Argument.IsNotNull(() => processService);
            Argument.IsNotNull(() => dispatcherService);

            _processService = processService;
            _dispatcherService = dispatcherService;

            _startedTime = DateTime.Now;
            CommandLineParameters = string.Empty;
        }
 public WorkflowInstanceStoreHelper(ILoggerFactory factory
     , IProcessService processService
     , IUserService userService
     , ISchedulerService schedulerService
     , IEventBus bus)
 {
     this._log = factory.Create(typeof(WorkflowInstanceStoreHelper));
     this._processService = processService;
     this._schedulerService = schedulerService;
     this._bus = bus;
 }
Exemple #21
0
        public PropertyHeaderController(IPropertyHeaderService PropertyHeaderService, IExceptionHandler exec, IDocumentTypeService DocumentTypeServ,
                                        IDocumentValidation DocValidation,
                                        IProcessService ProcessService)
        {
            _PropertyHeaderService = PropertyHeaderService;
            _exception             = exec;
            _documentTypeService   = DocumentTypeServ;
            _documentValidation    = DocValidation;
            _ProcessService        = ProcessService;

            UserRoles = (List <string>)System.Web.HttpContext.Current.Session["Roles"];
        }
 public ReportController(
     IOrchardServices services,
     IProcessService processService,
     ISortService sortService,
     ISecureFileService secureFileService
     )
 {
     _orchardServices   = services;
     _processService    = processService;
     _secureFileService = secureFileService;
     _sortService       = sortService;
 }
Exemple #23
0
        public HttpWebClient2(IProcessService p, Logger l, IConfigurationService c, ServerConfig sc)
            : base(p: p,
                   l: l,
                   c: c,
                   sc: sc)
        {
            if (webProxyUrl == null)
                InitProxy(sc);

            cookies = new CookieContainer();
            CreateClient();
        }
Exemple #24
0
 public HotfixTask(
     IAppContext appContext,
     ServiceResolver services,
     HttpClient httpClient
     )
 {
     this.appContext = appContext;
     output          = services.OutputService();
     cache           = services.CacheService();
     process         = services.ProcessService();
     this.httpClient = httpClient;
 }
        public FileOpenInTextEditorCommandContainer(ICommandManager commandManager, IProjectManager projectManager, IFileExtensionService fileExtensionService,
                                                    IFileService fileService, IProcessService processService, IConfigurationService configurationService)
            : base(Commands.File.OpenInTextEditor, "txt", commandManager, projectManager, fileExtensionService, fileService, processService)
        {
            Argument.IsNotNull(() => fileExtensionService);
            Argument.IsNotNull(() => configurationService);
            Argument.IsNotNull(() => processService);

            _fileExtensionService = fileExtensionService;
            _processService       = processService;
            _configurationService = configurationService;
        }
        public OpenFilePickerViewModel(IOpenFileService openFileService, IProcessService processService)
        {
            Argument.IsNotNull(() => openFileService);
            Argument.IsNotNull(() => processService);

            _openFileService = openFileService;
            _processService  = processService;

            OpenDirectory = new Command(OnOpenDirectoryExecute, OnOpenDirectoryCanExecute);
            SelectFile    = new TaskCommand(OnSelectFileExecuteAsync);
            Clear         = new Command(OnClearExecute, OnClearCanExecute);
        }
        public DirectoryPickerViewModel(ISelectDirectoryService selectDirectoryService, IProcessService processService)
        {
            Argument.IsNotNull(() => selectDirectoryService);
            Argument.IsNotNull(() => processService);

            _selectDirectoryService = selectDirectoryService;
            _processService         = processService;

            OpenDirectory   = new Command(OnOpenDirectoryExecute, OnOpenDirectoryCanExecute);
            SelectDirectory = new TaskCommand(OnSelectDirectoryExecuteAsync);
            Clear           = new Command(OnClearExecute, OnClearCanExecute);
        }
Exemple #28
0
 public ServerService(IIndexerManagerService i, IProcessService p, ISerializeService s, IConfigurationService c, Logger l, Utils.Clients.WebClient w, IUpdateService u, IProtectionService protectionService, ServerConfig serverConfig)
 {
     indexerService     = i;
     processService     = p;
     serializeService   = s;
     configService      = c;
     logger             = l;
     client             = w;
     updater            = u;
     config             = serverConfig;
     _protectionService = protectionService;
 }
Exemple #29
0
        private void Run(string[] args)
        {
            var runtimeSettings = new RuntimeSettings()
            {
                CustomLogFileName = "updater.txt"
            };

            LogManager.Configuration = LoggingSetup.GetLoggingConfiguration(runtimeSettings);
            logger = LogManager.GetCurrentClassLogger();

            logger.Info("Jackett Updater " + EnvironmentUtil.JackettVersion());
            logger.Info("Options \"" + string.Join("\" \"", args) + "\"");

            var variants = new Variants();

            variant = variants.GetVariant();
            logger.Info("Jackett variant: " + variant.ToString());

            var isWindows = Environment.OSVersion.Platform == PlatformID.Win32NT;

            if (isWindows)
            {
                //The updater starts before Jackett closes
                logger.Info("Pausing for 3 seconds to give Jackett & tray time to shutdown");
                System.Threading.Thread.Sleep(3000);
            }

            processService = new ProcessService(logger);
            windowsService = new WindowsServiceConfigService(processService, logger);

            var commandLineParser = new Parser(settings => settings.CaseSensitive = false);

            try
            {
                var optionsResult = commandLineParser.ParseArguments <UpdaterConsoleOptions>(args);
                optionsResult.WithParsed(options =>
                {
                    ProcessUpdate(options);
                }
                                         );
                optionsResult.WithNotParsed(errors =>
                {
                    logger.Error(HelpText.AutoBuild(optionsResult));
                    logger.Error("Failed to process update arguments!");
                    logger.Error(errors.ToString());
                    Console.ReadKey();
                });
            }
            catch (Exception e)
            {
                logger.Error($"Exception applying update!\n{e}");
            }
        }
 public ServerConfigurationController(IConfigurationService c, IServerService s, IProcessService p, IIndexerManagerService i, ISecuityService ss, IUpdateService u, ILogCacheService lc, Logger l, ServerConfig sc)
 {
     configService   = c;
     serverConfig    = sc;
     serverService   = s;
     processService  = p;
     indexerService  = i;
     securityService = ss;
     updater         = u;
     logCache        = lc;
     logger          = l;
 }
Exemple #31
0
 public WorkItemCreateWaitingResumption(ILoggerFactory factory
                                        , IUserService userService
                                        , IProcessService processService
                                        , IWorkItemService workItemService
                                        , ISchedulerService resumptionService)
 {
     this._log               = factory.Create(typeof(WorkItemCreateWaitingResumption));
     this._userService       = userService;
     this._processService    = processService;
     this._workItemService   = workItemService;
     this._resumptionService = resumptionService;
 }
Exemple #32
0
        public static void ProcessConsoleOverrides(ConsoleOptions consoleOptions, IProcessService processService, ServerConfig serverConfig, IConfigurationService configurationService, Logger logger)
        {
            IServerService serverService = new ServerService(null, processService, null, null, logger, null, null, null, serverConfig);

            // Override port
            if (consoleOptions.Port != 0)
            {
                Int32.TryParse(serverConfig.Port.ToString(), out Int32 configPort);

                if (configPort != consoleOptions.Port)
                {
                    logger.Info("Overriding port to " + consoleOptions.Port);
                    serverConfig.Port = consoleOptions.Port;

                    if (EnvironmentUtil.IsWindows)
                    {
                        if (ServerUtil.IsUserAdministrator())
                        {
                            serverService.ReserveUrls(true);
                        }
                        else
                        {
                            logger.Error("Unable to switch ports when not running as administrator");
                            Environment.Exit(1);
                        }
                    }
                    configurationService.SaveConfig(serverConfig);
                }
            }

            // Override listen public
            if (consoleOptions.ListenPublic || consoleOptions.ListenPrivate)
            {
                if (serverConfig.AllowExternal != consoleOptions.ListenPublic)
                {
                    logger.Info("Overriding external access to " + consoleOptions.ListenPublic);
                    serverConfig.AllowExternal = consoleOptions.ListenPublic;
                    if (EnvironmentUtil.IsWindows)
                    {
                        if (ServerUtil.IsUserAdministrator())
                        {
                            serverService.ReserveUrls(true);
                        }
                        else
                        {
                            logger.Error("Unable to switch to public listening without admin rights.");
                            Environment.Exit(1);
                        }
                    }
                    configurationService.SaveConfig(serverConfig);
                }
            }
        }
Exemple #33
0
 //private IEngineIntegrationService _integrationService;
 public SubProcessHelper(IProcessService processService
                         , IProcessTypeService processTypeService
                         , IUserService userService
                         , string systemUserName)
 //, IEngineIntegrationService integrationService)
     : base(processService
            , processTypeService
            , userService
            , systemUserName)
 {
     //this._integrationService = integrationService;
 }
        public SettingsViewModel(IProcessService processService, ILoggerFacade logger)
        {
            this.processService = processService;
            this.logger         = logger;

            SyncToProcess = new DelegateCommand(ExecuteSyncProcess);

            this.processService.ActiveProcessesUpdated += OnActiveProcessesUpdated;
            this.processService.SyncProcess            += OnProcessSynced;

            this.processService.UpdateActiveProcesses();
        }
Exemple #35
0
 public AdminController(IConfigurationService config, IIndexerManagerService i, IServerService ss, ISecuityService s, IProcessService p, ICacheService c, Logger l, ILogCacheService lc, IUpdateService u)
 {
     this.config     = config;
     indexerService  = i;
     serverService   = ss;
     securityService = s;
     processService  = p;
     cacheService    = c;
     logger          = l;
     logCache        = lc;
     updater         = u;
 }
Exemple #36
0
        public ServerService(IIndexerManagerService i, IProcessService p, ISerializeService s, IConfigurationService c, Logger l, IWebClient w, IUpdateService u)
        {
            indexerService   = i;
            processService   = p;
            serializeService = s;
            configService    = c;
            logger           = l;
            client           = w;
            updater          = u;

            LoadConfig();
        }
Exemple #37
0
 public PipelineConfigurationPartHandler(
     IRepository <PipelineConfigurationPartRecord> repository,
     IProcessService processService,
     INotifier notifier
     )
 {
     _notifier       = notifier;
     _processService = processService;
     T      = NullLocalizer.Instance;
     Logger = NullLogger.Instance;
     Filters.Add(StorageFilter.For(repository));
 }
Exemple #38
0
 public AdminController(IConfigurationService config, IIndexerManagerService i, IServerService ss, ISecuityService s, IProcessService p, ICacheService c, Logger l, ILogCacheService lc, IUpdateService u)
 {
     this.config = config;
     indexerService = i;
     serverService = ss;
     securityService = s;
     processService = p;
     cacheService = c;
     logger = l;
     logCache = lc;
     updater = u;
 }
 //private IEngineIntegrationService _integrationService;
 public SubProcessHelper(IProcessService processService
     , IProcessTypeService processTypeService
     , IUserService userService
     , string systemUserName)
     //, IEngineIntegrationService integrationService)
     : base(processService
     , processTypeService
     , userService
     , systemUserName)
 {
     //this._integrationService = integrationService;
 }
Exemple #40
0
        public ServerService(IIndexerManagerService i, IProcessService p, ISerializeService s, IConfigurationService c, Logger l, IWebClient w, IUpdateService u)
        {
            indexerService = i;
            processService = p;
            serializeService = s;
            configService = c;
            logger = l;
            client = w;
            updater = u;

            LoadConfig();
        }
        public string Inspect(ManagedApplicationInfo applicationInfo)
        {
#if NETCORE
            var binding        = new NetTcpBinding();
            var channelFactory = new ChannelFactory <IProcessService>(binding, new EndpointAddress(ProcessServiceAddress));
#else
            var binding        = new NetNamedPipeBinding();
            var channelFactory = new ChannelFactory <IProcessService>(binding, ProcessServiceNet35Address);
#endif

            IProcessService processService = channelFactory.CreateChannel();
            return(processService.Inspect(applicationInfo));
        }
Exemple #42
0
        private static ContentResult Get501(HttpRequestBase request, IProcessService service, string action, string message, long time = 5)
        {
            var format  = request.QueryString["format"] == "json" ? "json" : "xml";
            var process = service.Resolve(new PipelineConfigurationPart(), format, format);

            process.Request = action;
            process.Status  = 501;
            process.Message = message;
            process.Time    = time;
            return(new ContentResult {
                Content = process.Serialize(), ContentType = "text/" + format
            });
        }
Exemple #43
0
 public MainWindowPresenter(IStepIntroPresenter stepIntroPresenter, IStepPickPresenter stepPickPresenter,
                            IStepDiscoveringPresenter stepDiscoveringPresenter, IStepExplorePresenter stepExplorePresenter,
                            IStepGenerationPresenter stepGenerationPresenter, IStepTuningPresenter stepTuningPresenter,
                            IProcessService process)
 {
     _stepIntroPresenter       = stepIntroPresenter;
     _stepPickPresenter        = stepPickPresenter;
     _stepDiscoveringPresenter = stepDiscoveringPresenter;
     _stepExplorePresenter     = stepExplorePresenter;
     _stepGenerationPresenter  = stepGenerationPresenter;
     _stepTuningPresenter      = stepTuningPresenter;
     _process = process;
 }
        public void GetProcesses_Should_Returns_No_Result()
        {
            // Assert
            processService = new ProcessServiceTestable(false, true);
            var expectedProcessCount = 0;

            // Act
            var actualResult = processService.GetProcesses();

            // Arrange
            Assert.IsNotNull(actualResult);
            Assert.IsTrue(actualResult.Count == expectedProcessCount);
        }
Exemple #45
0
        public GH0008(IProcessService processService)
        {
            Argument.IsNotNull(() => processService);

            _processService = processService;

            ExpandAll   = new Command(OnExpandAllExecute);
            CollapseAll = new Command(OnCollapseAllExecute);
            Copy        = new Command(OnCopyExecute, OnCopyCanExecute);
            Open        = new Command(OnOpenExecute);

            InvalidateCommandsOnPropertyChanged = true;
        }
Exemple #46
0
        public CommandsService(StudioStateModel model,
            ICommandManager commandManager,
            IMementoService mementoService,
            IMessageService messageService,
            IOpenFileService openFileService,
            IRecentlyUsedItemsService recentlyUsedItemsService,
            ISaveFileService saveFileService,
            IProcessService processService)
        {
            Argument.IsNotNull(() => model);
            Argument.IsNotNull(() => commandManager);
            Argument.IsNotNull(() => mementoService);
            Argument.IsNotNull(() => messageService);
            Argument.IsNotNull(() => openFileService);
            Argument.IsNotNull(() => recentlyUsedItemsService);
            Argument.IsNotNull(() => saveFileService);
            Argument.IsNotNull(() => processService);

            this.model = model;
            this.commandManager = commandManager;
            this.mementoService = mementoService;
            this.messageService = messageService;
            this.openFileService = openFileService;
            this.recentlyUsedItemsService = recentlyUsedItemsService;
            this.saveFileService = saveFileService;
            this.processService = processService;

            this.UndoCommand = new Command(this.Undo, this.CanUndo);
            this.RedoCommand = new Command(this.Redo, this.CanRedo);
            this.OpenProjectCommand = new Command(this.OpenProject, () => true);

            this.SaveProjectAsCommand = new Command(delegate { this.SaveAsProject(); }, () => true);
            this.SaveProjectCommand = new Command(delegate { this.SaveProject(); }, this.CanSave);

            this.OpenRecentlyUsedItemCommand = new Command<string>(this.OnOpenRecentlyUsedItemExecute);

            this.PinItemCommand = new Command<string>(this.PinItem);
            this.UnpinItemCommand = new Command<string>(this.UnpinItem);
            this.OpenInExplorerCommand = new Command<string>(this.OpenInExplorer);

            this.StartCommand = new Command(this.Start, this.CanStart);

            this.ExitCommand = new Command(this.Exit);

            commandManager.RegisterCommand("Script.Open", this.OpenProjectCommand);
            commandManager.RegisterCommand("Script.Save", this.SaveProjectCommand);
            commandManager.RegisterCommand("Script.SaveAs", this.SaveProjectAsCommand);
            commandManager.RegisterCommand("App.Exit", this.ExitCommand);

            this.model.ProjectPropertyChanged += this.OnProjectPropertyChanged;
        }
Exemple #47
0
 public ProcessWatchdog(
     ILogger <ProcessWatchdog> logger,
     ITimeService time,
     IProcessService process,
     IFileSystemService filesystem,
     IOptions <ProcessWatchdogOptions> options)
 {
     _logger     = logger;
     _time       = time;
     _process    = process;
     _filesystem = filesystem;
     _options    = options.Value ?? throw new ArgumentNullException(nameof(options));
     State       = ProcessWatchdogStates.Initing;
 }
        public ServerService(IIndexerManagerService i, IProcessService p, ISerializeService s, IConfigurationService c, Logger l, IWebClient w, IUpdateService u, IProtectionService protectionService)
        {
            indexerService = i;
            processService = p;
            serializeService = s;
            configService = c;
            logger = l;
            client = w;
            updater = u;

            LoadConfig();
            // "TEMPORARY" HACK
            protectionService.InstanceKey = Encoding.UTF8.GetBytes(Config.InstanceId);
        }
        public void GetProcesses_Should_Returns_Correct_Result()
        {
            // Assert
            processService = new ProcessServiceTestable(true, true);
            var expectedProcessCount = 3;
            var expectedProcessName  = "cmd";
            // Act
            var actualResult = processService.GetProcesses();

            // Arrange
            Assert.IsNotNull(actualResult);
            Assert.IsTrue(actualResult.Count == expectedProcessCount);
            Assert.IsTrue(actualResult.All(x => x.Name == expectedProcessName));
        }
Exemple #50
0
 public WorkItemService(ILoggerFactory factory
                        , IScriptParser scriptParser
                        , IAgentService agentService
                        , IProcessService processService
                        , ISchedulerService resumptionService
                        , IEventBus bus)
 {
     this._log               = factory.Create(typeof(ProcessService));
     this._scriptParser      = scriptParser;
     this._agentService      = agentService;
     this._processService    = processService;
     this._resumptionService = resumptionService;
     this._bus               = bus;
 }
        public MainWindowViewModel(IMessageService messageService, ISolutionGeneratorService solutionGeneratorService, IProcessService processService)
        {
            Argument.IsNotNull(() => messageService);
            Argument.IsNotNull(() => solutionGeneratorService);
            Argument.IsNotNull(() => processService);

            _messageService = messageService;
            _solutionGeneratorService = solutionGeneratorService;
            _processService = processService;

            Generate = new Command(OnGenerateExecute, OnGenerateCanExecute);

            Solution = new Solution();
        }
Exemple #52
0
        public MainWindowViewModel(IMessageService messageService, ISolutionGeneratorService solutionGeneratorService, IProcessService processService)
        {
            Argument.IsNotNull(() => messageService);
            Argument.IsNotNull(() => solutionGeneratorService);
            Argument.IsNotNull(() => processService);

            _messageService           = messageService;
            _solutionGeneratorService = solutionGeneratorService;
            _processService           = processService;

            Generate = new Command(OnGenerateExecute, OnGenerateCanExecute);

            Solution = new Solution();
        }
Exemple #53
0
 public FormController(
     IOrchardServices services,
     IProcessService processService,
     ISecureFileService secureFileService,
     IFileService fileService
     )
 {
     _orchardServices   = services;
     _processService    = processService;
     _secureFileService = secureFileService;
     _fileService       = fileService;
     T      = NullLocalizer.Instance;
     Logger = NullLogger.Instance;
 }
Exemple #54
0
        public FileOpenInExternalToolCommandContainerBase(string commandName, string fileExtension, ICommandManager commandManager, IProjectManager projectManager,
                                                          IFileExtensionService fileExtensionService, IFileService fileService, IProcessService processService)
            : base(commandName, commandManager, projectManager)
        {
            Argument.IsNotNullOrEmpty(() => fileExtension);
            Argument.IsNotNull(() => fileExtensionService);
            Argument.IsNotNull(() => fileService);
            Argument.IsNotNull(() => processService);

            _fileService    = fileService;
            _processService = processService;

            _externalToolPath = fileExtensionService.GetRegisteredTool(fileExtension);
        }
Exemple #55
0
        public MainViewModel(IProcessService _processService)
        {
            ListAutomate   = AutomateService.GetAllData();
            ListProcess    = SimpleIoc.Default.GetInstance <IProcessService>().GetAllData();
            ListHistorique = SimpleIoc.Default.GetInstance <IHistoriqueService>().GetAllData();
            ListRedresseur = new ObservableCollection <Redresseur>();

            pulseVisibilityParam = new Visibility();
            PulseVisibilityParam = Visibility.Visible;

            tempoVisibilityParam = new Visibility();
            TempoVisibilityParam = Visibility.Visible;
            imageSource          = "../Resources/log_in1.png";

            foreach (DataService.Automate automate in ListAutomate)
            {
                foreach (Redresseur redresseur in ListAutomate[ListAutomate.IndexOf(automate)].Redresseurs)
                {
                    ListRedresseur.Add(redresseur);
                }
            }


            ListEtats = new ObservableCollection <AcoreApplication.Model.Constantes.MODES>();
            ListEtats.Add((AcoreApplication.Model.Constantes.MODES)Enum.Parse(typeof(AcoreApplication.Model.Constantes.MODES), "LocalRecette"));
            ListEtats.Add((AcoreApplication.Model.Constantes.MODES)Enum.Parse(typeof(AcoreApplication.Model.Constantes.MODES), "LocalManuel"));
            ListEtats.Add((AcoreApplication.Model.Constantes.MODES)Enum.Parse(typeof(AcoreApplication.Model.Constantes.MODES), "RemoteManuel"));
            ListEtats.Add((AcoreApplication.Model.Constantes.MODES)Enum.Parse(typeof(AcoreApplication.Model.Constantes.MODES), "Supervision"));
            ListEtats.Add((AcoreApplication.Model.Constantes.MODES)Enum.Parse(typeof(AcoreApplication.Model.Constantes.MODES), "RemoteRecette"));


            RedresseurSelected        = null;
            ProcessSelected           = ListProcess[0];
            RecetteSelected           = ProcessSelected.Recettes[0];
            historiqueSelectedSegment = null;

            AddingProcessCommand             = new RelayCommand <Object>(AddingProcess);
            AddingRecetteCommand             = new RelayCommand <AddingNewItemEventArgs>(AddingRecette);
            AddingSegmentCommand             = new RelayCommand <AddingNewItemEventArgs>(AddingSegment);
            AddingRedresseurCommand          = new RelayCommand <AddingNewItemEventArgs>(AddingRedresseur);
            LoadingSegmentCommand            = new RelayCommand <DataGridRowEventArgs>(LoadingSegment);
            EditingSegmentCommand            = new RelayCommand <DataGridRowEditEndingEventArgs>(EditingSegment);
            EditingRecetteCommand            = new RelayCommand <DataGridRowEditEndingEventArgs>(EditingRecette);
            EditingProcessCommand            = new RelayCommand <DataGridRowEditEndingEventArgs>(EditingProcess);
            RegistreLoadingRowCommand        = new RelayCommand <DataGridRowEventArgs>(RegistreLoadingRow);
            SelectedProcessChangedCommand    = new RelayCommand <SelectionChangedEventArgs>(SelectedProcessChanged);
            SelectedRecetteChangedCommand    = new RelayCommand <SelectionChangedEventArgs>(SelectedRecetteChanged);
            SelectedHistoriqueChangedCommand = new RelayCommand <SelectionChangedEventArgs>(SelectedHistoriqueChanged);
            ValideButton = new RelayCommand <Object>(valideButton);
        }
        /// <summary>
        /// Creates an instance of the controller.
        /// </summary>
        /// <param name="startupScript">The script to run at startup, default is null.</param>
        /// <param name="workingDirectory">The working directory, default is null.</param>
        /// <param name="replEngine">The REPL engine.</param>
        /// <param name="processService">Service for starting windows processes.</param>
        /// <param name="dispatcherScheduler">The Reactive extensions shceduler for the UI thread (dispatcher).</param>
        /// <param name="taskScheduler">The Reactive extensiosn scheduler for the task pool scheduler.</param>
        public ReplEngineController(string startupScript = null,
            string workingDirectory = null,
            IReplEngine replEngine = null,
            IProcessService processService = null,
            IScheduler dispatcherScheduler = null,
            IScheduler taskScheduler = null)
        {
            _startupScript = startupScript;
            _processService = processService ?? new ProcessService();
            _disposable = new CompositeDisposable();

            _replEngine = replEngine ?? CreateEngine(workingDirectory);
            _dispatcherScheduler = dispatcherScheduler ?? DispatcherScheduler.Current;
            _taskPoolScheduler = taskScheduler ?? TaskPoolScheduler.Default;
        }
        public EntryViewModel(IEntry entry, IPleaseWaitService pleaseWaitService, ICrawlerService crawlerService, IProcessService processService, 
            ISettings settings)
        {
            Argument.IsNotNull(() => entry);
            Argument.IsNotNull(() => pleaseWaitService);
            Argument.IsNotNull(() => crawlerService);
            Argument.IsNotNull(() => processService);
            Argument.IsNotNull(() => settings);

            Entry = entry;
            _pleaseWaitService = pleaseWaitService;
            _crawlerService = crawlerService;
            _processService = processService;
            _settings = settings;

            OpenInBrowser = new Command(OnOpenInBrowserExecute, OnOpenInBrowserCanExecute);
        }
 public TransactionController(IWorkflowService workflowService, 
                    IProcessService processService, 
                    ISubProcessService subProcessService, 
                    IClassificationService classificationService, INodeService nodeService,
                    IDocumentMappingService documentMappingService,
                    IWorkflowMappingService workflowMappingService,
                    INotificationMappingService notificationMappingService )
 {
     this.workflowService = workflowService;
     this.processService = processService;
     this.subProcessService= subProcessService;;
     this.classificationService= classificationService;
     this.documentMappingService = documentMappingService;
     this.notificationMappingService = notificationMappingService;
     this.workflowMappingService = workflowMappingService;
     this.nodeService = nodeService;
     this.service = new Service(this.processService, this.subProcessService, this.classificationService);
 }
        /// <summary>
        /// Creates an instance of the REPL engine ViewModel.
        /// </summary>
        /// <param name="replState">Reactive extensions stream of the REPL engine state.</param>
        /// <param name="replOutput">Reactive extensions stream of the REPL engine output.</param>
        /// <param name="replError">Reactive extensions stream of the REPL engine errors.</param>
        /// <param name="workingDirectory">Reactive extensions stream of the REPL engine working directory.</param>
        /// <param name="processService">Handles starting windows processes.</param>
        public ReplEngineViewModel(IObservable<State> replState,
            IObservable<ReplLineViewModel> replOutput,
            IObservable<ReplLineViewModel> replError,
            string workingDirectory,
            IProcessService processService)
        {
            _workingDirectory = workingDirectory;
            _processService = processService;
            _state = Core.State.Unknown;
            _output = new ObservableCollection<ReplLineViewModel>();

            _reset = new Subject<Unit>();
            _execute = new Subject<string>();

            ClearCommand = new ReplRelayCommand(Clear, CanClear);
            ResetCommand = new ReplRelayCommand(ResetImpl, CanReset);
            ExecuteCommand = new ReplRelayCommand<string>(ExecuteImpl, CanExecute);
            OpenWorkingFolderCommand = new ReplRelayCommand(OpenWorkingFolder);

            _disposable = new CompositeDisposable
            {
                Disposable.Create(() =>
                                  {
                                        ClearCommand = null;
                                        ResetCommand = null;
                                        ExecuteCommand = null;
                                  }),
                _reset,
                _execute,
                replState.Subscribe(UpdateState),
                replOutput.Where(x => x.Value != Prompt)
                    .Subscribe(x =>
                    {
                        _output.Add(x);
                        CommandManager.InvalidateRequerySuggested();
                    }),
                replError.Where(x => x.Value != Prompt)
                    .Subscribe(x =>
                    {
                        _output.Add(x);
                        CommandManager.InvalidateRequerySuggested();
                    })
            };
        }
Exemple #60
0
        public RibbonViewModel(INavigationService navigationService, 
            IUIVisualizerService uiVisualizerService,
            ICommandManager commandManager, 
            IRecentlyUsedItemsService recentlyUsedItemsService, 
            IOpenFileService openFileService,
            IMessageService messageService,
            IProcessService processService,
            IFileService fileService)
        {
            Argument.IsNotNull(() => navigationService);
            Argument.IsNotNull(() => uiVisualizerService);
            Argument.IsNotNull(() => commandManager);
            Argument.IsNotNull(() => recentlyUsedItemsService);
            Argument.IsNotNull(() => openFileService);
            Argument.IsNotNull(() => messageService);
            Argument.IsNotNull(() => processService);
            Argument.IsNotNull(() => fileService);

            _navigationService = navigationService;
            _uiVisualizerService = uiVisualizerService;
            _recentlyUsedItemsService = recentlyUsedItemsService;
            _openFileService = openFileService;
            _messageService = messageService;
            _processService = processService;
            _fileService = fileService;

            Help = new Command(OnHelpExecute);
            Open = new Command(this.OnOpenExecute);
            Exit = new Command(OnExitExecute);
            ShowKeyboardMappings = new Command(OnShowKeyboardMappingsExecute);

            OpenRecentlyUsedItem = new Command<string>(OnOpenRecentlyUsedItemExecute);
            UnpinItem = new Command<string>(OnUnpinItemExecute);
            PinItem = new Command<string>(OnPinItemExecute);
            OpenInExplorer = new Command<string>(OnOpenInExplorerExecute);

            OnRecentlyUsedItemsServiceUpdated(null, null);

            commandManager.RegisterCommand("Help.About", Help, this);
            commandManager.RegisterCommand("File.Open", Open, this);
            commandManager.RegisterCommand("File.Exit", Exit, this);
        }