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);
        }
예제 #2
0
 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 + ".");
                }
            }
        }
예제 #4
0
 public DropDatabaseTask(IAppConfig appConfig)
 {
     var url = new MongoUrl(appConfig.ProxyDbConnectionString);
     _mongoDatabase = new MongoClient(url)
         .GetServer()
         .GetDatabase(url.DatabaseName);
 }
예제 #5
0
        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;
 }
예제 #7
0
 public VkApiSettings(IAppConfig config)
 {
     Language = GetVkLanguage(config.Language);
     Permissions = AppPermissions.Messages
                   | AppPermissions.Notifications
                   | AppPermissions.Friends
                   | AppPermissions.Offline;
 }
예제 #8
0
 public VkAuthorizer(IAppConfig appConfig
     , ILanguageRepository languageRepository
     , VkApiClient apiClient
     , IOAuthAuthorizer oAuthAuthorizer)
 {
     _appConfig = appConfig;
     _languageRepository = languageRepository;
     _apiClient = apiClient;
     _oAuthAuthorizer = oAuthAuthorizer;
 }
예제 #9
0
 protected SettingsRunnableDefault(IAppConfig appConfig,
                                   string ativo,
                                   string intervaloSemServico,
                                   string intervaloInativo)
 {
     _appConfig = appConfig;
     _ativo = ativo;
     _intervaloSemServico = intervaloSemServico;
     _intervaloInativo = intervaloInativo;
 }
예제 #10
0
 //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);
 }
예제 #11
0
        public AuthHelpers(IAppConfig appConfig)
        {
            _appConfig = appConfig;

            storageAccount = CloudStorageAccount.Parse(appConfig.StorageConnectionString);
            blobClient = storageAccount.CreateCloudBlobClient();
            container = blobClient.GetContainerReference("apipersistenace");
            container.CreateIfNotExists();
            Blob = container.GetBlockBlobReference("tenantId");
        }
예제 #12
0
		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> ();
			}
		}
예제 #13
0
		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);
        }
예제 #15
0
        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);
            }
        }
예제 #16
0
        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 + ".");
                }
            }
        }
예제 #17
0
 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;
     }
 }
예제 #18
0
        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 + ".");
                }
            }            
        }
예제 #19
0
        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 + ".");
                }
            }
        }
예제 #20
0
 public AccountController(AccountService service, IAppConfig config)
 {
     _config  = config;
     _service = service;
 }
예제 #21
0
 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;
 }
예제 #23
0
        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;
        }
예제 #24
0
 public GitRepository(IAppConfig config, string rootPath)
 {
     this.config   = config;
     this.rootPath = rootPath;
 }
예제 #25
0
 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));
 }
예제 #26
0
 public static void SaveConfig(IAppConfig config)
 {
     if (config.LocationType == AppConfigLocationType.Default)
     {
     }
 }
예제 #27
0
 public PartsKitManager(IPartsKitRepo repo, IAppConfig appConfig, IAdminLogger logger,
                        IDependencyManager depmanager, ISecurity security) : base(logger, appConfig, depmanager, security)
 {
     _repo = repo;;
 }
예제 #28
0
        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
예제 #29
0
 public AuthController(IAppConfig appConfig, IAuthHelpers authHelpers)
 {
     AppConfig = appConfig;
     _authHelpers = authHelpers;
 }
예제 #30
0
 public IAppConfig MergeWithDefault(IAppConfig appConfig)
 {
     return(MergeConfigs(GetDefaultConfig(), appConfig));
 }
예제 #31
0
 public LogRepository(IAppContext context, IAppConfig config, IMapper mapper, IServiceSettings settings, ILogService logger)
     : base(context, config, mapper, settings, logger)
 {
 }
예제 #32
0
 public DeviceTypeManager(IDeviceTypeRepo deviceTypeRepo, IDeviceAdminManager deviceAdminManager,
                          IAdminLogger logger, IAppConfig appConfig, IDependencyManager depmanager, ISecurity security) :
     base(logger, appConfig, depmanager, security)
 {
     _deviceTypeRepo = deviceTypeRepo;
 }
