コード例 #1
0
 public Fixture(IStringService stringService
                , IOtherStringService otherStringService
                )
 {
     this.stringService      = stringService;
     this.otherStringService = otherStringService;
 }
コード例 #2
0
 public ReferenceController(IMathService mathService, IStringService stringService, IShapeService shapeService, ITokenSettings tokenSettings)
 {
     _mathService   = mathService;
     _stringService = stringService;
     _shapeService  = shapeService;
     _tokenSettings = tokenSettings;
 }
コード例 #3
0
ファイル: AddIn.cs プロジェクト: ewin66/uniframework
        /// <summary>
        /// 解析图象、字符串资源
        /// </summary>
        /// <param name="configuration">配置项</param>
        private void ParseResource(IConfiguration configuration)
        {
            Guard.ArgumentNotNull(configuration, "configuration");
            IStringService strService = workItem.Services.Get <IStringService>();

            if (strService != null)
            {
                foreach (IConfiguration config in configuration.Children)
                {
                    switch (config.Name)
                    {
                    //case "Images": // Images
                    //    foreach (IConfiguration image in config.Children)
                    //    {
                    //        if (image.Attributes["key"] != null && image.Attributes["value"] != null)
                    //            strService.RegisterImages(image.Attributes["key"], image.Attributes["value"]);
                    //    }
                    //    break;

                    // 当前还没有实现直接注册字符串资源
                    case "Strings":      // Strings
                        foreach (IConfiguration str in config.Children)
                        {
                            if (str.Attributes["key"] != null && str.Attributes["value"] != null)
                            {
                                strService.Register(str.Attributes["key"], str.Attributes["value"]);
                            }
                        }
                        break;
                    }
                }
            }
        }
コード例 #4
0
        /// <summary>
        /// 注册用户信息
        /// </summary>
        private void RegisterUserInfo()
        {
            IInitializeService initService = RootWorkItem.Services.Get <IInitializeService>();

            if (initService != null)
            {
                UserInfo user = initService.GetUserInfo(CommunicateProxy.UserName);
                RootWorkItem.Items.Add(user, "CurrentUser");
                IMembershipService membershipServce = RootWorkItem.Services.Get <IMembershipService>();
                if (membershipServce != null)
                {
                    string[] roles = membershipServce.GetRolesForUser(CommunicateProxy.UserName);
                    Thread.CurrentPrincipal = new GenericPrincipal(new GenericIdentity(CommunicateProxy.UserName), roles);
                    IStringService strService = RootWorkItem.Services.Get <IStringService>();
                    if (strService != null)
                    {
                        strService.Register("CurrentUser", CommunicateProxy.UserName);
                    }
                }
                // 为环境变量赋值
                SmartClientEnvironment scEnvironment = RootWorkItem.Services.Get <SmartClientEnvironment>();
                if (scEnvironment != null)
                {
                    scEnvironment.CurrentUser = user;
                }
            }
        }
コード例 #5
0
        private const int SizeSalt = 16; // 256 bit salt

        public AuthenticationConfigurationService(IEmailConfigurationService emailConfigurationService, IStringService stringService, IAuthenticationUrlService authenticationUrlService, IWebHelperService webHelperService)
        {
            _authenticationUrlService  = authenticationUrlService;
            _emailConfigurationService = emailConfigurationService;
            _stringService             = stringService;
            _webHelperService          = webHelperService;
        }
コード例 #6
0
 public CartBodyViewComponent(
     IShoppingCartService shoppingCartService,
     IStringService stringService)
 {
     this.shoppingCartService = shoppingCartService;
     this.stringService       = stringService;
 }
コード例 #7
0
        static void Main(string[] args)
        {
            TrustAllCertificates();

            Console.WriteLine("Enter a string to reverse, then press <ENTER>");
            string userInputString = Console.ReadLine();

            Console.WriteLine();

            string acsEndpoint = String.Format("https://{0}.{1}/v2/wstrust/13/issuedtoken-symmetric", SamplesConfiguration.ServiceNamespace, SamplesConfiguration.AcsHostUrl);
            string idpEndpoint = ConfigurationManager.AppSettings.Get("IdpEndpointAddress");

            ChannelFactory <IStringService> stringServiceFactory = CreateChannelFactory(acsEndpoint, idpEndpoint, ServiceAddress);
            IStringService stringService = stringServiceFactory.CreateChannel();

            ICommunicationObject channel = (ICommunicationObject)stringService;

            try
            {
                string outputString = stringService.Reverse(userInputString);

                Console.WriteLine("Service responded with: " + outputString);
                Console.WriteLine();
                Console.WriteLine("Press <ENTER> to exit");
                Console.ReadLine();

                channel.Close();
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception thrown during execution: " + e.ToString());
                channel.Abort();
            }
        }
