public AdActivationServices(IRepository repository, ITemplatingService templatingService, IEmailServices emailService, IApplicationSettingsProvider appSettingsProvider)
 {
     _repository = repository;
     _templatingService = templatingService;
     _emailService = emailService;
     _appSettingsProvider = appSettingsProvider;
 }
示例#2
0
        public BaseService(
			IApplicationSettingsProvider applicationSettingsProvider,
			ISettingsRepository settingsRepository)
        {
            _applicationSettingsProvider = applicationSettingsProvider;
            _settingsRepository = settingsRepository;
        }
 public XmlSettingsProvider()
 {
     _appSettings = CompositionManager.Get<IApplicationSettingsProvider>();
     _accountSettings = CompositionManager.Get<IAccountSettingsProvider>();
     _columnsSettings = CompositionManager.Get<IColumnsSettingsProvider>();
     _pluginSettings = CompositionManager.Get<IPluginSettingsProvider>();
 }
        /// <summary>
        /// Used in conjunction with Upgrade - retrieves the previous value of a setting from the provider.
        /// Provider must implement IApplicationSettingsProvider to support this.
        /// </summary>
        public object GetPreviousVersion(string propertyName)
        {
            if (Properties.Count == 0)
            {
                throw new SettingsPropertyNotFoundException();
            }

            SettingsProperty      sp    = Properties[propertyName];
            SettingsPropertyValue value = null;

            if (sp == null)
            {
                throw new SettingsPropertyNotFoundException();
            }

            IApplicationSettingsProvider clientProv = sp.Provider as IApplicationSettingsProvider;

            if (clientProv != null)
            {
                value = clientProv.GetPreviousVersion(Context, sp);
            }

            if (value != null)
            {
                return(value.PropertyValue);
            }

            return(null);
        }
        public AppViewModel(IPluginRepository pluginRepository,
                            IAccountSettingsProvider accounts,
                            IApplicationSettingsProvider applicationSettings,
                            IColumnsSettingsProvider columnsSettings,
                            Func<IPluginLoader> createPluginLoader,
                            Func<ResourcesViewModel> createResourceViewModel)
        {
            _pluginRepository = pluginRepository;
            _accounts = accounts;
            _applicationSettings = applicationSettings;
            _columnsSettings = columnsSettings;

            _loader = createPluginLoader();

            Model = CompositionManager.Get<IMainViewModel>();

            Resources = createResourceViewModel();

            if (Model == null) return;
            Model.FilterGroups = new ObservableCollection<StreamModel>(_columnsSettings.Filters);

            if (Model.FilterGroups.Count != 0) return;
            var f = StreamModel.CreateDefault();
            Model.FilterGroups.Add(f);
        }
        public object GetPreviousVersion(string propertyName)
        {
            if (this.Properties.Count == 0)
            {
                throw new SettingsPropertyNotFoundException();
            }
            SettingsProperty      property        = this.Properties[propertyName];
            SettingsPropertyValue previousVersion = null;

            if (property == null)
            {
                throw new SettingsPropertyNotFoundException();
            }
            IApplicationSettingsProvider provider = property.Provider as IApplicationSettingsProvider;

            if (provider != null)
            {
                previousVersion = provider.GetPreviousVersion(this.Context, property);
            }
            if (previousVersion != null)
            {
                return(previousVersion.PropertyValue);
            }
            return(null);
        }
