public SearchResultsPageViewModel(ApplicationSettings settings, INavigationService navigationService, IImageSearchService imageSearchService, IHub hub, IAccelerometer accelerometer, IStatusService statusService, IShareDataRequestedPump shareMessagePump)
        {
            _settings = settings;
            _navigationService = navigationService;
            _imageSearchService = imageSearchService;
            _hub = hub;
            _accelerometer = accelerometer;
            _statusService = statusService;

            HomeCommand = _navigationService.GoBackCommand;
            ViewDetailsCommand = new DelegateCommand(ViewDetails, () => SelectedImage != null);
            LoadMoreCommand = new AsyncDelegateCommand(LoadMore);
            ThumbnailViewCommand = new DelegateCommand(ThumbnailView);
            ListViewCommand = new DelegateCommand(ListView);
            SplitViewCommand = new DelegateCommand(SplitView);
            SettingsCommand = new DelegateCommand(Settings);

            AddImages(_settings.SelectedInstance.Images);
            shareMessagePump.DataToShare = _settings.SelectedInstance.QueryLink;
            _statusService.Title = _settings.SelectedInstance.Query;
            _accelerometer.Shaken += accelerometer_Shaken;
            _navigationService.Navigating += NavigatingFrom;

            UpdateCurrentView(CurrentView);
            _hub.Send(new UpdateTileImageCollectionMessage(_settings.SelectedInstance));
        }
Пример #2
0
        //private readonly ILogger logger;

        public EArchiveController(IHttpContextAccessor accessor,
                                  IMapper mapper,
                                  IMailArchiveService mailArchiveService,
                                  IWorkPlaceService workPlaceService,
                                  IClassificationService classificationService,
                                  IMailTypeService mailTypeService,
                                  IPostTypeService postTypeService,
                                  ISecurityService securityService,
                                  IStatusService statusService,
                                  IImageArchiveService imageArchiveService,
                                  IUserService userService
                                  //ILogger logger
                                  ) : base(accessor, userService)
        {
            this.accessor              = accessor;
            this.mapper                = mapper;
            this.mailArchiveService    = mailArchiveService;
            this.workPlaceService      = workPlaceService;
            this.classificationService = classificationService;
            this.mailTypeService       = mailTypeService;
            this.postTypeService       = postTypeService;
            this.securityService       = securityService;
            this.statusService         = statusService;
            this.imageArchiveService   = imageArchiveService;
            //this.logger = logger;
        }
Пример #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="StatusLogListener"/> class.
        /// </summary>
        /// <param name="statusService">The status service.</param>
        public StatusLogListener(IStatusService statusService)
        {
            _statusService = statusService;

            IgnoreCatelLogging = true;
            IsDebugEnabled = false;
        }
Пример #4
0
        public frmClient(IStatusService service, IList<string> apps)
        {
            InitializeComponent();

            this.service = service;
            this.apps = apps;
        }
Пример #5
0
        /// <summary>
        /// Inserts the specified child into the specified parent if possible and returns true
        /// iff successful</summary>
        /// <param name="context">Should be ITransactionContext to support undo/redo. Must be
        /// IHierarchicalInsertionContext and/or IInstancingContext to succeed.</param>
        /// <param name="parent">Optional. Parent object to which the new child is added. Can be
        /// null if the context supports it.</param>
        /// <param name="child">New child object to be inserted into the specified parent</param>
        /// <param name="operationName">Used to register the operation in the transaction context
        /// and to update the status if successful. Can be the empty string, but must not be null.</param>
        /// <param name="statusService">Optional. Status service that is updated if the operation
        /// was successful. Can be null.</param>
        /// <returns>True iff the insertion was successful</returns>
        /// <remarks>The context must implement IHierarchicalInsertionContext and/or IInstancingContext
        /// to allow insertion. If the context implements both, IHierarchicalInsertionContext is preferred and
        /// any insertion logic in the IInstancingContext implementation is ignored!</remarks>
        public static bool Insert(object context, object parent, object child, string operationName, IStatusService statusService)
        {
            ITransactionContext transactionContext = context.As<ITransactionContext>();

            if (CanInsert(context, parent, child))
            {
                if (transactionContext != null)
                {
                    // If we have a TransactionContext perform a transaction to make sure undo/redo is supported
                    transactionContext.DoTransaction(delegate
                        {
                            DoInsert(context, parent, child);
                        },
                        operationName);
                }
                else
                {
                    // If we don't have a transaction context just perform the insert
                    // and assume that our client does not support undo/redo functionality
                    DoInsert(context, parent, child);
                }

                // Update the status service if available.
                if (statusService != null)
                    statusService.ShowStatus(operationName);

                return true;
            }

            return false;
        }
Пример #6
0
        public BaseTest()
        {
            // var serviceProvider = new ServiceCollection()
            ////.AddEntityFrameworkSqlServer()
            //.AddEntityFrameworkNpgsql()
            //.AddTransient<ITestService, TestService>()
            //.BuildServiceProvider();

            DbContextOptionsBuilder <StatusDatabaseContext> builder = new DbContextOptionsBuilder <StatusDatabaseContext>();
            var connectionString = "server=localhost;userid=root;password=12345678;database=StatusDatabase;";

            builder.UseMySql(connectionString);
            //.UseInternalServiceProvider(serviceProvider); //burası postgress ile sıkıntı çıkartmıyor, fakat mysql'de çalışmıyor test esnasında hata veriyor.

            _statusDatabaseContext = new StatusDatabaseContext(builder.Options);
            //_context.Database.Migrate();

            StatusSettings _statusSettings = new StatusSettings()
            {
                FileUploadFolderPath = "c:/"
            };
            IOptions <StatusSettings> statusOptions        = Options.Create(_statusSettings);
            IHttpContextAccessor      iHttpContextAccessor = new HttpContextAccessor {
                HttpContext = new DefaultHttpContext()
            };

            _statusService = new StatusService(_statusDatabaseContext, statusOptions, iHttpContextAccessor);
        }