コード例 #8
0
 public OrderDetailsViewComponent(
     IOrdersService ordersService,
     IStringService stringService)
 {
     this.ordersService = ordersService;
     this.stringService = stringService;
 }
コード例 #9
0
 public StringsController(
     IHttpContextAccessor httpContextAccessor,
     IStringService stringService)
 {
     _httpContextAccessor = httpContextAccessor;
     _stringService       = stringService;
 }
コード例 #10
0
 public ForumConfigurationService(IEmailConfigurationService emailConfigurationService, IForumUrlService forumUrlService, IOptions <ForumOptions> options, IStringService stringService, IWebHelperService webHelperService)
 {
     _emailConfigurationService = emailConfigurationService;
     _forumUrlService           = forumUrlService;
     _options          = options;
     _stringService    = stringService;
     _webHelperService = webHelperService;
 }
コード例 #11
0
 /// <summary>
 /// Constructor sets dependent components.
 /// </summary>
 /// <param name="authenticationService">Retrieve logged on user details.</param>
 /// <param name="authorizationService">Authorization service.</param>
 /// <param name="formHelperService">Form helper.</param>
 /// <param name="stringService">Used to retrieve values from line in a CSV file.</param>
 /// <param name="tableRepository">Table repository.</param>
 public TableService(IAuthenticationService authenticationService, IAuthorizationService authorizationService, IFormHelperService formHelperService, IStringService stringService, ITableRepository tableRepository)
 {
     _authenticationService = authenticationService;
     _authorizationService  = authorizationService;
     _formHelperService     = formHelperService;
     _stringService         = stringService;
     _tableRepository       = tableRepository;
 }
コード例 #12
0
ファイル: SearchController.cs プロジェクト: bchakarov/XeMart
 public SearchController(
     ISubcategoriesService subcategoriesService,
     IProductsService productsService,
     IStringService stringService)
 {
     this.subcategoriesService = subcategoriesService;
     this.productsService      = productsService;
     this.stringService        = stringService;
 }
コード例 #13
0
 public MessageService(ILetterMappingRepository letterMappingRepository,
                       ISettingsRepository settingsRepository,
                       IMessageRepository messageRepository,
                       IStringService stringService)
 {
     this.letterMappingRepository = letterMappingRepository;
     this.settingsRepository      = settingsRepository;
     this.messageRepository       = messageRepository;
     this.stringService           = stringService;
 }
コード例 #14
0
        public void Setup()
        {
            var services = new ServiceCollection();

            services.AddTransient <IStringService, StringService>();

            var serviceProvider = services.BuildServiceProvider();

            _stringService = serviceProvider.GetService <IStringService>();
        }
コード例 #15
0
 public AuthenticationValidator(IAuthenticationConfigurationService authenticationConfigurationService, IImageAnalysisService imageAnalysisService, IModelValidator modelValidator, ISecurityService securityService, IStringService stringService, IUploadService uploadService, IUserRepository userRepository, IWebRepository webRepository)
 {
     _authenticationConfigurationService = authenticationConfigurationService;
     _imageAnalysisService = imageAnalysisService;
     _modelValidator       = modelValidator;
     _securityService      = securityService;
     _stringService        = stringService;
     _uploadService        = uploadService;
     _userRepository       = userRepository;
     _webRepository        = webRepository;
 }
コード例 #16
0
ファイル: ArticlesService.cs プロジェクト: iluhakhurtin/blog
 public ArticlesService(IRepositories repositories,
                        IStringService stringService,
                        IRolesService rolesService,
                        RoleManager <ApplicationRole> roleManager)
 {
     this.articlesRepository          = repositories.ArticlesRepository;
     this.articleRolesRepository      = repositories.ArticleRolesRepository;
     this.articleCategoriesRepository = repositories.ArticleCategoriesRepository;
     this.roleManager   = roleManager;
     this.stringService = stringService;
     this.rolesService  = rolesService;
 }
コード例 #17
0
 public UsersApiController(
     ILog log,
     IServices services,
     IRetrievers retrievers,
     UserManager <ApplicationUser> userManager)
     : base(log)
 {
     this.stringService  = services.StringService;
     this.rolesService   = services.RolesService;
     this.usersRetriever = retrievers.UsersRetriever;
     this.userManager    = userManager;
 }