示例#7
0
 public AdActivationServices(IRepository repository, ITemplatingService templatingService, IEmailServices emailService, IApplicationSettingsProvider appSettingsProvider)
 {
     _repository          = repository;
     _templatingService   = templatingService;
     _emailService        = emailService;
     _appSettingsProvider = appSettingsProvider;
 }
        public StreamConfigurationViewModel(
            IApplicationSettingsProvider applicationSettingsProvider,
            IGlobalExcludeSettings globalExcludeSettings,
            IAccountSettingsProvider accountSettingsProvider,
            IColumnsSettingsProvider columnsSettingsProvider,
            IContactService contactService)
        {
            _applicationSettingsProvider = applicationSettingsProvider;
            _accountSettingsProvider = accountSettingsProvider;
            _globalExcludeSettings = globalExcludeSettings;
            _columnsSettingsProvider = columnsSettingsProvider;
            _contactService = contactService;
            _scriptLibrary = CompositionManager.Get<IScriptingLibrarian>();

            ShowConfiguration = false;

            Filters = new StreamModel {Direction = ListSortDirection.Descending};
            FilterBefore = DateTime.Now.Subtract(new TimeSpan(365, 0, 0, 0, 0));

            ScriptFilters = _scriptLibrary.ScriptFilters;

            EditCommand = new DelegateCommand(SetEdit);
            CancelCommand = new DelegateCommand(CancelChanges);
            SaveCommand = new DelegateCommand(SaveChanges);
        }
示例#9
0
 public AdContactServices(IAdRepository adRepository, IRepository repository, IApplicationSettingsProvider appSettingsProvider, IEmailServices emailService)
 {
     _adRepository        = adRepository;
     _repository          = repository;
     _appSettingsProvider = appSettingsProvider;
     _emailService        = emailService;
 }
示例#10
0
 public AdContactServices(IAdRepository adRepository, IRepository repository, IApplicationSettingsProvider appSettingsProvider, IEmailServices emailService)
 {
     _adRepository = adRepository;
     _repository = repository;
     _appSettingsProvider = appSettingsProvider;
     _emailService = emailService;
 }
示例#11
0
 public ApplicationSettingsUpdatedEventHandler(
     IApplicationSettingsProvider applicationSettingsProvider,
     IEventHubContext eventHubContext
     )
 {
     _applicationSettingsProvider = applicationSettingsProvider;
     _eventHubContext             = eventHubContext;
 }
示例#12
0
 public JwtAuthorizationServerConfig(IApplicationSettingsProvider applicationSettingsProvider,
                                     ITokenFormatProvider tokenFormatProvider,
                                     IOAuthAuthorizationServerProvider oAuthAuthorizationServerProvider)
 {
     _applicationSettingsProvider      = applicationSettingsProvider;
     _tokenFormatProvider              = tokenFormatProvider;
     _oAuthAuthorizationServerProvider = oAuthAuthorizationServerProvider;
 }
示例#13
0
        protected TimeLineViewModelBase(INGTweetAuthenticationService.INGTweetAuthenticationService authenticationService, IApplicationSettingsProvider applicationSettingsProvider)
        {
            _authenticationService = authenticationService;

            _applicationSettingsProvider = applicationSettingsProvider;

            _tweeterStatusViewModels = new ObservableCollection <TweetViewModel>();
        }
示例#14
0
 public GetApplicationSettingsQueryHandler(
     IApplicationSettingsProvider applicationSettingsProvider,
     IMapper mapper
     )
 {
     _applicationSettingsProvider = applicationSettingsProvider;
     _mapper = mapper;
 }
示例#15
0
        protected TimeLineViewModelBase(INGTweetAuthenticationService.INGTweetAuthenticationService authenticationService, IApplicationSettingsProvider applicationSettingsProvider)
        {
            _authenticationService = authenticationService;

            _applicationSettingsProvider = applicationSettingsProvider;

            _tweeterStatusViewModels = new ObservableCollection<TweetViewModel>();
        }
        public void Setup()
        {
            _mockAuthenticationService = new Mock <INGTweetAuthenticationService>().Object;

            _mockApplicationSettingsProvider = new Mock <IApplicationSettingsProvider>().Object;

            viewModel = new TweetActionViewModel(_mockAuthenticationService, _mockApplicationSettingsProvider);
        }
 public GeneralSettingsViewModel(
     IApplicationSettingsProvider applicationSettingsProvider,
     IEventAggregator eventAggregator)
     : base(eventAggregator)
 {
     _applicationSettingsProvider = applicationSettingsProvider;
     _urlShorteners = CompositionManager.GetAll<IUrlShortener>();
 }
        public GlobalIgnoresViewModel(
            IApplicationSettingsProvider applicationSettingsProvider)
        {
            _applicationSettingsProvider = applicationSettingsProvider;

            ClearCommand = new DelegateCommand(Clear, () => CanClear);
            AddCommand = new DelegateCommand(Add, () => CanAdd);
            RemoveCommand = new DelegateCommand<string>(Remove);
        }