Пример #7
0
        /// <inheritdoc/>
        protected override void OnShutdown()
        {
            // Stop monitoring editor.
            Editor.Activated                -= OnEditorActivated;
            Editor.Deactivated              -= OnEditorDeactivated;
            Editor.UIInvalidated            -= OnEditorUIInvalidated;
            Editor.ActiveDockTabItemChanged -= OnActiveDockTabItemChanged;
            Editor.WindowActivated          -= OnEditorWindowActivated;

            RemoveSearchScopes();
            RemoveCommandBindings();
            RemoveContextMenu();
            RemoveToolBars();
            RemoveMenus();
            RemoveCommands();
            RemoveDataTemplates();

            // Store the list of recently used files.
            SaveRecentFiles();

            // Clear services.
            _windowService = null;
            _statusService = null;
            _searchService = null;
        }
Пример #8
0
 public EquipoService(IEventLogService eventLogService, IEquipoRepository equipoRepository, ITipoEquipoRepository tipoEquipoRepository, IStatusService statusService)
 {
     _eventLogService      = eventLogService;
     _equipoRepository     = equipoRepository;
     _tipoEquipoRepository = tipoEquipoRepository;
     _statusService        = statusService;
 }
Пример #9
0
        public void SetUp()
        {
            _context = new Mock <IGenericRepository <Status> >();

            _statuses = new List <Status>()
            {
                new Status()
                {
                    StatusId = 1, Description = "status_a", IsInactive = false
                },
                new Status()
                {
                    StatusId = 2, Description = "status_b", IsInactive = true
                },
                new Status()
                {
                    StatusId = 3, Description = "status_c", IsInactive = false
                },
            };
            _newStatus = new Status()
            {
                StatusId = 4, Description = "status_d", IsInactive = false
            };
            _existingStatus = _statuses[0];
            _context
            .Setup(c => c.GetAll())
            .Returns(() => {
                return(_statuses.AsQueryable());
            });

            _statusService = new StatusService(_context.Object);
        }
Пример #10
0
 public OutlookPage(IStatusService statusService, IPageService pageSvc, IIconResourceService iconService, IPartRegistry partRegsistry)
 {
     m_StatusService = statusService;
     _pageSvc        = pageSvc;
     _iconService    = iconService;
     _partRegsistry  = partRegsistry;
 }
Пример #11
0
 public EvaluacionesController()
 {
     _evaluacionService    = ServiceLocator.Current.GetInstance <IEvaluacionService>();
     _localService         = ServiceLocator.Current.GetInstance <ILocalService>();
     _statusService        = ServiceLocator.Current.GetInstance <IStatusService>();
     _authorizationService = new AuthorizationService();
 }
Пример #12
0
 public RoleController(
     IAppUserService AppUserService,
     IMenuService MenuService,
     IRoleService RoleService,
     IPermissionService PermissionService,
     IOrganizationService OrganizationService,
     IProductService ProductService,
     IFieldService FieldService,
     IPermissionOperatorService PermissionOperatorService,
     IRequestStateService RequestStateService,
     IStatusService StatusService,
     ICustomerGroupingService CustomerGroupingService,
     IKnowledgeGroupService KnowledgeGroupService,
     ICurrentContext CurrentContext
     , IHttpContextAccessor httpContextAccessor, DataContext _DataContext
     ) : base(httpContextAccessor, _DataContext)
 {
     this.AppUserService            = AppUserService;
     this.MenuService               = MenuService;
     this.RoleService               = RoleService;
     this.PermissionService         = PermissionService;
     this.OrganizationService       = OrganizationService;
     this.ProductService            = ProductService;
     this.FieldService              = FieldService;
     this.StatusService             = StatusService;
     this.PermissionOperatorService = PermissionOperatorService;
     this.RequestStateService       = RequestStateService;
     this.CustomerGroupingService   = CustomerGroupingService;
     this.KnowledgeGroupService     = KnowledgeGroupService;
     this.CurrentContext            = CurrentContext;
 }
Пример #13
0
 public PropertyController(IPropertyService propertyService, IStatusService statusService, IRepairService repairService, ICommonListService commonListService)
 {
     _propertyService   = propertyService;
     _statusService     = statusService;
     _repairService     = repairService;
     _commonListService = commonListService;
 }
 public ApiController(
     IEntitiesContext entitiesContext,
     IPackageService packageService,
     IPackageFileService packageFileService,
     IUserService userService,
     INuGetExeDownloaderService nugetExeDownloaderService,
     IContentService contentService,
     IIndexingService indexingService,
     ISearchService searchService,
     IAutomaticallyCuratePackageCommand autoCuratePackage,
     IStatusService statusService,
     IAppConfiguration config)
 {
     EntitiesContext = entitiesContext;
     PackageService = packageService;
     PackageFileService = packageFileService;
     UserService = userService;
     NugetExeDownloaderService = nugetExeDownloaderService;
     ContentService = contentService;
     StatisticsService = null;
     IndexingService = indexingService;
     SearchService = searchService;
     AutoCuratePackage = autoCuratePackage;
     StatusService = statusService;
     _config = config;
 }
		/// <summary>
		/// create a new StatusServiceWcfProxy
		/// </summary>
		public StatusServiceWcfProxy()
		{
			if (_channel != null) return;
			_httpFactory =
			  new ChannelFactory<IStatusService>("StatusServiceEndpoint");
			_channel = _httpFactory.CreateChannel();
		}
 public NotificationMappingController(IWorkflowService workflowService, IStatusService statusService, INotificationMappingService notificationMappingService)
 {
     this.workflowService = workflowService;
     this.statusService = statusService;
     this.notificationMappingService = notificationMappingService;
     this.service = new Service(this.statusService, this.workflowService);
 }