コード例 #18
0
 public BuildStartedHandler(
     [NotNull] ILoggerContext context,
     [NotNull] ILogWriter logWriter,
     [NotNull] IMessageWriter messageWriter,
     [NotNull] IHierarchicalMessageWriter hierarchicalMessageWriter,
     [NotNull] IStringService stringService)
 {
     _stringService             = stringService ?? throw new ArgumentNullException(nameof(stringService));
     _hierarchicalMessageWriter = hierarchicalMessageWriter ?? throw new ArgumentNullException(nameof(hierarchicalMessageWriter));
     _messageWriter             = messageWriter ?? throw new ArgumentNullException(nameof(messageWriter));
     _context   = context ?? throw new ArgumentNullException(nameof(context));
     _logWriter = logWriter ?? throw new ArgumentNullException(nameof(logWriter));
 }
コード例 #19
0
ファイル: BuilderUtility.cs プロジェクト: ewin66/uniframework
        /// <summary>
        /// 获取字符串资源值
        /// </summary>
        /// <param name="workItem">工作项.</param>
        /// <param name="key">关键字</param>
        /// <returns>如果字符串服务中存在指定关键字的值,返回其值否则直接返回其关键字</returns>
        public static String GetStringRES(WorkItem workItem, string key)
        {
            IStringService strService = workItem.Services.Get <IStringService>();

            if (strService != null && !String.IsNullOrEmpty(strService[key]))
            {
                return(strService[key]);
            }
            else
            {
                return(key);
            }
        }
コード例 #20
0
        public MainWindowViewModel(IEventAggregator eventAggregator, IStringService stringService)
            : base(eventAggregator)
        {
            _stringService = stringService;

            // if you initialize in your constructor
            // don't call the property: it calls a virtual method
            // use the field instead
            _sampleStringProperty = "my sample string value";
            _statusMessage        = "ready";


            InitializeEventAggregatorHandling();
        }
コード例 #21
0
 public AuthenticationService(IAuthenticationConfigurationService authenticationConfigurationService, IAuthenticationProviderService authenticationProviderService, IAuthenticationValidator authenticationValidator, IEmailService emailService, IImageAnalysisService imageAnalysisService, ISecurityService securityService, IStringService stringService, IUnitOfWorkFactory unitOfWorkFactory, IUserRepository userRepository, IUploadService uploadService, IWebHelperService webHelperService)
 {
     _authenticationConfigurationService = authenticationConfigurationService;
     _authenticationProviderService      = authenticationProviderService;
     _authenticationValidator            = authenticationValidator;
     _emailService         = emailService;
     _imageAnalysisService = imageAnalysisService;
     _securityService      = securityService;
     _stringService        = stringService;
     _unitOfWorkFactory    = unitOfWorkFactory;
     _uploadService        = uploadService;
     _userRepository       = userRepository;
     _webHelperService     = webHelperService;
 }
コード例 #22
0
 public HomeController(
     IUserMessagesService userMessagesService,
     IOrdersService ordersService,
     IProductsService productsService,
     IHomePageSlidesService homePageSlidesService,
     IStringService stringService,
     IDistributedCache cache)
 {
     this.userMessagesService   = userMessagesService;
     this.ordersService         = ordersService;
     this.productsService       = productsService;
     this.homePageSlidesService = homePageSlidesService;
     this.stringService         = stringService;
     this.distributedCache      = cache;
 }
コード例 #23
0
 public MessageWriter(
     [NotNull] ILoggerContext context,
     [NotNull] ILogWriter logWriter,
     [NotNull] IBuildEventManager buildEventManager,
     [NotNull] ILogFormatter logFormatter,
     [NotNull] IEventFormatter eventFormatter,
     [NotNull] IStringService stringService)
 {
     _stringService     = stringService ?? throw new ArgumentNullException(nameof(stringService));
     _eventFormatter    = eventFormatter ?? throw new ArgumentNullException(nameof(eventFormatter));
     _logFormatter      = logFormatter ?? throw new ArgumentNullException(nameof(logFormatter));
     _buildEventManager = buildEventManager ?? throw new ArgumentNullException(nameof(buildEventManager));
     _context           = context ?? throw new ArgumentNullException(nameof(context));
     _logWriter         = logWriter ?? throw new ArgumentNullException(nameof(logWriter));
 }