示例#19
0
        public void Setup()
        {
            _mockAuthenticationService       = new Mock <INGTweetAuthenticationService>().Object;
            _mockApplicationSettingsProvider = new Mock <IApplicationSettingsProvider>().Object;

            DispatcherHelper.Initialize();

            _viewModel = new MainViewModel(_mockAuthenticationService, _mockApplicationSettingsProvider);
        }
 public CurrentVersion(            
     IApplicationSettingsProvider applicationSettingsProvider,
     IEventAggregator eventAggregator
     )
 {
     _eventAggregator = eventAggregator;
     _applicationSettingsProvider = applicationSettingsProvider;
     _eventAggregator.GetEvent<CheckMahTweetsVersion>().Subscribe(HandleCheckMahTweetsVersion);
 }
示例#21
0
        public MainViewModel(
            INGTweetAuthenticationService.INGTweetAuthenticationService authenticationService,
            IApplicationSettingsProvider applicationSettingsProvider)
        {
            _authenticationService = authenticationService;

            _applicationSettingsProvider = applicationSettingsProvider;

            AuthorizeAppCommand = new RelayCommand(AuthorizeWithPin);
        }
示例#22
0
        public void Reload()
        {
#if (CONFIGURATION_DEP)
            foreach (SettingsProvider provider in Providers)
            {
                IApplicationSettingsProvider iasp = provider as IApplicationSettingsProvider;
                CacheValuesByProvider(provider);
            }
#endif
        }
示例#23
0
        public InstagramService(ISettingsRepository settingsRepository,
			IApplicationSettingsProvider applicationSettingsProvider,
			IUnitOfWork unitOfWork,
			IInstagramRepository instagramRepository)
            : base(applicationSettingsProvider, settingsRepository)
        {
            _settingsRepository = settingsRepository;
            _applicationSettingsProvider = applicationSettingsProvider;
            _unitOfWork = unitOfWork;
            _instagramRepository = instagramRepository;
        }
示例#24
0
        public TweetActionViewModel(INGTweetAuthenticationService.INGTweetAuthenticationService authenticationService, IApplicationSettingsProvider applicationSettingsProvider)
        {
            _authenticationService = authenticationService;

            _applicationSettingsProvider = applicationSettingsProvider;

            TweetText = string.Empty;

            TweetActionCommand = new RelayCommand(OnTweetActionCommand);

            Messenger.Default.Register<NGTweeterStatus>(this, "Retweet", ReTweetExistingTweet);
        }
示例#25
0
        public TweetActionViewModel(INGTweetAuthenticationService.INGTweetAuthenticationService authenticationService, IApplicationSettingsProvider applicationSettingsProvider)
        {
            _authenticationService = authenticationService;

            _applicationSettingsProvider = applicationSettingsProvider;

            TweetText = string.Empty;

            TweetActionCommand = new RelayCommand(OnTweetActionCommand);

            Messenger.Default.Register <NGTweeterStatus>(this, "Retweet", ReTweetExistingTweet);
        }
示例#26
0
 /// <summary>
 /// Calls Upgrade on the provider.
 /// </summary>
 public void Upgrade()
 {
     if (Properties != null)
     {
         IApplicationSettingsProvider clientProv = provider as IApplicationSettingsProvider;
         if (clientProv != null)
         {
             clientProv.Upgrade(Context, Properties);
         }
     }
     Reload();
 }
示例#27
0
 /// <summary>
 /// Calls Reset on the provider.
 /// </summary>
 public void Reset()
 {
     if (Properties != null)
     {
         IApplicationSettingsProvider clientProv = provider as IApplicationSettingsProvider;
         if (clientProv != null)
         {
             clientProv.Reset(Context);
         }
     }
     Reload();
 }
