public CompareSentenceEditorView( SentenceEditorViewModel sentenceEditorViewModel, IEventAggregator eventAggregator, IAppConfig appConfig) : this(eventAggregator, appConfig) { if (sentenceEditorViewModel == null) { throw new ArgumentNullException("sentenceEditorViewModel"); } Loaded += SentenceEditorView_Loaded; viewModel = sentenceEditorViewModel; viewModel.ViewId = viewUniqueId; DataContext = viewModel; GgArea.ShowAllEdgesArrows(); GgArea.ShowAllEdgesLabels(); GgZoomCtrl.MouseLeftButtonUp += GgZoomCtrlMouseLeftButtonUp; GgArea.GenerateGraphFinished += GgAreaGenerateGraphFinished; GgArea.EdgeLabelFactory = new DefaultEdgelabelFactory(); eventAggregator.GetEvent<GenerateGraphEvent>().Subscribe(OnGenerateGraph); eventAggregator.GetEvent<ZoomOnWordVertexEvent>().Subscribe(OnZoomOnWordVertex); eventAggregator.GetEvent<ZoomToFillEvent>().Subscribe(ZoomToFill); }
public AppConfig(IFileUtilities i_FileUtilities , IFolderUtilities i_FolderUtilities,IAppConfig i_AppConfig) { m_FileUtilities = i_FileUtilities; m_FolderUilities = i_FolderUtilities; m_Appconfig=i_AppConfig.GetInstance(); updateAdditionalInfo(); }
private void SaveRecursive(IAppConfig config, string keyPreset) { // Create map by scanning properties var roamingSettings = ApplicationData.Current.RoamingSettings; var propertyInfos = config.GetType().GetTypeInfo().DeclaredProperties; foreach (PropertyInfo propertyInfo in propertyInfos) { var propertyType = propertyInfo.PropertyType; string fullName = keyPreset + propertyInfo.Name; object value = propertyInfo.GetValue(config); bool isAssignable = typeof (IAppConfig).GetTypeInfo().IsAssignableFrom(propertyType.GetTypeInfo()); Debug.WriteLine("{0} - {1} - isAssignable: {2}", fullName, propertyInfo.PropertyType.Name, isAssignable); if (propertyType == typeof (int) || propertyType == typeof (bool) || propertyType == typeof (double) || propertyType == typeof (float) || propertyType == typeof (string)) { Debug.WriteLine("Save setting: {0} - {1} - {2}", fullName, propertyInfo.PropertyType.Name, value); roamingSettings.Values[fullName] = value; } else if (typeof (IAppConfig).GetTypeInfo().IsAssignableFrom(propertyType.GetTypeInfo())) { var subConfig = (IAppConfig)propertyInfo.GetValue(config); SaveRecursive(subConfig, keyPreset + propertyType.Name + "."); } } }
public DropDatabaseTask(IAppConfig appConfig) { var url = new MongoUrl(appConfig.ProxyDbConnectionString); _mongoDatabase = new MongoClient(url) .GetServer() .GetDatabase(url.DatabaseName); }
public UseCaseUpdateTask(IAppConfig appConfig, IDataList<UseCase> useCases) { var url = new MongoUrl(appConfig.ProxyDbConnectionString); _db = new MongoClient(url).GetServer().GetDatabase(url.DatabaseName); _useCases = useCases; }
public LoadLanguageRepository(ILanguageRepository languageRepository , ILoadLanguageFactory loadLanguageFactory , IAppConfig appConfig) { _languageRepository = languageRepository; _loadLanguageFactory = loadLanguageFactory; _appConfig = appConfig; }
public VkApiSettings(IAppConfig config) { Language = GetVkLanguage(config.Language); Permissions = AppPermissions.Messages | AppPermissions.Notifications | AppPermissions.Friends | AppPermissions.Offline; }
public VkAuthorizer(IAppConfig appConfig , ILanguageRepository languageRepository , VkApiClient apiClient , IOAuthAuthorizer oAuthAuthorizer) { _appConfig = appConfig; _languageRepository = languageRepository; _apiClient = apiClient; _oAuthAuthorizer = oAuthAuthorizer; }
protected SettingsRunnableDefault(IAppConfig appConfig, string ativo, string intervaloSemServico, string intervaloInativo) { _appConfig = appConfig; _ativo = ativo; _intervaloSemServico = intervaloSemServico; _intervaloInativo = intervaloInativo; }
//Function to check on startup public AutoDeployManager(IServiceManager i_ServiceManager, ILogManager i_LogManager, IAppConfig i_AppConfig, IFileUtilities i_FileUtilities, ICMDUtilities i_CMDUtilities) { m_ServiceManager = i_ServiceManager; m_FileUtilities = i_FileUtilities; m_CMDUtilities = i_CMDUtilities; m_LogManager = i_LogManager; m_AppConfig = i_AppConfig.GetInstance(); string netUsePath = string.Format("NET USE {0} /USER:{1} {2}", m_AppConfig.RemotePath, m_AppConfig.RemotePathUserName, m_AppConfig.RemotePathPassword); m_CMDUtilities.ExecuteCmdCommand(netUsePath); }
public AuthHelpers(IAppConfig appConfig) { _appConfig = appConfig; storageAccount = CloudStorageAccount.Parse(appConfig.StorageConnectionString); blobClient = storageAccount.CreateCloudBlobClient(); container = blobClient.GetContainerReference("apipersistenace"); container.CreateIfNotExists(); Blob = container.GetBlockBlobReference("tenantId"); }
public MainViewModel (IDataClient dataClient, IAppConfig appConfig) { _dataClient = dataClient.ThrowIfNull ("dataClient"); _appConfig = appConfig.ThrowIfNull ("appConfig"); using (var scope = AppContainer.Container.BeginLifetimeScope ()) { _sessionsViewModel = AppContainer.Container.Resolve<SessionsViewModel> (); _speakersViewModel = AppContainer.Container.Resolve<SpeakersViewModel> (); _tracksVieModel = AppContainer.Container.Resolve<TracksViewModel> (); } }
public DataClient (IMapperService mapperService, IConnectivityService connectivityService, ISerializerService serializerService, IHttpService httpService, IAppConfig appConfig) { _mapperService = mapperService.ThrowIfNull ("mapperService"); _connectivityService = connectivityService.ThrowIfNull ("connectivityService"); _serializerService = serializerService.ThrowIfNull ("serializerService"); _httpService = httpService.ThrowIfNull ("httpService"); _appConfig = appConfig.ThrowIfNull ("appConfig"); }
public CompareSentenceEditorView(IEventAggregator eventAggregator, IAppConfig appConfig) { InitializeComponent(); if (eventAggregator == null) { throw new ArgumentNullException("eventAggregator"); } if (appConfig == null) { throw new ArgumentNullException("appConfig"); } editorManager = new SentenceEditorManager(GgArea, GgZoomCtrl); }
public MailController(IAppConfig appConfig, IAuthHelpers authHelpers, IRequestHelpers requestHelpers) { _authHelpers = authHelpers; var tenantId = _authHelpers.GetTenantId(); _requestHelpers = requestHelpers; if (tenantId != null) { Accounts = _requestHelpers.GetAadEmails(tenantId); //Will probably iterate all the accounts and do something, currently only one accounts active ExchangeAccessToken = _requestHelpers.GetExchangeAppOnlyAccessToken(tenantId).AccessToken; //Create the api uri and issue the request for email using the AppOnly accessToken FetchedEmail = _requestHelpers.GetEmail(Accounts, ExchangeAccessToken); } }
private void LoadRecursive(IAppConfig config, string keyPreset) { // Create map by scanning properties var sharedPreferences = PreferenceManager.GetDefaultSharedPreferences(_context); var propertyInfos = config.GetType().GetTypeInfo().DeclaredProperties; foreach (PropertyInfo propertyInfo in propertyInfos) { var propertyType = propertyInfo.PropertyType; string fullName = keyPreset + propertyInfo.Name; bool isAssignable = typeof(IAppConfig).GetTypeInfo().IsAssignableFrom(propertyType.GetTypeInfo()); //Debug.WriteLine("{0} - {1} - isAssignable: {2}", fullName, propertyInfo.PropertyType.Name, isAssignable); if (propertyType == typeof(int)) { propertyInfo.SetValue(config, sharedPreferences.GetInt(fullName, 0)); } else if (propertyType == typeof(bool)) { propertyInfo.SetValue(config, sharedPreferences.GetBoolean(fullName, false)); } else if (propertyType == typeof(double)) { propertyInfo.SetValue(config, sharedPreferences.GetFloat(fullName, 0)); } else if (propertyType == typeof(float)) { propertyInfo.SetValue(config, sharedPreferences.GetFloat(fullName, 0)); } else if (propertyType == typeof(string)) { propertyInfo.SetValue(config, sharedPreferences.GetString(fullName, string.Empty)); } else if (propertyType == typeof(DateTime)) { long ticks = sharedPreferences.GetLong(fullName, 0); DateTime dateTime = new DateTime(ticks); propertyInfo.SetValue(config, dateTime); } else if (typeof(IAppConfig).GetTypeInfo().IsAssignableFrom(propertyType.GetTypeInfo())) { var subConfig = (IAppConfig)propertyInfo.GetValue(config); LoadRecursive(subConfig, keyPreset + propertyType.Name + "."); } } }
public GraphBuilder(IAppConfig appConfig, Definition definition = null) { if (definition == null) { if ((appConfig != null) && appConfig.Definitions.Any()) { CurrentDefinition = appConfig.Definitions.First(); } else { CurrentDefinition = MotherObjects.DefaultDefinition; } } else { CurrentDefinition = definition; } }
private void LoadRecursive(IAppConfig config, string keyPreset) { // Create map by scanning properties var keyStore = NSUbiquitousKeyValueStore.DefaultStore; var propertyInfos = config.GetType().GetTypeInfo().DeclaredProperties; foreach (PropertyInfo propertyInfo in propertyInfos) { var propertyType = propertyInfo.PropertyType; string fullName = keyPreset + propertyInfo.Name; if (propertyType == typeof(int)) { propertyInfo.SetValue(config, (int)keyStore.GetLong(fullName)); } else if (propertyType == typeof(bool)) { propertyInfo.SetValue(config, keyStore.GetBool(fullName)); } else if (propertyType == typeof(double)) { propertyInfo.SetValue(config, keyStore.GetDouble(fullName)); } else if (propertyType == typeof(float)) { propertyInfo.SetValue(config, (float)keyStore.GetDouble(fullName)); } else if (propertyType == typeof(string)) { propertyInfo.SetValue(config, keyStore.GetString(fullName)); } else if (propertyType == typeof(DateTime)) { long ticks = keyStore.GetLong(fullName); DateTime dateTime = new DateTime(ticks); propertyInfo.SetValue(config, dateTime); } else if (typeof(IAppConfig).GetTypeInfo().IsAssignableFrom(propertyType.GetTypeInfo())) { var subConfig = (IAppConfig)propertyInfo.GetValue(config); LoadRecursive(subConfig, keyPreset + propertyType.Name + "."); } } }
private void SaveRecursive(IAppConfig config, string keyPreset) { // Create map by scanning properties var keyStore = NSUbiquitousKeyValueStore.DefaultStore; var propertyInfos = config.GetType().GetTypeInfo().DeclaredProperties; foreach (PropertyInfo propertyInfo in propertyInfos) { var propertyType = propertyInfo.PropertyType; string fullName = keyPreset + propertyInfo.Name; object value = propertyInfo.GetValue(config); if (propertyType == typeof(int)) { keyStore.SetLong(fullName, (long)(int)value); } else if (propertyType == typeof(bool)) { keyStore.SetBool(fullName, (bool)value); } else if (propertyType == typeof(double) || (propertyType == typeof(float))) { keyStore.SetDouble(fullName, System.Convert.ToDouble(value)); } else if (propertyType == typeof(string)) { string stringValue = value == null ? string.Empty : (string)value; keyStore.SetString(fullName, stringValue); } else if (propertyType == typeof(DateTime)) { DateTime dateTime = (DateTime)value; keyStore.SetLong(fullName, dateTime.Ticks); } else if (typeof (IAppConfig).GetTypeInfo().IsAssignableFrom(propertyType.GetTypeInfo())) { var subConfig = (IAppConfig)propertyInfo.GetValue(config); SaveRecursive(subConfig, keyPreset + propertyType.Name + "."); } } }
public AccountController(AccountService service, IAppConfig config) { _config = config; _service = service; }
public DeviceAdminManager(IDeviceWorkflowRepo deviceWorkflowRepo, IUnitSetRepo unitSetRepo, IStateMachineRepo stateMachineRepo, IStateSetRepo stateSetRepo, IEventSetRepo eventSetRepo, IDependencyManager depManager, ISecurity securityManager, IAdminLogger logger, IAppConfig appConfig) : base(logger, appConfig, depManager, securityManager) { _deviceWorkflowRepo = deviceWorkflowRepo; _unitSetRepo = unitSetRepo; _stateMachineRepo = stateMachineRepo; _stateSetRepo = stateSetRepo; _eventSetRepo = eventSetRepo; }
public DeviceArchiveManager(IDeviceArchiveRepo archiveRepo, IDeviceArchiveConnector archiveConnector, IAdminLogger logger, IAppConfig appConfig, IDependencyManager depmanager, ISecurity security) : base(logger, appConfig, depmanager, security) { _archiveRepo = archiveRepo; _archiveConnector = archiveConnector; }
public ExportViewModel(IShell sh, IAppModel am, IDialogCoordinator dc, IAppConfig cfg, IMapper mapper, IExportService ex) { shell = sh; appModel = am; dialCoord = dc; this.mapper = mapper; export = ex; AvailableBoxes = appModel.Boxes; boards = new SourceList <BoardToExport>(); AvailableBoards = boards.SpawnCollection(); ExportJson = true; DatePostfix = true; SplitBoardsToFiles = false; PdfOptionsAvailable = new PdfOptionsAvailable { PageSizes = Enum.GetValues(typeof(PageSize)).Cast <PageSize>().ToArray(), PageOrientations = Enum.GetValues(typeof(PageOrientation)).Cast <PageOrientation>().ToArray(), ScaleFittings = Enum.GetValues(typeof(ScaleFitting)).Cast <ScaleFitting>().ToArray() }; PdfOptions = new PdfOptions { PageSize = PageSize.A4, PageOrientation = PageOrientation.Portrait, ScaleOptions = new ScaleOptions { Padding = new Thickness(), ScaleToFit = true, ScaleFitting = ScaleFitting.BothDirections, MaxScale = 1.0, MinScale = 0.0 } }; var canExport = boards .Connect() .AutoRefresh() .Filter(x => x.IsChecked) .Select(x => AvailableBoards.Count(y => y.IsChecked) > 0 && !string.IsNullOrEmpty(SelectedBox.Uri) && File.Exists(SelectedBox.Uri)); ExportCommand = ReactiveCommand.CreateFromTask(ExportCommandExecute, canExport); SelectTargetFolderCommand = ReactiveCommand.Create(SelectTargetFolderCommandExecute); CancelCommand = ReactiveCommand.Create(Close); this.ObservableForProperty(x => x.SelectedBox) .Where(x => x.Value != null) .Select(x => x.Value) .Subscribe(box => { boards.ClearAndAddRange(box.Boards.Items .Select(x => new BoardToExport { Board = x, IsChecked = true })); TargetFile = Path.GetFileNameWithoutExtension(box.Uri) + "_export"; }); this.ObservableForProperty(x => x.TargetFolder) .Subscribe(x => cfg.ArchiveFolder = x.Value); SelectedBox = AvailableBoxes.First(); var fi = new FileInfo(SelectedBox.Uri); TargetFolder = cfg.ArchiveFolder ?? fi.DirectoryName; }
public GitRepository(IAppConfig config, string rootPath) { this.config = config; this.rootPath = rootPath; }
public DataStreamManager(IDataStreamRepo dataStreamRepo, ISharedConnectionManager sharedDataStreamConnectionManager, IDefaultInternalDataStreamConnectionSettings defaultConnectionSettings, IOrgUtils orgUtils, IAdminLogger logger, ISecureStorage secureStorage, IAppConfig appConfig, IDependencyManager depmanager, ISecurity security) : base(logger, appConfig, depmanager, security) { _dataStreamRepo = dataStreamRepo ?? throw new ArgumentNullException(nameof(IDataStreamRepo)); _secureStorage = secureStorage ?? throw new ArgumentNullException(nameof(ISecureStorage)); _defaultConnectionSettings = defaultConnectionSettings ?? throw new ArgumentNullException(nameof(IDefaultInternalDataStreamConnectionSettings)); _sharedDataStreamConnectionManager = sharedDataStreamConnectionManager ?? throw new ArgumentNullException(nameof(SharedConnectionManager)); _orgUtils = orgUtils ?? throw new ArgumentNullException(nameof(IOrgUtils)); }
public static void SaveConfig(IAppConfig config) { if (config.LocationType == AppConfigLocationType.Default) { } }
public PartsKitManager(IPartsKitRepo repo, IAppConfig appConfig, IAdminLogger logger, IDependencyManager depmanager, ISecurity security) : base(logger, appConfig, depmanager, security) { _repo = repo;; }
public StartupViewModel(IShell shell, IAppModel appModel, IDialogCoordinator dc, IMapper mp, IAppConfig cfg, ILogger l) { this.shell = shell as IShell; this.appModel = appModel; dialCoord = dc; mapper = mp; appConfig = cfg; log = l; ColorTheme = appConfig.ColorTheme; initialized = false; OpenRecentBoxCommand = ReactiveCommand.Create <RecentViewModel>(async(rvm) => { if (await OpenBoardView(rvm.Uri)) { appConfig.UpdateRecent(rvm.Uri, rvm.Pinned); } }); NewFileCommand = ReactiveCommand.Create(() => this.shell.ShowView <WizardView>( new WizardViewRequest { ViewId = "Creating new file", Uri = null })); OpenFileCommand = ReactiveCommand.CreateFromTask(async _ => { var dialog = new OpenFileDialog { Filter = @"SQLite DataBase | *.kam", Title = @"Select exists database" }; if (dialog.ShowDialog() == DialogResult.OK) { var uri = dialog.FileName; if (await OpenBoardView(uri)) { appConfig.UpdateRecent(uri, false); } } }); OpenPublicBoardCommand = ReactiveCommand .CreateFromTask <PublicBoardJson>(OpenPublicBoardCommandExecute); ImportCommand = ReactiveCommand.Create(() => this.shell.ShowView <ImportView>(null, new UiShowOptions { Title = "Import" })); var whenBoardSelected = shell .WhenAny(x => x.SelectedView, x => x.Value?.ViewModel is BoardEditViewModel) .Publish(); ExportCommand = ReactiveCommand.Create(() => this.shell.ShowView <ExportView>(null, new UiShowOptions { Title = "Export" }), whenBoardSelected); PrintCommand = ReactiveCommand.Create(PrintCommandExecute, whenBoardSelected); whenBoardSelected.Connect(); ShowStartupCommand = ReactiveCommand.Create(() => { shell.ShowView <StartupView>( viewRequest: new ViewRequest { ViewId = StartupViewModel.StartupViewId }, options: new UiShowOptions { Title = "Start Page", CanClose = false }); }); SettingsCommand = ReactiveCommand.Create(() => { shell.ShowView <SettingsView>( viewRequest: new ViewRequest { ViewId = SettingsViewModel.StartupViewId }, options: new UiShowOptions { Title = "Settings", CanClose = true }); }); ExitCommand = ReactiveCommand.Create(() => App.Current.Shutdown()); Pinned = appConfig.RecentObservable .Filter(x => x.Pinned); var notPinned = appConfig.RecentObservable .Filter(x => !x.Pinned); Today = notPinned .Filter(x => x.LastAccess.IsToday()); Yesterday = notPinned .Filter(x => x.LastAccess.IsYesterday()); ThisMonth = notPinned .Filter(x => !x.LastAccess.IsToday() && !x.LastAccess.IsYesterday() && x.LastAccess.IsThisMonth()); Older = notPinned .Filter(x => !x.LastAccess.IsToday() && !x.LastAccess.IsYesterday() && !x.LastAccess.IsThisMonth()); // TODO: move autosaver to AppConfig appConfig.RecentObservable .WhenAnyPropertyChanged("Pinned") .Subscribe(x => appConfig.UpdateRecent(x.Uri, x.Pinned)); appConfig.GetStarted.Subscribe(x => GetStarted = x); var ver = Assembly.GetExecutingAssembly().GetName(); appConfig.Basement .Subscribe(x => Basement = x + $"v{ver.Version.Major}.{ver.Version.Minor}.{ver.Version.Build}"); if (appConfig.OpenLatestAtStartup) { foreach (var uri in appConfig.LastOpenedAtStartup) { Dispatcher.CurrentDispatcher.InvokeAsync(() => OpenBoardView(uri)); } } appConfig.ColorThemeObservable .Subscribe(x => UpdateColorTheme()); } //ctor
public AuthController(IAppConfig appConfig, IAuthHelpers authHelpers) { AppConfig = appConfig; _authHelpers = authHelpers; }
public IAppConfig MergeWithDefault(IAppConfig appConfig) { return(MergeConfigs(GetDefaultConfig(), appConfig)); }
public LogRepository(IAppContext context, IAppConfig config, IMapper mapper, IServiceSettings settings, ILogService logger) : base(context, config, mapper, settings, logger) { }
public DeviceTypeManager(IDeviceTypeRepo deviceTypeRepo, IDeviceAdminManager deviceAdminManager, IAdminLogger logger, IAppConfig appConfig, IDependencyManager depmanager, ISecurity security) : base(logger, appConfig, depmanager, security) { _deviceTypeRepo = deviceTypeRepo; }
public static void SetupNullHelloWorldSayer(this IAppConfig appConfig) { appConfig[Constants.OutputServiceKey] = null; }
public RoomService(IRoomRepository RoomRepository, IAppConfig appConfig) : base(RoomRepository, appConfig, new RoomMapper()) { }
public EmailService(IAppConfig appConfig, ILog log) { this.appConfig = appConfig; this.log = log; }
private static void ParseTreeStructure(ICollection<ConfigurationPair> queue, IAppConfig appConfig) { foreach (var item in queue) { var elementName = item.ElementName; if (string.IsNullOrWhiteSpace(elementName)) { break; } foreach (var attributes in item.Attributes) { if (elementName.Equals(ConfigurationStaticData.DefinitionTagName)) { appConfig.Definitions.Add( new Definition { Name = attributes[ConfigurationStaticData.NameStructureAttributeName] }); } else if (elementName.Equals(ConfigurationStaticData.VertexTagName)) { var definition = appConfig.Definitions.Last(); var vertexConfig = new VertexConfig { Entity = attributes[ConfigurationStaticData.EntityAttributeName], LabelAttributeName = attributes[ConfigurationStaticData.LabelAttributeName] }; definition.Vertex = vertexConfig; } else if (elementName.Equals(ConfigurationStaticData.EdgeTagName)) { var definition = appConfig.Definitions.Last(); var edgeConfig = new EdgeConfig { Entity = attributes[ConfigurationStaticData.EntityAttributeName], LabelAttributeName = attributes[ConfigurationStaticData.LabelAttributeName], SourceVertexAttributeName = attributes[ConfigurationStaticData.SourceVertexAttributeName], TargetVertexAttributeName = attributes[ConfigurationStaticData.TargetVertexAttributeName] }; definition.Edge = edgeConfig; } } } queue.Clear(); }
public UsageMetricsManager(IAdminLogger adminLogger, IAppConfig appConfig, IUsageMetricsRepo metricsRepo, IDependencyManager dependencyManager, ISecurity security) : base(adminLogger, appConfig, dependencyManager, security) { _metricsRepo = metricsRepo; }
protected ConectionStringProvider(IAppConfig appConfig, string sigla) { _appConfig = appConfig; _sigla = sigla; }
/// <summary> /// /// </summary> /// <param name="config"></param> public virtual void SetConfig(IAppConfig config) { Config = config; }
public SimulatorNetworkManager(ISimulatorNetworkRepo simulatorRepo, ISecureStorage secureStorage, IAdminLogger logger, IAppConfig appConfig, IDependencyManager depmanager, ISecurity security) : base(logger, appConfig, depmanager, security) { _repo = simulatorRepo; _secureStorage = secureStorage; }
public MessageLog(IAppConfig appConfig) : base(appConfig) { }
public ProssimitaController(IGetMezziInProssimita getmezziInProssimita, IAppConfig appConfig) { this.getmezziInProssimita = getmezziInProssimita; this.appConfig = appConfig; }
public Mail(IAppConfig appConfig) { this._appConfig = appConfig; this._httpWebHelper = new HttpWebHelper(_appConfig); }
public ServiceManager(IAppConfig i_AppConfig) { m_AppConfig = i_AppConfig.GetInstance(); }
public HomeController(PlaylistContext playlistContext, IPlaylistSynchronizer playlistSynchronizer, IAppConfig appConfig) { _playlistContext = playlistContext ?? throw new ArgumentNullException(nameof(playlistContext)); _playlistSynchronizer = playlistSynchronizer ?? throw new ArgumentNullException(nameof(playlistSynchronizer)); _appConfig = appConfig ?? throw new ArgumentNullException(nameof(appConfig)); }
public VoiceVerify(IAppConfig appConfig) : base(appConfig) { }
private void SaveRecursive(IAppConfig config, string keyPreset) { // Create map by scanning properties var sharedPreferences = PreferenceManager.GetDefaultSharedPreferences(_context); var editor = sharedPreferences.Edit(); var propertyInfos = config.GetType().GetTypeInfo().DeclaredProperties; foreach (PropertyInfo propertyInfo in propertyInfos) { var propertyType = propertyInfo.PropertyType; string fullName = keyPreset + propertyInfo.Name; object value = propertyInfo.GetValue(config); bool isAssignable = typeof(IAppConfig).GetTypeInfo().IsAssignableFrom(propertyType.GetTypeInfo()); //Debug.WriteLine("{0} - {1} - isAssignable: {2}", fullName, propertyInfo.PropertyType.Name, isAssignable); if (propertyType == typeof(int)) { editor.PutInt(fullName, (int) value); } else if (propertyType == typeof(bool)) { editor.PutBoolean(fullName, (bool)value); } else if (propertyType == typeof(double) || (propertyType == typeof(float))) { editor.PutFloat(fullName, (float)value); } else if (propertyType == typeof(string)) { string stringValue = value == null ? string.Empty : (string)value; editor.PutString(fullName, stringValue); } else if (propertyType == typeof(DateTime)) { DateTime dateTime = (DateTime) value; editor.PutLong(fullName, dateTime.Ticks); } else if (typeof(IAppConfig).GetTypeInfo().IsAssignableFrom(propertyType.GetTypeInfo())) { var subConfig = (IAppConfig)propertyInfo.GetValue(config); SaveRecursive(subConfig, keyPreset + propertyType.Name + "."); } } editor.Commit(); }
public ToolTipNotificationService(IAppConfig appConfig) : base(appConfig) { }
private async Task<Document> MapDocumentModel(string documentFilePath, IAppConfig appConfig) { Document documentModel = null; var extension = Path.GetExtension(documentFilePath); if (extension != null) { var lowercaseExtension = extension.Substring(1).ToLowerInvariant(); if (lowercaseExtension.Equals(ConfigurationStaticData.XmlFormat)) { documentModel = await new DocumentMapperClient( new LightDocumentMapperWithReader { AppConfigMapper = appConfigMapper, EventAggregator = eventAggregator }).Map( documentFilePath, appConfig.Filepath); } else if (lowercaseExtension.Equals(ConfigurationStaticData.ConllxFormat) || lowercaseExtension.Equals(ConfigurationStaticData.ConllFormat)) { documentModel = await new DocumentMapperClient( new LightConllxDocumentMapper { AppConfigMapper = appConfigMapper, EventAggregator = eventAggregator }).Map( documentFilePath, appConfig.Filepath); } else { eventAggregator.GetEvent<StatusNotificationEvent>() .Publish( "Cannot load the file selected,because the format is not supported. Supported formats are XML and CONLLX."); } } return documentModel; }
public CrmGenerator(IAppConfig config) { _config = config ?? throw new ArgumentNullException(nameof(config)); }
private DataClient CreateDataClient(IMapperService mapperService, IConnectivityService connectivityService, ISerializerService serializerService, IHttpService httpService, IAppConfig appConfig) { return new DataClient (mapperService, connectivityService, serializerService, httpService, appConfig); }
public FoodService(IRepository <PetEntity> petRepository, IAppConfig appConfig) { PetRepository = petRepository; AppConfig = appConfig; }
public AuthController(ILogger <AuthController> logger, IAppConfig appConfig, IUserManager userManager) { _logger = logger; _appConfig = appConfig; _userManager = userManager; }
private static void ParseDataStructure(ICollection<ConfigurationPair> queue, IAppConfig appConfig) { if (queue.Count <= 0) { return; } var dataStructure = appConfig.DataStructures.LastOrDefault(); if (dataStructure == null) { return; } foreach (var item in queue) { var elementName = item.ElementName; if (string.IsNullOrWhiteSpace(elementName)) { break; } foreach (var attributes in item.Attributes) { if (elementName.Equals(ConfigurationStaticData.DataStructureTagName)) { foreach (var attribute in attributes) { if (attribute.Key == "format") { dataStructure.Format = attribute.Value; break; } } } else if (elementName.Equals(ConfigurationStaticData.AllowedValueSetTagName)) { if (dataStructure.Elements.Any()) { var element = dataStructure.Elements.Last(); if (element.Attributes.Any()) { var lastAttribute = element.Attributes.Last(); lastAttribute.AllowedValuesSet = attributes.Values; } } } else if (attributes.ContainsKey(ConfigurationStaticData.EntityAttributeName)) { var entity = EntityFactory.GetEntity(attributes[ConfigurationStaticData.EntityAttributeName]); if (entity is Element) { var asElement = entity as Element; asElement.Entity = attributes[ConfigurationStaticData.EntityAttributeName]; } if (entity is Attribute) { var attribute = entity as Attribute; if (dataStructure.Elements.Any()) { var element = dataStructure.Elements.Last(); attribute.DisplayName = attributes[ConfigurationStaticData.DisplayNameAttributeName]; attribute.Name = attributes[ConfigurationStaticData.NameStructureAttributeName]; attribute.IsOptional = bool.Parse(attributes[ConfigurationStaticData.IsOptionalAttributeName]); attribute.IsEditable = bool.Parse(attributes[ConfigurationStaticData.IsEditableAttributeName]); if (attributes.ContainsKey(ConfigurationStaticData.PositionAttributeName)) { attribute.Position = int.Parse(attributes[ConfigurationStaticData.PositionAttributeName]); } element.Attributes.Add(attribute); } } else { var element = entity as Element; if (element != null) { element.DisplayName = attributes[ConfigurationStaticData.DisplayNameAttributeName]; element.Name = attributes[ConfigurationStaticData.NameStructureAttributeName]; element.IsOptional = bool.Parse(attributes[ConfigurationStaticData.IsOptionalAttributeName]); dataStructure.Elements.Add(element); } } } } } queue.Clear(); }
public VoiceMultiXSend(IAppConfig appConfig) : base(appConfig) { }
public RequestHelpers(IAppConfig appConfig) { _appConfig = appConfig; }
public AddressBookMail(IAppConfig appConfig) : base(appConfig) { }
protected SendBase(IAppConfig appconfig) { _appConfig = appconfig; }
public MailXSend(IAppConfig appconfig) : base(appconfig) { }