コード例 #24
0
 public TaskFinishedHandler(
     [NotNull] ILoggerContext context,
     [NotNull] ILogWriter logWriter,
     [NotNull] IPerformanceCounterFactory performanceCounterFactory,
     [NotNull] IMessageWriter messageWriter,
     [NotNull] IDeferredMessageWriter deferredMessageWriter,
     [NotNull] IStringService stringService)
 {
     _stringService         = stringService ?? throw new ArgumentNullException(nameof(stringService));
     _deferredMessageWriter = deferredMessageWriter ?? throw new ArgumentNullException(nameof(deferredMessageWriter));
     _messageWriter         = messageWriter ?? throw new ArgumentNullException(nameof(messageWriter));
     _context   = context ?? throw new ArgumentNullException(nameof(context));
     _logWriter = logWriter ?? throw new ArgumentNullException(nameof(logWriter));
     _performanceCounterFactory = performanceCounterFactory ?? throw new ArgumentNullException(nameof(performanceCounterFactory));
 }
コード例 #25
0
        public ConfigModel GetConfig(IStringService stringService, IFileService fileService, IProcessingPlant processingPlant)
        {
            _fileService = fileService;

            string mainDirectory = AppDomain.CurrentDomain.BaseDirectory;

            string path = GetLogConfigPath();

            if (string.IsNullOrEmpty(path))
            {
                _logFile    = _logFileDefaults;
                _debugOnly  = _debugOnlyDefaults;
                _deleteLogs = _deleteLogsDefaults;
                _fileLog    = _fileLogDefaults;
                _consoleLog = _consoleLogDefaults;
                _infoOnly   = _infoOnlygDefaults;
            }
            else
            {
                ExeConfigurationFileMap configMap = new ExeConfigurationFileMap();
                configMap.ExeConfigFilename = path;
                Configuration config = ConfigurationManager.OpenMappedExeConfiguration(configMap, ConfigurationUserLevel.None);

                _logFile    = Path.Combine(mainDirectory, GetLogPath(config));
                _debugOnly  = GetDebugOnlyPath(config);
                _deleteLogs = GetDeleteLogs(config);
                _fileLog    = GetFileLog(config);
                _consoleLog = GetConsoleLog(config);
                _infoOnly   = GetInfoOnly(config);
            }

            _executeOnDebugSettings = GetOnDebugSettings();

            return(new ConfigModel()
            {
                DebugOnly = _debugOnly,
                DeleteLogs = _deleteLogs,
                ExecuteOnDebugSettings = _executeOnDebugSettings,
                LogFile = _logFile,
                ConsoleLog = _consoleLog,
                FileLog = _fileLog,
                InfoOnly = _infoOnly,
                StringService = stringService,
                FileService = fileService,
                ProcessingPlant = processingPlant
            });
        }
コード例 #26
0
 public DeferredMessageWriter(
     [NotNull] ILoggerContext context,
     [NotNull] ILogWriter logWriter,
     [NotNull] IMessageWriter messageWriter,
     [NotNull] IHierarchicalMessageWriter hierarchicalMessageWriter,
     [NotNull] IBuildEventManager buildEventManager,
     [NotNull] IPathService pathService,
     [NotNull] IStringService stringService)
 {
     _stringService             = stringService ?? throw new ArgumentNullException(nameof(stringService));
     _pathService               = pathService ?? throw new ArgumentNullException(nameof(pathService));
     _hierarchicalMessageWriter = hierarchicalMessageWriter ?? throw new ArgumentNullException(nameof(hierarchicalMessageWriter));
     _buildEventManager         = buildEventManager ?? throw new ArgumentNullException(nameof(buildEventManager));
     _context       = context ?? throw new ArgumentNullException(nameof(context));
     _logWriter     = logWriter ?? throw new ArgumentNullException(nameof(logWriter));
     _messageWriter = messageWriter ?? throw new ArgumentNullException(nameof(messageWriter));
 }
コード例 #27
0
ファイル: OrdersController.cs プロジェクト: bchakarov/XeMart
        public OrdersController(
            IOrdersService ordersService,
            ISuppliersService suppliersService,
            IAddressesService addressesService,
            ICountriesService countriesService,
            IShoppingCartService shoppingCartService,
            IStringService stringService,
            IHttpContextAccessor contextAccessor)
        {
            this.ordersService       = ordersService;
            this.suppliersService    = suppliersService;
            this.addressesService    = addressesService;
            this.countriesService    = countriesService;
            this.shoppingCartService = shoppingCartService;
            this.stringService       = stringService;

            this.userId = contextAccessor.HttpContext.User.FindFirstValue(ClaimTypes.NameIdentifier);
        }