Пример #17
0
        public StockQuoteManager(IServiceProvider provider, List <StockServiceSettings> settings, string logPath)
        {
            this._logPath = logPath;
            EnsurePathExists(logPath);
            this.Settings         = settings;
            this.provider         = provider;
            this.myMoney          = (MyMoney)provider.GetService(typeof(MyMoney));
            this.status           = (IStatusService)provider.GetService(typeof(IStatusService));
            this.myMoney.Changed += new EventHandler <ChangeEventArgs>(OnMoneyChanged);

            // assume we have fetched all securities.
            // call UpdateQuotes to refetch them all again, otherwise this
            // class will track changes and automatically fetch any new securities that it finds.
            foreach (Security s in myMoney.Securities.AllSecurities)
            {
                if (!string.IsNullOrEmpty(s.Symbol))
                {
                    lock (fetched)
                    {
                        fetched.Add(s.Symbol);
                    }
                }
            }
            _downloadLog = DownloadLog.Load(logPath);
        }
Пример #18
0
 public CommitsService(
     IMessage message,
     IRepositoryCommands repositoryCommands,
     Func <SetBranchPromptDialog> setBranchPromptDialogProvider,
     IGitCommitBranchNameService gitCommitBranchNameService,
     IDiffService diffService,
     ILinkService linkService,
     IRepositoryMgr repositoryMgr,
     IProgressService progressService,
     IStatusService statusService,
     IGitCommitService gitCommitService,
     IGitStatusService gitStatusService,
     Func <
         BranchName,
         IEnumerable <CommitFile>,
         string,
         bool,
         CommitDialog> commitDialogProvider)
 {
     this.commitDialogProvider = commitDialogProvider;
     this.gitCommitService     = gitCommitService;
     this.gitStatusService     = gitStatusService;
     this.message                       = message;
     this.repositoryCommands            = repositoryCommands;
     this.setBranchPromptDialogProvider = setBranchPromptDialogProvider;
     this.gitCommitBranchNameService    = gitCommitBranchNameService;
     this.diffService                   = diffService;
     this.linkService                   = linkService;
     this.repositoryMgr                 = repositoryMgr;
     this.progress                      = progressService;
     this.statusService                 = statusService;
 }
Пример #19
0
 protected override void EstablishContext()
 {
     base.EstablishContext();
     Timer = new Mock<ITimerService>();
     StatusService = new StatusService(Timer.Object);
     LifeTime = TimeSpan.FromSeconds(15);
 }
Пример #20
0
 public OrderController(IOrderService orderContext
                        , MyIdentityDbContext user, IStatusService statusContext)
 {
     _orderContext  = orderContext;
     _statusContext = statusContext;
     _user          = user;
 }
Пример #21
0
 public Form1()
 {
     _taskService     = InstanceFactory.GetInstance <ITaskService>();
     _priorityService = InstanceFactory.GetInstance <IPriorityService>();
     _statusService   = InstanceFactory.GetInstance <IStatusService>();
     InitializeComponent();
 }
Пример #22
0
        public MainWindowViewModel(IStatusService statusService)
        {
            PropertyChanged += delegate(object sender, PropertyChangedEventArgs args)
            {
                if (args.NameIs("ActiveContentSelector") ||
                    args.NameIs("SelectedItem"))
                {
                    // Set a content based on the new user's current state
                    // or the new content selector
                    if (SelectedItem != null && ActiveContentSelector != null)
                    {
                        ActiveContent = ActiveContentSelector.Select(SelectedItem);
                    }
                }
            };

            _statusService = statusService;
            statusService.PropertyChanged += delegate(object sender, PropertyChangedEventArgs e)
            {
                if (e.NameIs("Status"))
                {
                    FirePropertyChanged(this, "Status");
                }
            };
        }
Пример #23
0
 protected override void EstablishContext()
 {
     base.EstablishContext();
     Timer         = new Mock <ITimerService>();
     StatusService = new StatusService(Timer.Object);
     LifeTime      = TimeSpan.FromSeconds(15);
 }
Пример #24
0
 public SubscribeController(ISubscribeService subService, IPackageService pakService, ISetBoxService sbService, IStatusService statusService)
 {
     _subService     = subService;
     _packageService = pakService;
     _setBoxService  = sbService;
     _statusService  = statusService;
 }
 protected SessionViewModelBase(IRepository repository, IWindowService windowService, ShortcutService shortcutService, IStatusService statusService)
 {
     Repository      = repository;
     WindowService   = windowService;
     ShortcutService = shortcutService;
     StatusService   = statusService;
 }