예제 #33
0
 public static void SetupNullHelloWorldSayer(this IAppConfig appConfig)
 {
     appConfig[Constants.OutputServiceKey] = null;
 }
예제 #34
0
 public RoomService(IRoomRepository RoomRepository, IAppConfig appConfig)
     : base(RoomRepository, appConfig, new RoomMapper())
 {
 }
예제 #35
0
 public EmailService(IAppConfig appConfig, ILog log)
 {
     this.appConfig = appConfig;
     this.log       = log;
 }
예제 #36
0
        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();
        }
예제 #37
0
 public UsageMetricsManager(IAdminLogger adminLogger, IAppConfig appConfig, IUsageMetricsRepo metricsRepo, IDependencyManager dependencyManager, ISecurity security) : base(adminLogger, appConfig, dependencyManager, security)
 {
     _metricsRepo = metricsRepo;
 }
예제 #38
0
 protected ConectionStringProvider(IAppConfig appConfig, string sigla)
 {
     _appConfig = appConfig;
     _sigla = sigla;
 }
예제 #39
0
 /// <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;
 }
예제 #41
0
 public MessageLog(IAppConfig appConfig) : base(appConfig)
 {
 }
예제 #42
0
 public ProssimitaController(IGetMezziInProssimita getmezziInProssimita, IAppConfig appConfig)
 {
     this.getmezziInProssimita = getmezziInProssimita;
     this.appConfig            = appConfig;
 }
예제 #43
0
 public Mail(IAppConfig appConfig)
 {
     this._appConfig     = appConfig;
     this._httpWebHelper = new HttpWebHelper(_appConfig);
 }
예제 #44
0
 public ServiceManager(IAppConfig i_AppConfig)
 {
     m_AppConfig = i_AppConfig.GetInstance();
 }
예제 #45
0
 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));
 }
예제 #46
0
 public VoiceVerify(IAppConfig appConfig) : base(appConfig)
 {
 }
예제 #47
0
        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)
 {
 }
예제 #49
0
        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;
        }
예제 #50
0
 public CrmGenerator(IAppConfig config)
 {
     _config = config ?? throw new ArgumentNullException(nameof(config));
 }
예제 #51
0
		private DataClient CreateDataClient(IMapperService mapperService, 
			IConnectivityService connectivityService, 
			ISerializerService serializerService,
			IHttpService httpService,
			IAppConfig appConfig)
		{
			return new DataClient (mapperService, connectivityService, serializerService, httpService, appConfig);
		}
예제 #52
0
 public FoodService(IRepository <PetEntity> petRepository, IAppConfig appConfig)
 {
     PetRepository = petRepository;
     AppConfig     = appConfig;
 }
예제 #53
0
파일: Mail.cs 프로젝트: guiling/Submail
 public Mail(IAppConfig appConfig)
 {
     this._appConfig = appConfig;
     this._httpWebHelper = new HttpWebHelper(_appConfig);
 }
 public AuthController(ILogger <AuthController> logger, IAppConfig appConfig, IUserManager userManager)
 {
     _logger      = logger;
     _appConfig   = appConfig;
     _userManager = userManager;
 }
예제 #55
0
        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();
        }
예제 #56
0
 public VoiceMultiXSend(IAppConfig appConfig) : base(appConfig)
 {
 }
예제 #57
0
 public RequestHelpers(IAppConfig appConfig)
 {
     _appConfig = appConfig;
 }
예제 #58
0
 public AddressBookMail(IAppConfig appConfig) : base(appConfig)
 {
 }
예제 #59
0
파일: SendBase.cs 프로젝트: guiling/Submail
 protected SendBase(IAppConfig appconfig)
 {
     _appConfig = appconfig;
 }
예제 #60
0
 public MailXSend(IAppConfig appconfig) : base(appconfig)
 {
 }