Ejemplo n.º 1
0
        /// <summary>
        /// Initializes this instance
        /// </summary>
        public RationalFileWatcher(ISettingsHelper settingsHelper)
        {
            InitializeComponent();

            this.SettingsHelper = settingsHelper;

            // setup the encoding combo box
            this.comboBoxEncoding.ItemsSource = Encoding.GetEncodings();
            Binding bindingEncoding = new Binding("TailEncoding");
            bindingEncoding.Source = this;
            this.comboBoxEncoding.SetBinding(ComboBox.SelectedItemProperty, bindingEncoding);
            comboBoxEncoding.DisplayMemberPath = "DisplayName";
            comboBoxEncoding.SelectedValuePath = "DisplayName";

            // bind the follow tail checkbox
            Binding bindingFollowTail = new Binding("IsFollowTail");
            bindingFollowTail.Source = this;
            this.checkBoxFollowTail.SetBinding(CheckBox.IsCheckedProperty, bindingFollowTail);

            Binding bindingStopFollowTail = new Binding("IsStopFollowTail");
            bindingStopFollowTail.Source = this;
            this.checkBoxStopFollowingTailOnNextHighlight.SetBinding(CheckBox.IsCheckedProperty, bindingStopFollowTail);

            this._bw = new BackgroundWorker();
            this._bw.WorkerSupportsCancellation = true;
            this._bw.DoWork += new DoWorkEventHandler(_bw_DoWork);
            this._bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(_bw_RunWorkerCompleted);

            this.SelectedItem = new List<HighlightedItem>();
            this.LastReadStream = new MemoryStream();
            this.CollectionBackBuffer = new List<HighlightedItem>();
        }
Ejemplo n.º 2
0
 public SecretsHelper(ISettingsHelper settingsHelper, AuthenticationHelper authHelper, IVault vault, ISecretsProvider secretsProvider)
 {
     SettingsHelper       = settingsHelper;
     AuthenticationHelper = authHelper;
     this.vault           = vault;
     this.secretsProvider = secretsProvider;
 }
Ejemplo n.º 3
0
 public MainViewModel(PhotoStationClient photoStationClient, INavigationService navigationService, ISettingsHelper settingsHelper)
 {
     this.photoClient       = photoStationClient;
     this.navigationService = navigationService;
     this.settingsHelper    = settingsHelper;
     GoToSettingsCommand    = new RelayCommand(HandleGoToSettingsCommand);
 }
Ejemplo n.º 4
0
 public ExampleServiceHelper(IWebServiceHelper serviceHelper, ICacheHandler cacheHandler, ILogHelper logHelper, ISettingsHelper settingsHelper)
 {
     this.ServiceHelper  = serviceHelper;
     this.CacheHandler   = cacheHandler;
     this.LogHelper      = logHelper;
     this.SettingsHelper = settingsHelper;
 }
 public WindowService(ISettingsHelper settingsHelper, ISettingsService settingsService, IAuthorizationService authorizationService, IWindowFactory windowFactory)
 {
     _settingsHelper       = settingsHelper;
     _settingsService      = settingsService;
     _authorizationService = authorizationService;
     _windowFactory        = windowFactory;
 }