示例#28
0
        public void Reload()
        {
#if (CONFIGURATION_DEP)
            foreach (SettingsProvider provider in Providers)
            {
                IApplicationSettingsProvider iasp = provider as IApplicationSettingsProvider;
                if (iasp != null)
                {
                    iasp.Reset(Context);
                }
            }
#endif
        }
示例#29
0
        public FlickrService(
			IApplicationSettingsProvider applicationSettingsProvider, 
			ISettingsRepository settingsRepository,
			IFlickrRepository flickrRepository,
			IUnitOfWork unitOfWork
			)
            : base(applicationSettingsProvider, 
			settingsRepository)
        {
            _applicationSettingsProvider = applicationSettingsProvider;
            _settingsRepository = settingsRepository;
            _flickrRepository = flickrRepository;
            _unitOfWork = unitOfWork;
        }
        public StreamViewModel(
            IStatusUpdateService statusUpdateService,
            IPluginRepository pluginsRepository,
            StreamConfigurationViewModel streamConfigurationViewModel)
        {
            _pluginsRepository = pluginsRepository;
            _statusUpdate = statusUpdateService;

            StreamConfiguration = streamConfigurationViewModel;
            StreamConfiguration.Parent = this;

            Updates = new BindableList<IStatusUpdate>(_statusUpdate.OutgoingUpdates);
            _settings = CompositionManager.Get<IApplicationSettingsProvider>();
        }
 public virtual void Upgrade()
 {
     if (this.Properties != null)
     {
         foreach (SettingsProvider provider in this.Providers)
         {
             IApplicationSettingsProvider provider2 = provider as IApplicationSettingsProvider;
             if (provider2 != null)
             {
                 provider2.Upgrade(this.Context, this.GetPropertiesForProvider(provider));
             }
         }
     }
     this.Reload();
 }
 public void Reset()
 {
     if (this.Properties != null)
     {
         foreach (SettingsProvider provider in this.Providers)
         {
             IApplicationSettingsProvider provider2 = provider as IApplicationSettingsProvider;
             if (provider2 != null)
             {
                 provider2.Reset(this.Context);
             }
         }
     }
     this.Reload();
 }
示例#33
0
        /// <summary>
        /// Called when the app is upgraded so that we can instruct the providers to upgrade their settings.
        /// Providers must implement IApplicationSettingsProvider to support this.
        /// </summary>
        public virtual void Upgrade()
        {
            if (Properties != null)
            {
                foreach (SettingsProvider provider in Providers)
                {
                    IApplicationSettingsProvider clientProv = provider as IApplicationSettingsProvider;
                    if (clientProv != null)
                    {
                        clientProv.Upgrade(Context, GetPropertiesForProvider(provider));
                    }
                }
            }

            Reload();
        }
        public void Reset()
        {
#if (CONFIGURATION_DEP)
            if (Properties != null)
            {
                foreach (SettingsProvider provider in Providers)
                {
                    IApplicationSettingsProvider iasp = provider as IApplicationSettingsProvider;
                    if (iasp != null)
                    {
                        iasp.Reset(Context);
                    }
                }
                InternalSave();
            }

            Reload();
#endif
        }