Пример #26
0
        /// <summary>Constructor</summary>
        public TwilioService(IStatusService status)
        {
            _status     = status;
            _accountSid = Environment.GetEnvironmentVariable("TW_ASID", EnvironmentVariableTarget.User);
            _authToken  = Environment.GetEnvironmentVariable("TW_AT", EnvironmentVariableTarget.User);
            _fromNumber = Environment.GetEnvironmentVariable("TW_FP", EnvironmentVariableTarget.User);

            if (string.IsNullOrWhiteSpace(_accountSid))
            {
                throw new BadEnvironmentForTwilioException();
            }
            if (string.IsNullOrWhiteSpace(_authToken))
            {
                throw new BadEnvironmentForTwilioException();
            }
            if (string.IsNullOrWhiteSpace(_fromNumber))
            {
                throw new BadEnvironmentForTwilioException();
            }

            this.GiftExchangeName = $"Secret Santa {DateTime.Today.Year}";

            // New accounts and subaccounts are now required to use TLS 1.2 when accessing the REST API.
            //   If the error thrown is "Upgrade Required" what it really means, is you need your ServicePointManager to use TLS 1.2
            //   the line below does that.
            System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
        }
 public StatusController(IStatusService statusService, IInventoryService inventoryService, IProductService productService, IStockService stockService)
 {
     _statusService    = statusService;
     _inventoryService = inventoryService;
     _productService   = productService;
     _stockService     = stockService;
 }
Пример #28
0
        /// <summary>
        /// Initializes a new instance of the <see cref="StatusLogListener"/> class.
        /// </summary>
        /// <param name="statusService">The status service.</param>
        public StatusLogListener(IStatusService statusService)
        {
            _statusService = statusService;

            IgnoreCatelLogging = true;
            IsDebugEnabled     = false;
        }
Пример #29
0
 public EventController(IEventService eventService,
                        IStatusService statusService, UserManager <User> userManager)
 {
     _eventService  = eventService;
     _statusService = statusService;
     _userManager   = userManager;
 }
Пример #30
0
 public ValuesController(ITestService testService, ProductDatabaseContext productDatabaseContext, IHostingEnvironment hostingEnvironment, StatusDatabaseContext statusDatabaseContext, IStatusService iStatusService)
 {
     _iStatusService         = iStatusService;
     _testService            = testService;
     _productDatabaseContext = productDatabaseContext;
     _hostingEnvironment     = hostingEnvironment;
 }
Пример #31
0
        protected override void OnStartup()
        {
            // Mandatory services.
            _windowService = Editor.Services.GetInstance <IWindowService>().ThrowIfMissing();
            _statusService = Editor.Services.GetInstance <IStatusService>().ThrowIfMissing();

            // Optional services.
            _searchService = Editor.Services.GetInstance <ISearchService>().WarnIfMissing();

            // Add the command items and register menus, toolbars, and context menus.
            AddDataTemplates();
            AddCommands();
            AddMenus();
            AddToolBars();
            AddContextMenu();
            AddSearchScopes();

            // Load the list of recently used files.
            LoadRecentFiles();

            // Monitor editor.
            Editor.Activated                += OnEditorActivated; // This calls AddCommandBindings.
            Editor.Deactivated              += OnEditorDeactivated;
            Editor.UIInvalidated            += OnEditorUIInvalidated;
            Editor.ActiveDockTabItemChanged += OnActiveDockTabItemChanged;
            Editor.WindowActivated          += OnEditorWindowActivated;
        }
 public TasksController(ITaskService tasksService, IProjectService projectService, IUserService userService, IStatusService statusService)
 {
     _TasksService   = tasksService;
     _ProjectService = projectService;
     _UserService    = userService;
     _StatusService  = statusService;
 }
 public SearchQuerySubmittedHandler(ApplicationSettings settings, IImageSearchService imageSearchService, INavigationService navigationService, IStatusService statusService)
 {
     _settings           = settings;
     _imageSearchService = imageSearchService;
     _navigationService  = navigationService;
     _statusService      = statusService;
 }
        public QueryResultViewModel(IRepository repository, ShortcutService shortcutService, IStatusService statusService)
        {
            _repository    = repository;
            _statusService = statusService;
            var shortcutService1 = shortcutService;

            Items         = new ObservableCollection <MediaItem>();
            SelectedItems = new BatchObservableCollection <MediaItem>();
            SelectedItems.CollectionChanged  += SelectedItemsOnCollectionChanged;
            _thumbnailCancellationTokenSource = new CancellationTokenSource();

            shortcutService1.Next += (s, a) =>
            {
                if (CanExecuteSelectNextItem())
                {
                    SelectNextItem();
                }
            };
            shortcutService1.Previous += (s, a) =>
            {
                if (CanExecuteSelectPreviousItem())
                {
                    SelectPreviousItem();
                }
            };
        }
Пример #35
0
 public TenantController(ITenantService tenantService, IPropertyService propertyService, IStatusService statusService, ICommonListService commonListService)
 {
     _tenantService = tenantService;
     _propertyService = propertyService;
     _statusService = statusService;
     _commonListService = commonListService;
 }
Пример #36
0
 public ApiController(
     IApiScopeEvaluator apiScopeEvaluator,
     IEntitiesContext entitiesContext,
     IPackageService packageService,
     IPackageFileService packageFileService,
     IUserService userService,
     INuGetExeDownloaderService nugetExeDownloaderService,
     IContentService contentService,
     IIndexingService indexingService,
     ISearchService searchService,
     IAutomaticallyCuratePackageCommand autoCuratePackage,
     IStatusService statusService,
     IStatisticsService statisticsService,
     IMessageService messageService,
     IAuditingService auditingService,
     IGalleryConfigurationService configurationService,
     ITelemetryService telemetryService,
     AuthenticationService authenticationService,
     ICredentialBuilder credentialBuilder,
     ISecurityPolicyService securityPolicies,
     IReservedNamespaceService reservedNamespaceService,
     IPackageUploadService packageUploadService)
     : this(apiScopeEvaluator, entitiesContext, packageService, packageFileService, userService, nugetExeDownloaderService, contentService,
            indexingService, searchService, autoCuratePackage, statusService, messageService, auditingService,
            configurationService, telemetryService, authenticationService, credentialBuilder, securityPolicies,
            reservedNamespaceService, packageUploadService)
 {
     StatisticsService = statisticsService;
 }