コード例 #28
0
 public ProjectFinishedHandler(
     [NotNull] ILoggerContext context,
     [NotNull] ILogWriter logWriter,
     [NotNull] IPerformanceCounterFactory performanceCounterFactory,
     [NotNull] IMessageWriter messageWriter,
     [NotNull] IHierarchicalMessageWriter hierarchicalMessageWriter,
     [NotNull] IDeferredMessageWriter deferredMessageWriter,
     [NotNull] IBuildEventManager buildEventManager,
     [NotNull] IStringService stringService)
 {
     _stringService             = stringService ?? throw new ArgumentNullException(nameof(stringService));
     _hierarchicalMessageWriter = hierarchicalMessageWriter ?? throw new ArgumentNullException(nameof(hierarchicalMessageWriter));
     _buildEventManager         = buildEventManager ?? throw new ArgumentNullException(nameof(buildEventManager));
     _deferredMessageWriter     = deferredMessageWriter ?? throw new ArgumentNullException(nameof(deferredMessageWriter));
     _messageWriter             = messageWriter ?? throw new ArgumentNullException(nameof(messageWriter));
     _context = context ?? throw new ArgumentNullException(nameof(context));
     _performanceCounterFactory = performanceCounterFactory ?? throw new ArgumentNullException(nameof(performanceCounterFactory));
     _logWriter = logWriter ?? throw new ArgumentNullException(nameof(logWriter));
 }
コード例 #29
0
 public BuildFinishedHandler(
     [NotNull] ILoggerContext context,
     [NotNull] ILogWriter logWriter,
     [NotNull] IMessageWriter messageWriter,
     [NotNull] IBuildEventManager buildEventManager,
     [NotNull] ILogFormatter logFormatter,
     [NotNull] IEventFormatter eventFormatter,
     [NotNull] IHierarchicalMessageWriter hierarchicalMessageWriter,
     [NotNull] IStringService stringService,
     [NotNull] IStatistics statistics)
 {
     _statistics                = statistics ?? throw new ArgumentNullException(nameof(statistics));
     _stringService             = stringService ?? throw new ArgumentNullException(nameof(stringService));
     _hierarchicalMessageWriter = hierarchicalMessageWriter ?? throw new ArgumentNullException(nameof(hierarchicalMessageWriter));
     _eventFormatter            = eventFormatter ?? throw new ArgumentNullException(nameof(eventFormatter));
     _logFormatter              = logFormatter ?? throw new ArgumentNullException(nameof(logFormatter));
     _buildEventManager         = buildEventManager ?? throw new ArgumentNullException(nameof(buildEventManager));
     _messageWriter             = messageWriter ?? throw new ArgumentNullException(nameof(messageWriter));
     _context   = context ?? throw new ArgumentNullException(nameof(context));
     _logWriter = logWriter ?? throw new ArgumentNullException(nameof(logWriter));
 }
コード例 #30
0
        public StringService_Tests()
        {
            var services = base.windsorContainer.Resolve <IServices>();

            this.stringService = services.StringService;
        }
コード例 #31
0
ファイル: DataService.cs プロジェクト: sunoru/PBO
 /// <param name="baseDir">the value should be an absolute path</param>
 public static void Load(string baseDir, IStringService stringService)
 {
     Contract.Requires(baseDir != null);
       Contract.Requires(stringService != null);
       LoadImpl(baseDir, stringService);
       IsLoaded = true;
 }
コード例 #32
0
ファイル: DataService.cs プロジェクト: sunoru/PBO
        private static void LoadImpl(string baseDir, IStringService stringService)
        {
            dataCollection = DataCollection.Load(Path.Combine(baseDir, CONSTS.INDEX_FILE), baseDir);
              configuration = dataCollection.ReadFile<DataConfiguration>(CONSTS.CONFIG_FILE, true);

              String = stringService.GetDomainService(CONSTS.BATTLE_DOMAIN);
              String.SetProvider(LoadGameStrings);
              DataString = stringService.GetDomainService(CONSTS.BATTLE_DATA_DOMAIN);
              DataString.SetProvider(LoadDataStrings);

              Image = new ImageService(dataCollection, configuration);

              //GameLog = new GameLog(logStringService);

              romData = RomData.Load();
        }