示例#35
0
 public UnreadMessagesAlertProvider(IAlertRepository alertRepository,
                                    ICustomParametersProvider customParametersProvider,
                                    ITypesRepository typesRepository,
                                    IMessagingProvider messagingProvider,
                                    IUrlProvider urlProvider,
                                    IImageProvider imageProvider,
                                    ISMSProvider smsProvider,
                                    IApplicationSettingsProvider applicationSettingsProvider,
                                    IPushNotificationProvider pushNotificationProvider,
                                    ITranslationProvider translationProvider)
 {
     _alertRepository          = alertRepository;
     _customParametersProvider = customParametersProvider;
     _messagingProvider        = messagingProvider;
     _urlProvider                 = urlProvider;
     _imageProvider               = imageProvider;
     _smsProvider                 = smsProvider;
     _typesRepository             = typesRepository;
     _applicationSettingsProvider = applicationSettingsProvider;
     _pushNotificationProvider    = pushNotificationProvider;
     _translationProvider         = translationProvider;
 }
        public MainViewModel(
            IPluginRepository pluginRepository,
            IAccountSettingsProvider accountSettings,
            IColumnsSettingsProvider columnsSettings,
            IApplicationSettingsProvider applicationSettingsProvider,
            Func<StreamViewModel> createStreamViewModel,
            Func<SearchViewModel> createSearchViewModel,
            SetupViewModel setupViewModel)
        {
            _pluginRepository = pluginRepository;
            _accountSettings = accountSettings;
            _columnsSettings = columnsSettings;
            _createStreamViewModel = createStreamViewModel;
            _createSearchViewModel = createSearchViewModel;
            _setupViewModel = setupViewModel;
            _applicationSettingsProvider = applicationSettingsProvider;

            EventAggregator.GetEvent<ShowLink>().Subscribe(HandleShowLink);
            EventAggregator.GetEvent<ShowProfile>().Subscribe(HandleShowProfile);
            EventAggregator.GetEvent<ShowConversation>().Subscribe(HandleShowConversation);
            EventAggregator.GetEvent<ShowSearch>().Subscribe(CreateNewSearch);
            EventAggregator.GetEvent<ShowContainer>().Subscribe(HandleShowContainer);
            EventAggregator.GetEvent<MicroblogAdded>().Subscribe(HandleNewMicroblog);
            EventAggregator.GetEvent<ShowColumns>().Subscribe(HandleNewColumns);

            ContactService = CompositionManager.Get<IContactService>();
            StatusManager = CompositionManager.Get<IStatusUpdateService>();

            SelectedMicroblogs = new ThreadSafeObservableCollection<IMicroblog>();

            CurrentSearches = new ObservableCollection<ISearchViewModel>();
            StreamContainers = new ObservableCollection<IContainerViewModel>();
            FilterGroups = new ObservableCollection<StreamModel>();

            HiddenPanels = new ObservableCollection<UIElement>();

            IsSearchVisible = false;
        }
 public static EntityFrameworkCoreSettings GetEntityFrameworkCoreSettings(this IApplicationSettingsProvider settings)
 {
     return(new EntityFrameworkCoreSettings(settings.GetGroup("844a2692-4a23-4f53-8b29-0bd93067ebba")));
 }
示例#38
0
 public MentionsViewModel(INGTweetAuthenticationService.INGTweetAuthenticationService authenticationService, IApplicationSettingsProvider applicationSettingsProvider)
     : base(authenticationService, applicationSettingsProvider)
 {
 }
 public OAuthController(IApplicationSettingsProvider appConfig, IDatabaseIdentityProvider databaseIdentityProvider)
 {
     _config = appConfig;
     _databaseIdentityProvider = databaseIdentityProvider;
 }