Пример #37
0
        public NeuronTreePaneViewModel(INeuronApplicationService neuronApplicationService = null, INeuronQueryService neuronQueryService = null, INotificationApplicationService notificationApplicationService = null,
                                       IStatusService statusService = null, IDialogService dialogService = null, IOriginService originService = null)
        {
            this.dialogService                  = dialogService ?? Locator.Current.GetService <IDialogService>();
            this.neuronApplicationService       = neuronApplicationService ?? Locator.Current.GetService <INeuronApplicationService>();
            this.neuronQueryService             = neuronQueryService ?? Locator.Current.GetService <INeuronQueryService>();
            this.notificationApplicationService = notificationApplicationService ?? Locator.Current.GetService <INotificationApplicationService>();
            this.statusService                  = statusService ?? Locator.Current.GetService <IStatusService>();
            this.originService                  = originService ?? Locator.Current.GetService <IOriginService>();

            this.statusService.WhenPropertyChanged(s => s.Message)
            .Subscribe(s => this.StatusMessage = s.Sender.Message);

            bool DefaultPredicate(Node <Neuron, int> node) => node.IsRoot;

            var cache = new SourceCache <Neuron, int>(x => x.UIId);

            this.AddCommand       = ReactiveCommand.Create <object>(async(parameter) => await this.OnAddClicked(cache, parameter));
            this.SetRegionCommand = ReactiveCommand.Create <object>(async(parameter) => await this.OnSetRegionIdClicked(parameter));
            this.ReloadCommand    = ReactiveCommand.Create(async() => await this.OnReloadClicked(cache));

            this.cleanUp = cache.AsObservableCache().Connect()
                           .TransformToTree(child => child.CentralUIId, Observable.Return((Func <Node <Neuron, int>, bool>)DefaultPredicate))
                           .Transform(e =>
                                      e.Item.Type == RelativeType.Postsynaptic ?
                                      (NeuronViewModelBase)(new PostsynapticViewModel(this, e.Item.Tag, e, cache)) :
                                      (NeuronViewModelBase)(new PresynapticViewModel(this, e.Item.Tag, e, cache)))
                           .Bind(out this.children)
                           .DisposeMany()
                           .Subscribe();

            this.Target         = null;
            this.Loading        = false;
            this.IconSourcePath = @"pack://application:,,,/d23-wpf;component/images/hierarchy.ico";
        }
Пример #38
0
 public ApiController(
     IEntitiesContext entitiesContext,
     IPackageService packageService,
     IPackageFileService packageFileService,
     IUserService userService,
     INuGetExeDownloaderService nugetExeDownloaderService,
     IContentService contentService,
     IIndexingService indexingService,
     ISearchService searchService,
     IAutomaticallyCuratePackageCommand autoCuratePackage,
     IStatusService statusService,
     IMessageService messageService,
     ConfigurationService configurationService)
 {
     EntitiesContext           = entitiesContext;
     PackageService            = packageService;
     PackageFileService        = packageFileService;
     UserService               = userService;
     NugetExeDownloaderService = nugetExeDownloaderService;
     ContentService            = contentService;
     StatisticsService         = null;
     IndexingService           = indexingService;
     SearchService             = searchService;
     AutoCuratePackage         = autoCuratePackage;
     StatusService             = statusService;
     MessageService            = messageService;
     ConfigurationService      = configurationService;
 }
Пример #39
0
 public PurchaseController(IProductService productService, IPurchaseService purchaseService,
     IInvoiceService invoiceService, IStatusService statusService)
 {
     _productService = productService;
     _purchaseService = purchaseService;
     _invoiceService = invoiceService;
     _statusService = statusService;
 }
Пример #40
0
 public ProjectViewModelTests()
 {
     _dialogService = MockRepository.GenerateMock<IDialogService>();
     _projectService = MockRepository.GenerateMock<IProjectService>();
     _statusService = MockRepository.GenerateMock<IStatusService>();
     _windowManager = MockRepository.GenerateMock<IWindowManager>();
     _viewModelFactory = MockRepository.GenerateMock<IViewModelFactory>();
 }
        public StatusServiceTests()
        {
            var windowManager = MockRepository.GenerateMock<IWindowManager>();
            var viewModelFactory = MockRepository.GenerateMock<IViewModelFactory>();
            var projectService = MockRepository.GenerateMock<IProjectService>();

            _statusService = new ShellViewModel(windowManager, viewModelFactory, projectService);
        }
 public UserController()
 {
     _ctx = new CurrentContext();
     validationDictionary = new ModelStateWrapper(ModelState);
     _facade = new UserFacade(validationDictionary);
     _sshSecretService = new SshSecretService(validationDictionary, true);
     _statusService = new StatusService(validationDictionary);
     _profileService = new ProfileService(validationDictionary);
 }