Ejemplo n.º 6
0
 public AuthenticationHelper(ISettingsHelper settingsHelper, IAuthBroker authBroker, ISecretsProvider secretsProvider, IHttpClient httpClient)
 {
     SettingsHelper       = settingsHelper;
     AuthBroker           = authBroker;
     this.secretsProvider = secretsProvider;
     this.httpClient      = httpClient;
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Initializes this instance
        /// </summary>
        public RationalFileWatcher(ISettingsHelper settingsHelper)
        {
            InitializeComponent();

            this.SettingsHelper = settingsHelper;

            // setup the encoding combo box
            this.comboBoxEncoding.ItemsSource = Encoding.GetEncodings();
            Binding bindingEncoding = new Binding("TailEncoding");

            bindingEncoding.Source = this;
            this.comboBoxEncoding.SetBinding(ComboBox.SelectedItemProperty, bindingEncoding);
            comboBoxEncoding.DisplayMemberPath = "DisplayName";
            comboBoxEncoding.SelectedValuePath = "DisplayName";

            // bind the follow tail checkbox
            Binding bindingFollowTail = new Binding("IsFollowTail");

            bindingFollowTail.Source = this;
            this.checkBoxFollowTail.SetBinding(CheckBox.IsCheckedProperty, bindingFollowTail);

            Binding bindingStopFollowTail = new Binding("IsStopFollowTail");

            bindingStopFollowTail.Source = this;
            this.checkBoxStopFollowingTailOnNextHighlight.SetBinding(CheckBox.IsCheckedProperty, bindingStopFollowTail);

            this._bw = new BackgroundWorker();
            this._bw.WorkerSupportsCancellation = true;
            this._bw.DoWork             += new DoWorkEventHandler(_bw_DoWork);
            this._bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(_bw_RunWorkerCompleted);

            this.SelectedItem         = new List <HighlightedItem>();
            this.LastReadStream       = new MemoryStream();
            this.CollectionBackBuffer = new List <HighlightedItem>();
        }
 public void SetUp()
 {
     _settingsService      = A.Fake <ISettingsService>();
     _authorizationService = A.Fake <IAuthorizationService>();
     _windowFactory        = A.Fake <IWindowFactory>();
     _settingsHelper       = A.Fake <ISettingsHelper>();
     _settingsViewModel    = new SettingsViewModel(_settingsService, _authorizationService, _windowFactory, _settingsHelper);
 }
Ejemplo n.º 9
0
 public SettingsController(
     ApplicationDbContext context,
     ISettingsHelper settingsHelper
     )
 {
     _context        = context;
     _settingsHelper = settingsHelper;
 }
Ejemplo n.º 10
0
        public ApiHelper(ILoggedInUserModel loggedInUser, ISettingsHelper settings)
        {
            _settings = settings;

            InitializeClient();

            LoggedInUser = loggedInUser;
        }
 public void SetUp()
 {
     _authorizationService = A.Fake <IAuthorizationService>();
     _windowFactory        = A.Fake <IWindowFactory>();
     _settingsHelper       = A.Fake <ISettingsHelper>();
     _settingsService      = A.Fake <ISettingsService>();
     _windowService        = new WindowService(_settingsHelper, _settingsService, _authorizationService, _windowFactory);
 }
Ejemplo n.º 12
0
        /// <summary>
        /// Initialize this instance
        /// </summary>
        public ApplicationSettings(ISettingsHelper settingsHelper)
        {
            InitializeComponent();

            OxTail.Controls.ApplicationSettings ApplicationSettings = new OxTail.Controls.ApplicationSettings(settingsHelper);
            ApplicationSettings.SaveClick   += new RoutedEventHandler(ApplicationSettings_SaveClick);
            ApplicationSettings.CancelClick += new RoutedEventHandler(ApplicationSettings_CancelClick);
            this.Grid.Children.Add(ApplicationSettings);
        }
Ejemplo n.º 13
0
 /// <summary>
 /// Initialise instance
 /// </summary>
 public RecentFileList(IMostRecentFilesData data, IFileFactory fileFactory, ISettingsHelper settingsHelper)
 {
     this.SettingsHelper = settingsHelper;
     this.FileFactory    = fileFactory;
     this.Data           = data;
     this.Load();
     this.Header  = LanguageHelper.GetLocalisedText((Application.Current as IApplication), Constants.RECENT_FILES_MENUITEM_HEADER);
     this.Loaded += (s, e) => GetParentItem();
 }
Ejemplo n.º 14
0
        /// <summary>
        /// Initialize this instance
        /// </summary>
        public ApplicationSettings(ISettingsHelper settingsHelper)
        {
            InitializeComponent();

            OxTail.Controls.ApplicationSettings ApplicationSettings = new OxTail.Controls.ApplicationSettings(settingsHelper);
            ApplicationSettings.SaveClick += new RoutedEventHandler(ApplicationSettings_SaveClick);
            ApplicationSettings.CancelClick +=new RoutedEventHandler(ApplicationSettings_CancelClick);
            this.Grid.Children.Add(ApplicationSettings);
        }
Ejemplo n.º 15
0
 public static void Init(IAuthBroker broker, IVault vault, ISettingsHelper settingsHelper, string secretsJson, Func<IHttpClient> clientFactory, bool isCommercial)
 {
     AuthBroker = broker;
     Vault = vault;
     SettingsHelper = settingsHelper;
     SecretsJson = secretsJson;
     HttpClientFactory = clientFactory;
     IsCommercial = isCommercial;
 }
Ejemplo n.º 16
0
 private SettingsService()
 {
     _helper = new SettingsHelper();
     _passwordHelper = new PasswordHelper();
     if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
     {
         _isPhone = true;
     }
 }
Ejemplo n.º 17
0
        public SettingsViewModel()
        {
            _settingsHelper = ServiceLocator.Current.GetInstance <ISettingsHelper>();

            SaveSettingsCommand   = new CommandBase <SettingsViewModel>("Save", ExecuteSaveSettingsCommand);
            OpenFileDialogCommand = new CommandBase <SettingsViewModel>("Open", ExecuteOpenFileDialog);

            InitSettings();
        }
Ejemplo n.º 18
0
 /// <summary>
 /// Initialise instance
 /// </summary>
 public RecentFileList(IMostRecentFilesData data, IFileFactory fileFactory, ISettingsHelper settingsHelper)
 {
     this.SettingsHelper = settingsHelper;
     this.FileFactory = fileFactory;
     this.Data = data;
     this.Load();
     this.Header = LanguageHelper.GetLocalisedText((Application.Current as IApplication), Constants.RECENT_FILES_MENUITEM_HEADER);
     this.Loaded += (s, e) => GetParentItem();
 }
 public SettingsViewModel(INavigationService navigationService, PhotoStationClient photoStationClient, ISettingsHelper settingsHelper)
 {
     this.navigationService  = navigationService;
     this.photoStationClient = photoStationClient;
     this.settingsHelper     = settingsHelper;
     CheckCredetialsCommand  = new RelayCommand(HandleCheckCredetialsCommand);
     SaveSettingsCommand     = new RelayCommand(HandleSaveSettingsCommand, CanExecuteSettingsCommand);
     CancelCommand           = new RelayCommand(HandleCancelCommand);
     UseSmartAlbum           = true;
 }
Ejemplo n.º 20
0
 public CheckerHelper(IRepository <SubCheckType> subCheckTypes, IRepository <CheckResult> checkResults, ICheckRepository checks, IMapper mapper,
                      ISettingsHelper settingsHelper, IServiceProvider serviceProvider, ICheckLogger checkLogger, IConnectionMultiplexer connectionMultiplexer)
 {
     _subCheckTypes         = subCheckTypes;
     _checkResults          = checkResults;
     _checks                = checks;
     _settingsHelper        = settingsHelper;
     _serviceProvider       = serviceProvider;
     _checkLogger           = checkLogger;
     _connectionMultiplexer = connectionMultiplexer;
 }
Ejemplo n.º 21
0
        public void Instance_CalledTwice_ReturnsSameInstance()
        {
            // Setup
            ISettingsHelper expected = SettingsHelper.Instance;

            // Call
            ISettingsHelper actual = SettingsHelper.Instance;

            // Assert
            Assert.AreSame(expected, actual);
        }
 public SchedulerManager(ISchedulerFactory factory, IJobFactory jobFactory, ISettingsHelper settingsHelper, ICheckRepository checks,
                         ILogger <SchedulerManager> logger, ILoggerFactory loggerFactory, IJobHelper jobHelper)
 {
     _scheduler            = factory.GetScheduler().Result;
     _scheduler.JobFactory = jobFactory;
     _scheduler.ListenerManager.AddJobListener(new GlobalJobListener(loggerFactory.CreateLogger <GlobalJobListener>()), GroupMatcher <JobKey> .AnyGroup());
     _scheduler.ListenerManager.AddSchedulerListener(new GlobalSchedulerListener(loggerFactory.CreateLogger <GlobalSchedulerListener>(), this));
     _settingsHelper = settingsHelper;
     _checks         = checks;
     _logger         = logger;
     _jobHelper      = jobHelper;
 }
Ejemplo n.º 23
0
        public BaseDataProvider(string dataProviderName, string idTablePrefix, string parentTemplateId)
        {
            this.IdTablePrefix    = idTablePrefix;
            this.ParentTemplateId = parentTemplateId;

            var container = Bootstrapper.Container;

            this.DataProviderHelper = container.GetInstance <IDataProviderHelper>();
            this.SettingsHelper     = container.GetInstance <ISettingsHelper>();
            var factory = container.GetInstance <IDataProviderDamHelperFactory>();

            this.DataProviderDamHelper = factory.CreateNew(dataProviderName);
        }
        public MyScheduleViewModel(IScheduleService scheduleService, IUserIdLookupService userIdLookupService, 
            ISettingsHelper settingsHelper)
        {
            IsInitializing = true;
            _scheduleService = scheduleService;
            _userIdLookupService = userIdLookupService;
            _settingsHelper = settingsHelper;

            // consider more robust, using isolated storage file, DI/IOC etc. for app settings like this
            if (!IsInDesignMode)
            {
                ReadSettings();
            }

            IsInitializing = false;
        }
Ejemplo n.º 25
0
 public ImageController(
     ApplicationDbContext context,
     IAwsHelper awsHelper,
     ISettingsHelper settingsHelper,
     UserManager <ApplicationUser> userManager,
     SignInManager <ApplicationUser> signInManager
     )
 {
     _context        = context;
     _awsHelper      = awsHelper;
     _settingsHelper = settingsHelper;
     _userManager    = userManager;
     _signInManager  = signInManager;
     _bucketName     = _settingsHelper.Get(Settings.S3BucketName).GetAwaiter().GetResult();
     _imageCacheTime = TimeSpan.Parse(_settingsHelper.Get(Settings.ImageCacheTime).GetAwaiter().GetResult());
 }
Ejemplo n.º 26
0
 public AccountController(
     UserManager <ApplicationUser> userManager,
     SignInManager <ApplicationUser> signInManager,
     IEmailSender emailSender,
     ILogger <AccountController> logger,
     ISettingsHelper settingsHelper
     )
 {
     _userManager          = userManager;
     _signInManager        = signInManager;
     _emailSender          = emailSender;
     _logger               = logger;
     _registrationDisabled = bool.Parse(
         settingsHelper.Get(Data.Settings.DisableUserRegistration).GetAwaiter().GetResult()
         );
 }
        public CreateTaskCommandHandler(
            [NotNull] IUserAuthorityValidator userAuthorityValidator,
            [NotNull] ITimeService timeService,
            [NotNull] IUserPrincipal userPrincipal,
            [NotNull] ITaskRepository repositoryTasks,
            [NotNull] ITelemetryScopeProvider telemetryScopeProvider,
            [NotNull] IUnitOfWork unitOfWork,
            [NotNull] IEventProvider eventProvider,
            [NotNull] ISettingsHelper settingsHelper)
            : base(userAuthorityValidator, unitOfWork, userPrincipal)
        {
            if (userAuthorityValidator == null)
            {
                throw new ArgumentNullException(nameof(userAuthorityValidator));
            }
            if (timeService == null)
            {
                throw new ArgumentNullException(nameof(timeService));
            }
            if (userPrincipal == null)
            {
                throw new ArgumentNullException(nameof(userPrincipal));
            }
            if (repositoryTasks == null)
            {
                throw new ArgumentNullException(nameof(repositoryTasks));
            }
            if (telemetryScopeProvider == null)
            {
                throw new ArgumentNullException(nameof(telemetryScopeProvider));
            }
            if (eventProvider == null)
            {
                throw new ArgumentNullException(nameof(eventProvider));
            }
            if (settingsHelper == null)
            {
                throw new ArgumentNullException(nameof(settingsHelper));
            }

            _telemetryScopeProvider = telemetryScopeProvider;
            _timeService            = timeService;
            _userPrincipal          = userPrincipal;
            _repositoryTasks        = repositoryTasks;
            _eventProvider          = eventProvider;
            _settingsHelper         = settingsHelper;
        }
Ejemplo n.º 28
0
 public AlbumController(
     ApplicationDbContext context,
     UserManager <ApplicationUser> userManager,
     ISettingsHelper settingsHelper,
     IAwsHelper awsHelper,
     SignInManager <ApplicationUser> signInManager,
     ILogger <AlbumController> logger
     )
 {
     _context        = context;
     _userManager    = userManager;
     _awsHelper      = awsHelper;
     _settingsHelper = settingsHelper;
     _signInManager  = signInManager;
     _logger         = logger;
     _bucketName     = _settingsHelper.Get(Settings.S3BucketName).GetAwaiter().GetResult();
 }
 public Bootstrapper(
     IStore <ApplicationState> appStore,
     IPermissionActionCreator permissionActionCreator,
     IDeviceLocationActionCreator deviceLocationActionCreator,
     IGetPlaceByIdActionCreator downloadPlaceByIdActionCreator,
     IGetPlacesListActionCreator downloadPlacesListActionCreator,
     ISettingsHelper settingsHelper,
     IErrorLogger errorLogger
     )
 {
     this.appStore = appStore ?? throw new ArgumentNullException(nameof(appStore));
     this.permissionActionCreator         = permissionActionCreator ?? throw new ArgumentNullException(nameof(permissionActionCreator));
     this.deviceLocationActionCreator     = deviceLocationActionCreator ?? throw new ArgumentNullException(nameof(deviceLocationActionCreator));
     this.downloadPlaceByIdActionCreator  = downloadPlaceByIdActionCreator ?? throw new ArgumentNullException(nameof(downloadPlaceByIdActionCreator));
     this.downloadPlacesListActionCreator = downloadPlacesListActionCreator ?? throw new ArgumentNullException(nameof(downloadPlacesListActionCreator));
     this.settingsHelper = settingsHelper ?? throw new ArgumentNullException(nameof(settingsHelper));
     this.errorLogger    = errorLogger ?? throw new ArgumentNullException(nameof(errorLogger));
 }
Ejemplo n.º 30
0
        public SystemTray(IApplication application, ISettingsHelper settingsHelper)
        {
            this.icon        = new Icon(ResourceHelper.GetStreamFromApplication("OxTailLogic.Images.OxTail.ico", Assembly.GetExecutingAssembly()));
            this.contextMenu = new ContextMenu();

            System.Windows.Forms.MenuItem menuItem = new System.Windows.Forms.MenuItem(LanguageHelper.GetLocalisedText(application, Constants.DISABLE_SOUND_CONTEXT_MENU));
            menuItem.Checked = bool.Parse(settingsHelper.AppSettings[AppSettings.PLAY_SOUND]);
            contextMenu.MenuItems.Add(menuItem);

            menuItem         = new System.Windows.Forms.MenuItem(LanguageHelper.GetLocalisedText(application, Constants.MINIMISE_TO_TRAY));
            menuItem.Checked = bool.Parse(settingsHelper.AppSettings[AppSettings.MINIMISE_TO_TRAY]);
            contextMenu.MenuItems.Add(menuItem);

            menuItem = new System.Windows.Forms.MenuItem("-");
            contextMenu.MenuItems.Add(menuItem);

            menuItem = new System.Windows.Forms.MenuItem(LanguageHelper.GetLocalisedText(application, Constants.EXIT_CONTEXT_MENU));
            contextMenu.MenuItems.Add(menuItem);
        }
Ejemplo n.º 31
0
        public SystemTray(IApplication application, ISettingsHelper settingsHelper)
        {
            this.icon = new Icon(ResourceHelper.GetStreamFromApplication("OxTailLogic.Images.OxTail.ico", Assembly.GetExecutingAssembly()));
            this.contextMenu = new ContextMenu();

            System.Windows.Forms.MenuItem menuItem = new System.Windows.Forms.MenuItem(LanguageHelper.GetLocalisedText(application, Constants.DISABLE_SOUND_CONTEXT_MENU));
            menuItem.Checked = bool.Parse(settingsHelper.AppSettings[AppSettings.PLAY_SOUND]);
            contextMenu.MenuItems.Add(menuItem);

            menuItem = new System.Windows.Forms.MenuItem(LanguageHelper.GetLocalisedText(application, Constants.MINIMISE_TO_TRAY));
            menuItem.Checked = bool.Parse(settingsHelper.AppSettings[AppSettings.MINIMISE_TO_TRAY]);
            contextMenu.MenuItems.Add(menuItem);

            menuItem = new System.Windows.Forms.MenuItem("-");
            contextMenu.MenuItems.Add(menuItem);

            menuItem = new System.Windows.Forms.MenuItem(LanguageHelper.GetLocalisedText(application, Constants.EXIT_CONTEXT_MENU));
            contextMenu.MenuItems.Add(menuItem);
        }
Ejemplo n.º 32
0
 public APIController(ICheckRepository checks, IRepository <CheckResult> checkResults, ISubCheckTypeRepository subCheckTypes, ICheckTypeRepository checkTypes, ICheckNotificationTypeRepository checkNotificationTypes,
                      IRepository <ContactType> contactTypes, IMapper mapper, ISchedulerManager manager, ISettingsHelper settingsHelper, ISlackHelper slackHelper, IJobHelper jobHelper, ISecurityHelper securityHelper,
                      IUserRepository users, ILogger <APIController> logger)
 {
     _checks                 = checks;
     _checkResults           = checkResults;
     _subCheckTypes          = subCheckTypes;
     _checkTypes             = checkTypes;
     _checkNotificationTypes = checkNotificationTypes;
     _contactTypes           = contactTypes;
     _mapper                 = mapper;
     _manager                = manager;
     _settingsHelper         = settingsHelper;
     _slackHelper            = slackHelper;
     _jobHelper              = jobHelper;
     _securityHelper         = securityHelper;
     _users  = users;
     _logger = logger;
 }
        public ExampleDataProviderDamHelper(IExampleServiceHelper serviceHelper, ICacheHandler cacheHandler, ILogHelper logHelper, IConverterFactory converterFactory, ISettingsHelper settingsHelper)
        {
            var enabledMethods = new List <DataProviderMethods>();

            enabledMethods.Add(DataProviderMethods.BlobStreamExists);
            enabledMethods.Add(DataProviderMethods.MoveItem);
            enabledMethods.Add(DataProviderMethods.GetBlobStream);
            enabledMethods.Add(DataProviderMethods.GetChildIDs);
            enabledMethods.Add(DataProviderMethods.GetItemDefinition);
            enabledMethods.Add(DataProviderMethods.GetItemFields);
            enabledMethods.Add(DataProviderMethods.GetItemVersions);
            enabledMethods.Add(DataProviderMethods.GetParentID);

            this.EnabledMethods   = enabledMethods;
            this.ServiceHelper    = serviceHelper;
            this.CacheHandler     = cacheHandler;
            this.LogHelper        = logHelper;
            this.ConverterFactory = converterFactory;
            this.SettingsHelper   = settingsHelper;
        }
Ejemplo n.º 34
0
        // If DI is about removing all "new" operators from your logic to enable a plugin architecture where
        // every component can be changed in one place and that we must rely on abstraction rather than concretions
        // then everything must implement an interface and be passed in on the constructor (even other windows)
        // Thiscould be useful as for instance: if you wanted to replace the Expression builder then we change it
        // when we load our Ninject Kernel in App.xaml (Via IExpressionBuilderWindowFactory). Then if we called
        // that screen from other windows (such as we do in Find) later on in the stack the change is only in one place
        // I fully intend to remove all "new" operators from this code file as a test to see how plausible it is to do!
        // I have left += new event handlers and any temporary news like StringBuilder
        public MainWindow(RecentFileList recentFileList, ILastOpenFilesData lastOpenFilesData,
                          IHighlightItemData highlightItemData, IWindowFactory windowFactory, IFindWindowFactory findWindowFactory, ISystemTray systemTray,
                          System.Windows.Forms.NotifyIcon notifyIcon, ISaveExpressionMessageWindowFactory saveExpressionMessageWindowFactory,
                          IExpressionBuilderWindowFactory expressionBuilderWindowFactory, IFileFactory fileFactory, ITabItemFactory tabItemFactory, ISettingsHelper settingsHelper,
                          IHighlightWindowFactory highlightWindowFactory, IHighlightsHelper highlightsHelper)
        {
            this.SettingsHelper    = settingsHelper;
            this.LastOpenFilesData = lastOpenFilesData;
            this.recentFileList    = recentFileList;
            this.WindowFactory     = windowFactory;
            this.FindWindowFactory = findWindowFactory;
            this.HighlightItemData = highlightItemData;
            this.SaveExpressionMessageWindowFactory = saveExpressionMessageWindowFactory;
            this.ExpressionBuilderWindowFactory     = expressionBuilderWindowFactory;
            this.SystemTray             = systemTray;
            this.FileFactory            = fileFactory;
            this.TabItemFactory         = tabItemFactory;
            this.HighlightWindowFactory = highlightWindowFactory;
            this.HighlightHelper        = highlightsHelper;

            InitializeComponent();

            this.recentFileList.SubMenuClick += new EventHandler <EventArgs>(recentFileList_SubMenuClick);
            this.MenuItemFile.Items.Insert(2, this.recentFileList);

            // Null Object pattern (http://en.wikipedia.org/wiki/Null_Object_pattern)
            this.OpenWindows   = new List <IWindow>(0);
            this.LastOpenFiles = new List <IFile>(0);

            this.Notify              = notifyIcon;
            this.Notify.Icon         = this.SystemTray.Icon;
            this.Notify.DoubleClick += new EventHandler(Notify_DoubleClick);
            this.Notify.ContextMenu  = this.SystemTray.ContextMenu;

            this.Notify.ContextMenu.MenuItems[0].Click += new EventHandler(disableSoundsMenuItem_Click);
            this.Notify.ContextMenu.MenuItems[1].Click += new EventHandler(minimuseToTrayItem_Click);
            this.Notify.ContextMenu.MenuItems[3].Click += new EventHandler(exitItem_Click);

            this.Notify.Visible = true;
        }
Ejemplo n.º 35
0
 public ApiService(
     [NotNull] IUserAuthorityValidator userAuthorityValidator,
     [NotNull] ICommandDispatcher commandDispatcher,
     [NotNull] ITaskRepository taskRepository,
     [NotNull] IProjectRepository projectRepository,
     [NotNull] INotificationRuleRepository notificationRuleRepository,
     [NotNull] IProjectPluginSettingsProvider projectPluginSettingsProvider,
     [NotNull] IUserPrincipal userPrincipal,
     [NotNull] IUserPluginSettingsProvider userPluginSettingsProvider,
     [NotNull] IAuthorityProvider authorityProvider,
     [NotNull] IConfigurationProvider configurationProvider,
     [NotNull] IPolicyRuleRepository policyRuleRepository,
     [NotNull] IUserInfoProvider userInfoProvider,
     [NotNull] IMailConnectionParametersProvider mailConnectionParametersProvider,
     [NotNull] ITaskResultRepository taskResultRepository,
     [NotNull] IPluginFactory pluginFactory,
     [NotNull] IUserInterfaceChecker userInterfaceChecker,
     [NotNull] IDataQueryDispatcher dataQueryDispatcher,
     [NotNull] ISettingsHelper settingsHelper)
 {
     _userAuthorityValidator        = userAuthorityValidator;
     _commandDispatcher             = commandDispatcher;
     _taskRepository                = taskRepository;
     _projectRepository             = projectRepository;
     _notificationRuleRepository    = notificationRuleRepository;
     _projectPluginSettingsProvider = projectPluginSettingsProvider;
     _userPrincipal = userPrincipal;
     _userPluginSettingsProvider       = userPluginSettingsProvider;
     _authorityProvider                = authorityProvider;
     _configurationProvider            = configurationProvider;
     _policyRuleRepository             = policyRuleRepository;
     _userInfoProvider                 = userInfoProvider;
     _mailConnectionParametersProvider = mailConnectionParametersProvider;
     _taskResultRepository             = taskResultRepository;
     _pluginFactory        = pluginFactory;
     _userInterfaceChecker = userInterfaceChecker;
     _dataQueryDispatcher  = dataQueryDispatcher;
     _settingsHelper       = settingsHelper;
 }
Ejemplo n.º 36
0
 private SettingsService()
 {
     _helper = new SettingsHelper();
 }
Ejemplo n.º 37
0
 public SlackHelper(IOptions <AppSettings> appSettings, ISettingsHelper settingsHelper)
 {
     _appSettings    = appSettings.Value;
     _settingsHelper = settingsHelper;
 }
Ejemplo n.º 38
0
 public AppSettings(ISettingsHelper settingsHelper)
 {
     _settingsHelper = settingsHelper;
 }
Ejemplo n.º 39
0
        // If DI is about removing all "new" operators from your logic to enable a plugin architecture where
        // every component can be changed in one place and that we must rely on abstraction rather than concretions
        // then everything must implement an interface and be passed in on the constructor (even other windows)
        // Thiscould be useful as for instance: if you wanted to replace the Expression builder then we change it
        // when we load our Ninject Kernel in App.xaml (Via IExpressionBuilderWindowFactory). Then if we called
        // that screen from other windows (such as we do in Find) later on in the stack the change is only in one place
        // I fully intend to remove all "new" operators from this code file as a test to see how plausible it is to do!
        // I have left += new event handlers and any temporary news like StringBuilder
        public MainWindow(RecentFileList recentFileList, ILastOpenFilesData lastOpenFilesData,
            IHighlightItemData highlightItemData, IWindowFactory windowFactory, IFindWindowFactory findWindowFactory, ISystemTray systemTray,
            System.Windows.Forms.NotifyIcon notifyIcon, ISaveExpressionMessageWindowFactory saveExpressionMessageWindowFactory,
            IExpressionBuilderWindowFactory expressionBuilderWindowFactory, IFileFactory fileFactory, ITabItemFactory tabItemFactory, ISettingsHelper settingsHelper,
            IHighlightWindowFactory highlightWindowFactory, IHighlightsHelper highlightsHelper)
        {
            this.SettingsHelper = settingsHelper;
            this.LastOpenFilesData = lastOpenFilesData;
            this.recentFileList = recentFileList;
            this.WindowFactory = windowFactory;
            this.FindWindowFactory = findWindowFactory;
            this.HighlightItemData = highlightItemData;
            this.SaveExpressionMessageWindowFactory = saveExpressionMessageWindowFactory;
            this.ExpressionBuilderWindowFactory = expressionBuilderWindowFactory;
            this.SystemTray = systemTray;
            this.FileFactory = fileFactory;
            this.TabItemFactory = tabItemFactory;
            this.HighlightWindowFactory = highlightWindowFactory;
            this.HighlightHelper = highlightsHelper;

            InitializeComponent();

            this.recentFileList.SubMenuClick +=new EventHandler<EventArgs>(recentFileList_SubMenuClick);
            this.MenuItemFile.Items.Insert(2, this.recentFileList);

            // Null Object pattern (http://en.wikipedia.org/wiki/Null_Object_pattern)
            this.OpenWindows = new List<IWindow>(0);
            this.LastOpenFiles = new List<IFile>(0);

            this.Notify = notifyIcon;
            this.Notify.Icon = this.SystemTray.Icon;
            this.Notify.DoubleClick += new EventHandler(Notify_DoubleClick);
            this.Notify.ContextMenu = this.SystemTray.ContextMenu;

            this.Notify.ContextMenu.MenuItems[0].Click += new EventHandler(disableSoundsMenuItem_Click);
            this.Notify.ContextMenu.MenuItems[1].Click += new EventHandler(minimuseToTrayItem_Click);
            this.Notify.ContextMenu.MenuItems[3].Click += new EventHandler(exitItem_Click);

            this.Notify.Visible = true;
        }
Ejemplo n.º 40
0
 /// <summary>
 /// Initialize this instance
 /// </summary>
 public ApplicationSettings(ISettingsHelper settingsHelper)
 {
     InitializeComponent();
     this.SettingsHelper = settingsHelper;
 }
Ejemplo n.º 41
0
 public SettingsViewModel(ISettingsHelper settingsHelper)
 {
     this.settingsHelper = settingsHelper;
     this.saveCommand = new RelayCommand(this.Save);
 }
Ejemplo n.º 42
0
 public AuthenticationProvider(IClientHelper clientHelper, ISettingsHelper settingsHelper)
 {
     _clientHelper = clientHelper;
     _settingsHelper = settingsHelper;
 }
 public RegiRideSettingsManager(ISettingsHelper settingsHelper)
 {
     this.settingsHelper = settingsHelper;
 }
 public WeeklyThaiRecipeSettings(ISettingsHelper settingsHelper)
 {
     this.settingsHelper = settingsHelper;
 }
Ejemplo n.º 45
0
 private SettingsService()
 {
     _helper = new SettingsHelper();
 }