示例#40
0
 public ApplicationSettingsService(IApplicationSettingsProvider settingsProvider)
 {
     SettingsProvider = settingsProvider;
 }
 static Settings()
 {
     Accounts = ObjectFactory.GetInstance<IAccountSettingsProvider>();
     Application = ObjectFactory.GetInstance<IApplicationSettingsProvider>();
 }
        public MainWindow(AppViewModel viewModel,
                          IPluginRepository pluginRepository,
                          IAccountSettingsProvider accountSettingsProvider,
                          IColumnsSettingsProvider columnsSettingsProvider,
                          IApplicationSettingsProvider applicationSettingsProvider,
                          IEventAggregator eventAggregator)
        {
            InitializeComponent();

            _pluginRepository = pluginRepository;
            _accountSettings = accountSettingsProvider;
            _columnsSettings = columnsSettingsProvider;
            _applicationSettingsProvider = applicationSettingsProvider;
            _eventAggregator = eventAggregator;

            var mainViewModel = viewModel.Model;
            var resourceViewModel = viewModel.Resources;

            txtUpdate.SetHeight((Double) FindResource("DefaultCompositionBoxHeight"));
            var c = (CompositionTextBox) txtUpdate.FindName("txtUpdateBox");
            if (c != null)
                c.IsInlineReply = false;

            Model = mainViewModel;
            ResourcesViewModel = resourceViewModel;
            mainViewModel.View = this;

            DataContext = mainViewModel;

            GlobalWindows.MainWindow = this;

            try
            {
                if (TaskbarManager.IsPlatformSupported)
                    TaskbarManager = TaskbarManager.Instance;
            }
            catch (Exception ex)
            {
                CompositionManager.Get<IExceptionReporter>().ReportHandledException(ex);
            }


            if (resourceViewModel.Views == null) return;

            //Import the XAML
            foreach (var r in resourceViewModel.Views)
            {
                Resources.MergedDictionaries.Add(r);
            }

            var ibShowSetup = new InputBinding(ShowSetup, new KeyGesture(Key.S, ModifierKeys.Control));
            var ibShowScriptingConsole = new InputBinding(ShowScriptConsoleCommand,
                                                          new KeyGesture(Key.S, ModifierKeys.Alt));
            InputBindings.Add(ibShowSetup);
            InputBindings.Add(ibShowScriptingConsole);

            var cbShowSetup = new CommandBinding(ShowSetup);
            cbShowSetup.Executed += CbShowSetupExecuted;
            CommandBindings.Add(cbShowSetup);

            var scriptConsole = new CommandBinding(ShowScriptConsoleCommand);
            scriptConsole.Executed += ScriptConsoleVisible;
            CommandBindings.Add(scriptConsole);

            if (!DesignerProperties.GetIsInDesignMode(this))
            {
                MahTweets.Configuration.WindowSettings.SetSave(this, true);
            }
        }
        public void Setup()
        {
            _mockAuthenticationService = new Mock<INGTweetAuthenticationService>().Object;

            _mockApplicationSettingsProvider = new Mock<IApplicationSettingsProvider>().Object;

            viewModel = new TweetActionViewModel(_mockAuthenticationService, _mockApplicationSettingsProvider);
        }
示例#44
0
 public DemoImageProvider(IImageRepository imageRepository, IUrlProvider urlProvider, IApplicationSettingsProvider applicationSettingsProvider)
 {
     _imageRepository             = imageRepository;
     _urlProvider                 = urlProvider;
     _applicationSettingsProvider = applicationSettingsProvider;
 }
 public CacheInterceptor(ICacheProvider cacheProvider, ICacheKeyProvider cacheKeyProvider, IApplicationSettingsProvider applicationSettingsProvider)
 {
     _cacheProvider               = cacheProvider;
     _cacheKeyProvider            = cacheKeyProvider;
     _applicationSettingsProvider = applicationSettingsProvider;
 }
示例#46
0
 /// <summary>
 /// Constructor for the HMAC SHA 256 signing credentials provider.
 /// </summary>
 /// <param name="appSettings">The app settings provider</param>
 public HMACSHA256SigningCredentialsProvider(IApplicationSettingsProvider appSettings)
 {
     _appSettings = appSettings;
 }
 public static EntityKeySettings GetEntityKeySettings(this IApplicationSettingsProvider settings)
 {
     return(new EntityKeySettings(settings.GetGroup("54be52b5-ac59-42d6-b0af-e33722f082e7")));
 }
 public DemoDateProvider(IApplicationSettingsProvider appSettingsProvider)
 {
     _appSettingsProvider = appSettingsProvider;
 }
示例#49
0
        public void Setup()
        {
            DispatcherHelper.Initialize();

            _mockAuthenticationService = new Mock<INGTweetAuthenticationService>().Object;
            _mockApplicationSettingsProvider = new Mock<IApplicationSettingsProvider>().Object;

            _viewModel = new MentionsViewModel(_mockAuthenticationService, _mockApplicationSettingsProvider);
        }
示例#50
0
 public JwtBearerTokenAuthenticationConfig(IApplicationSettingsProvider applicationSettingsProvider)
 {
     _applicationSettingsProvider = applicationSettingsProvider;
 }