Пример #43
0
 public WorkflowController(IWorkflowService workflowService, IDocumentMappingService documentMappingService,
     INotificationMappingService notificationMappingService, IWorkflowMappingService workflowMappingService,
     IStatusService statusService)
 {
     this.workflowService = workflowService;
     this.documentMappingService = documentMappingService;
     this.notificationMappingService = notificationMappingService;
     this.workflowMappingService = workflowMappingService;
 }
 public ShellViewModelTests()
 {
     _viewModelFactory = MockRepository.GenerateMock<IViewModelFactory>();
     _windowManager = MockRepository.GenerateMock<IWindowManager>();
     _projectService = MockRepository.GenerateMock<IProjectService>();
     _dialogService = MockRepository.GenerateMock<IDialogService>();
     _statusService = MockRepository.GenerateMock<IStatusService>();
     _exportService = MockRepository.GenerateMock<IExportService>();
     _projectViewModel = MockRepository.GenerateMock<ProjectViewModel>(_projectService, _dialogService, _statusService, _exportService, _viewModelFactory, _windowManager);
 }
Пример #45
0
        /// <summary>
        /// Initializes a new instance of the <see cref="StatusLogListener"/> class.
        /// </summary>
        /// <param name="statusService">The status service.</param>
        public StatusLogListener(IStatusService statusService)
        {
            _statusService = statusService;

            IgnoreCatelLogging = true;
            IsDebugEnabled = false;
            IsInfoEnabled = false;
            IsWarningEnabled = false;
            IsErrorEnabled = false;
            IsStatusEnabled = true;
        }
Пример #46
0
 public InvoiceController(IProductService productService, IPurchaseService purchaseService,
     IInvoiceService invoiceService, IStoreService storeInvoice, IUserService userService,
     ICustomerService customerService, IStatusService statusService)
 {
     _productService = productService;
     _purchaseService = purchaseService;
     _invoiceService = invoiceService;
     _storeInvoice = storeInvoice;
     _userService = userService;
     _customerService = customerService;
     _statusService = statusService;
 }
        public SearchHistoryPageViewModel(ApplicationSettings settings, INavigationService navigationService, IHub messageHub, IStatusService statusService)
        {
            _settings = settings;
            _navigationService = navigationService;
            _messageHub = messageHub;
            _statusService = statusService;

            _statusService.Title = "Searches";
            _settings.SelectedInstance = null;
            SearchCommand = new DelegateCommand(Search);
            SettingsCommand = new DelegateCommand(Settings);
            SearchQueryCommand = new AsyncDelegateCommand<string>(SearchQuery);
        }
Пример #48
0
 public ProjectViewModel(
     IProjectService projectService,
     IDialogService dialogService,
     IStatusService statusService,
     IViewModelFactory viewModelFactory,
     IWindowManager windowManager)
 {
     _projectService = projectService;
     _dialogService = dialogService;
     _statusService = statusService;
     _viewModelFactory = viewModelFactory;
     _windowManager = windowManager;
 }
Пример #49
0
        public TwitterCrawler(ITwitterRequestQueue requestQueue, ITwitterResponseQueue responseQueue, IStatusService statusService)
        {
            if (requestQueue == null)
                throw new ArgumentNullException("requestQueue");
            if (responseQueue == null)
                throw new ArgumentNullException("responseQueue");

            this.requestQueue = requestQueue;
            this.responseQueue = responseQueue;
            this.statusService = statusService;

            this.requestQueue.RequestReceived += (s, e) => ProcessRequest(e.TwitterRequest);
            this.requestQueue.BeginReceive();
        }
Пример #50
0
		private bool InitStatusService()
		{
			this.statusService = null;

			try
			{
				//string uri = ServiceStatusSettings.GetConfig().Servers["defaultService"].Description;

				string uri;

				if (ServiceStatusSettings.GetConfig().Servers["defaultService"] == null)
				{
					if (missingLogged == false)
					{
						string failMessage = "未能找到名为 defaultService 的状态服务配置,因此可能无法查看状态服务";
						EventLog.WriteEntry(ServiceMainSettings.SERVICE_NAME, failMessage, EventLogEntryType.Warning);
						if (this.InvokeRequired)
							this.Invoke(new Action<string>(this.ShowMessageBox), failMessage);
						else
							this.ShowMessageBox(failMessage);

						missingLogged = true;
					}
				}
				else
				{
					uri = ServiceStatusSettings.GetConfig().Servers["defaultService"].Description;

					try
					{
						//尝试获取当前应用注册的服务地址
						uri = GetServiceStatusUri();
					}
					catch (Exception ex)
					{
						EventLog.WriteEntry(ServiceMainSettings.SERVICE_NAME, ex.Message, EventLogEntryType.Warning);
					}

					this.statusService = (IStatusService)Activator.GetObject(typeof(IStatusService), uri);
				}
			}
			catch (Exception ex)
			{
				EventLog.WriteEntry(ServiceMainSettings.SERVICE_NAME, ex.Message, EventLogEntryType.Warning);
			}

			return this.statusService != null;
		}
Пример #51
0
 public ApiController(
     IEntitiesContext entitiesContext,
     IPackageService packageService,
     IPackageFileService packageFileService,
     IUserService userService,
     INuGetExeDownloaderService nugetExeDownloaderService,
     IContentService contentService,
     IIndexingService indexingService,
     ISearchService searchService,
     IAutomaticallyCuratePackageCommand autoCuratePackage,
     IStatusService statusService,
     IStatisticsService statisticsService)
     : this(entitiesContext, packageService, packageFileService, userService, nugetExeDownloaderService, contentService, indexingService, searchService, autoCuratePackage, statusService)
 {
     StatisticsService = statisticsService;
 }
        public DetailsPageViewModel(ApplicationSettings settings, INavigationService navigationService, IHub messageHub, IShareDataRequestedPump shareMessagePump, IStatusService statusService)
        {
            _settings = settings;
            _navigationService = navigationService;
            _messageHub = messageHub;
            _shareMessagePump = shareMessagePump;
            _statusService = statusService;

            statusService.Title = _settings.SelectedImage.Title;
            _shareMessagePump.DataToShare = _settings.SelectedImage;

            BackCommand = _navigationService.GoBackCommand;
            SaveCommand = new AsyncDelegateCommand(Save);
            SetLockScreenCommand = new AsyncDelegateCommand(SetLockScreen);
            SetTileCommand = new DelegateCommand(SetTile);
            ShareCommand = new DelegateCommand(Share);
            SettingsCommand = new DelegateCommand(Settings);
        }
Пример #53
0
        public void TestSetup()
        {
            pageService = new PageService(ConfigurationSettings.AppSettings["backpack.account.name"].ToString(), ConfigurationSettings.AppSettings["backpack.account.token"].ToString());
            journalService = new JournalService(ConfigurationSettings.AppSettings["backpack.account.name"].ToString(), ConfigurationSettings.AppSettings["backpack.account.token"].ToString());
            listsService = new ListsService(ConfigurationSettings.AppSettings["backpack.account.name"].ToString(), ConfigurationSettings.AppSettings["backpack.account.token"].ToString());
            listItemsService = new ListItemsService(ConfigurationSettings.AppSettings["backpack.account.name"].ToString(), ConfigurationSettings.AppSettings["backpack.account.token"].ToString());
            notesService = new NotesService(ConfigurationSettings.AppSettings["backpack.account.name"].ToString(), ConfigurationSettings.AppSettings["backpack.account.token"].ToString());
            separatorService = new SeparatorService(ConfigurationSettings.AppSettings["backpack.account.name"].ToString(), ConfigurationSettings.AppSettings["backpack.account.token"].ToString());
            statusService = new StatusService(ConfigurationSettings.AppSettings["backpack.account.name"].ToString(), ConfigurationSettings.AppSettings["backpack.account.token"].ToString());
            tagsService = new TagsService(ConfigurationSettings.AppSettings["backpack.account.name"].ToString(), ConfigurationSettings.AppSettings["backpack.account.token"].ToString());
            userService = new UserService(ConfigurationSettings.AppSettings["backpack.account.name"].ToString(), ConfigurationSettings.AppSettings["backpack.account.token"].ToString());

            testPageId = ConfigurationSettings.AppSettings["backpack.pages.testpage"].ToString();
            testUserId = ConfigurationSettings.AppSettings["backpack.users.testuserid"].ToString();
            testInvalidUserId = ConfigurationSettings.AppSettings["backpack.users.testinvaliduserid"].ToString();
            testTagId = ConfigurationSettings.AppSettings["backpack.pages.testtagid"].ToString();
            testPageTitle = ConfigurationSettings.AppSettings["backpack.pages.testpagetitle"].ToString();
        }
Пример #54
0
 public BidController(IBidService bidService, IBidDetailService bidDetailService,
                      IAdminUnitService adminUnitService,
                      IStatusService statusService,
                      ITransportBidPlanService transportBidPlanService,
                      ITransportBidPlanDetailService transportBidPlanDetailService,
                      IApplicationSettingService applicationSettingService,IUserAccountService userAccountService,
                      ITransportBidQuotationService transportBidQuotationService, IBidWinnerService bidWinnerService,
                     ITransporterService transporterService, IHubService hubService,IWorkflowStatusService workflowStatusService)
 {
     _bidService = bidService;
     _bidDetailService = bidDetailService;
     _adminUnitService = adminUnitService;
     _statusService = statusService;
     _transportBidPlanService = transportBidPlanService;
     _transportBidPlanDetailService = transportBidPlanDetailService;
     _applicationSettingService = applicationSettingService;
     _userAccountService = userAccountService;
     _transportBidQuotationService = transportBidQuotationService;
     _bidWinnerService = bidWinnerService;
     _transporterService = transporterService;
     _hubService = hubService;
     _workflowStatusService = workflowStatusService;
 }
 public DeleteAllCommand(IStatusService statusService)
 {
     this.statusService = statusService;
 }
Пример #56
0
        void InitAppTypes(IStatusService s)
        {
            checkedListBox1.Items.Clear();
            checkedListBox2.Items.Clear();

            var apps = s.GetSubscribeApps();
            foreach (var app in apps)
            {
                checkedListBox1.Items.Add(app);
            }
            var types = s.GetSubscribeTypes();
            foreach (var type in types)
            {
                checkedListBox2.Items.Add(type);
            }
        }
Пример #57
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                if (button1.Tag == null)
                {
                    if (defaultNode == null)
                    {
                        MessageBox.Show("请选择监控节点!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }

                    if (checkBox3.Checked)
                    {
                        var timer = Convert.ToInt32(numericUpDown2.Value);
                        var url = ConfigurationManager.AppSettings["ServerMonitorUrl"];

                        if (!string.IsNullOrEmpty(url))
                        {
                            if (url.IndexOf('?') > 0)
                                url = url + "&timer=" + timer;
                            else
                                url = url + "?timer=" + timer;
                            webBrowser2.Navigate(url);
                        }
                    }

                    var listener = new StatusListener(tabControl1, listConnect, listTimeout, listError,
                        Convert.ToInt32(numericUpDown3.Value), Convert.ToInt32(numericUpDown5.Value),
                        Convert.ToInt32(numericUpDown1.Value), Convert.ToInt32(numericUpDown4.Value), checkBox4.Checked);

                    service = CastleFactory.Create().GetChannel<IStatusService>(defaultNode, listener);

                    //var services = service.GetServiceList();

                    var options = new SubscribeOptions
                    {
                        PushCallError = checkBox1.Checked,
                        PushCallTimeout = checkBox2.Checked,
                        PushServerStatus = checkBox3.Checked,
                        PushClientConnect = true,
                        CallTimeout = Convert.ToDouble(numericUpDown1.Value) / 1000,
                        CallRowCount = Convert.ToInt32(numericUpDown5.Value),
                        ServerStatusTimer = Convert.ToInt32(numericUpDown2.Value)
                    };

                    try
                    {
                        service.Subscribe(options);

                        button1.Text = "停止监控";
                        button1.Tag = label1.Text;
                        label1.Text = "正在进行监控...";

                        checkBox1.Enabled = false;
                        checkBox2.Enabled = false;
                        checkBox3.Enabled = false;
                        comboBox1.Enabled = false;

                        numericUpDown1.Enabled = checkBox2.Enabled && checkBox2.Checked;
                        numericUpDown2.Enabled = checkBox3.Enabled && checkBox3.Checked;

                        checkBox4.Enabled = false;
                        numericUpDown3.Enabled = false;
                        numericUpDown4.Enabled = false;
                        numericUpDown5.Enabled = false;
                        //button1.Enabled = false;
                    }
                    catch (Exception ex)
                    {
                        SimpleLog.Instance.WriteLogForDir("Client", ex);
                        MessageBox.Show(ex.Message, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    if (sender != null)
                    {
                        if (MessageBox.Show("确定停止监控吗?", "系统提示",
                            MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.Cancel) return;
                    }

                    try
                    {
                        service.Unsubscribe();
                    }
                    catch (Exception ex)
                    {
                        SimpleLog.Instance.WriteLogForDir("Client", ex);
                        MessageBox.Show(ex.Message, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }

                    checkedListBox1.Items.Clear();
                    checkedListBox2.Items.Clear();

                    label1.Text = button1.Tag.ToString();
                    button1.Text = "开始监控";
                    button1.Tag = null;

                    //listConnect.Items.Clear();
                    //listError.Items.Clear();
                    //listTimeout.Items.Clear();

                    //listConnect.Invalidate();
                    //listError.Invalidate();
                    //listTimeout.Invalidate();

                    tabPage1.Text = "连接信息" + (listConnect.Items.Count == 0 ? "" : "(" + listConnect.Items.Count + ")");
                    tabPage2.Text = "警告信息" + (listTimeout.Items.Count == 0 ? "" : "(" + listTimeout.Items.Count + ")");
                    tabPage3.Text = "异常信息" + (listError.Items.Count == 0 ? "" : "(" + listError.Items.Count + ")");

                    checkBox1.Enabled = true;
                    checkBox2.Enabled = true;
                    checkBox3.Enabled = true;
                    comboBox1.Enabled = true;

                    numericUpDown1.Enabled = checkBox2.Enabled && checkBox2.Checked;
                    numericUpDown2.Enabled = checkBox3.Enabled && checkBox3.Checked;

                    try { webBrowser1.Document.GetElementsByTagName("body")[0].InnerHtml = string.Empty; }
                    catch { }

                    checkBox4.Enabled = true;
                    numericUpDown3.Enabled = true;
                    numericUpDown4.Enabled = true;
                    numericUpDown5.Enabled = true;
                    //button1.Enabled = true;
                }
            }
            catch (Exception ex)
            {
                SimpleLog.Instance.WriteLogForDir("Client", ex);
                MessageBox.Show(ex.Message, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #58
0
        //--------------------------------------------------------------
        #region Creation & Cleanup
        //--------------------------------------------------------------

        /// <summary>
        /// Initializes a new instance of the <see cref="ModelDocument"/> class.
        /// </summary>
        /// <param name="editor">The editor.</param>
        /// <param name="documentType">The type of the document.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="editor"/> or <paramref name="documentType"/> is <see langword="null"/>.
        /// </exception>
        internal ModelDocument(IEditorService editor, DocumentType documentType)
          : base(editor, documentType)
        {
            _modelsExtension = editor.Extensions.OfType<ModelsExtension>().FirstOrDefault().ThrowIfMissing();
            _useDigitalRuneGraphics = _modelsExtension.UseDigitalRuneGraphics;

            var services = Editor.Services;
            _documentService = services.GetInstance<IDocumentService>().ThrowIfMissing();
            _statusService = services.GetInstance<IStatusService>().ThrowIfMissing();
            _outputService = services.GetInstance<IOutputService>().ThrowIfMissing();
            _animationService = services.GetInstance<IAnimationService>().ThrowIfMissing();
            _monoGameService = services.GetInstance<IMonoGameService>().ThrowIfMissing();
            _outlineService = services.GetInstance<IOutlineService>().WarnIfMissing();
            _propertiesService = services.GetInstance<IPropertiesService>().WarnIfMissing();
            _errorService = services.GetInstance<IErrorService>().WarnIfMissing();

            Editor.ActiveDockTabItemChanged += OnEditorDockTabItemChanged;

            UpdateProperties();
            UpdateOutline();
        }
 public StatusController(IStatusService statusService)
 {
     this._statusService = statusService;
 }
 public StatusActionFilter(IStatusService statusService)
 {
     this._statusService = statusService;
 }