public BocAutoCompleteReferenceValueRenderer(
     IResourceUrlFactory resourceUrlFactory,
     IGlobalizationService globalizationService,
     IRenderingFeatures renderingFeatures)
     : this(resourceUrlFactory, globalizationService, renderingFeatures, () => new RenderOnlyTextBox())
 {
 }
Ejemplo n.º 2
0
 public TestableBocDateTimeValueRenderer(
     IResourceUrlFactory resourceUrlFactory,
     IGlobalizationService globalizationService,
     IRenderingFeatures renderingFeatures)
     : base(resourceUrlFactory, globalizationService, renderingFeatures)
 {
 }
 public WebTabStripRenderer(
     IResourceUrlFactory resourceUrlFactory,
     IGlobalizationService globalizationService,
     IRenderingFeatures renderingFeatures)
     : base(resourceUrlFactory, globalizationService, renderingFeatures)
 {
 }
 public BocTreeViewRenderer(
     [NotNull] IResourceUrlFactory resourceUrlFactory,
     [NotNull] IGlobalizationService globalizationService,
     [NotNull] IRenderingFeatures renderingFeatures)
     : base(resourceUrlFactory, globalizationService, renderingFeatures)
 {
 }
Ejemplo n.º 5
0
 protected BocReferenceValueRendererBase(
     IResourceUrlFactory resourceUrlFactory,
     IGlobalizationService globalizationService,
     IRenderingFeatures renderingFeatures)
     : base(resourceUrlFactory, globalizationService, renderingFeatures)
 {
 }
 public BocTextValueRenderer(
     IResourceUrlFactory resourceUrlFactory,
     IGlobalizationService globalizationService,
     IRenderingFeatures renderingFeatures)
     : base(resourceUrlFactory, globalizationService, renderingFeatures)
 {
 }
Ejemplo n.º 7
0
        public virtual void LoadResources(IResourceManager resourceManager, IGlobalizationService globalizationService)
        {
            ArgumentUtility.CheckNotNull("resourceManager", resourceManager);
            ArgumentUtility.CheckNotNull("globalizationService", globalizationService);

            string key = ResourceManagerUtility.GetGlobalResourceKey(Category);

            if (!string.IsNullOrEmpty(key))
            {
                Category = resourceManager.GetString(key);
            }

            key = ResourceManagerUtility.GetGlobalResourceKey(Text);
            if (!string.IsNullOrEmpty(key))
            {
                Text = resourceManager.GetString(key);
            }

            Icon.LoadResources(resourceManager);
            DisabledIcon.LoadResources(resourceManager);

            if (Command != null)
            {
                Command.LoadResources(resourceManager, globalizationService);
            }
        }
Ejemplo n.º 8
0
        public void SetUp()
        {
            _globalizationServiceMock = MockRepository.GenerateStub <IGlobalizationService>();
            _resourceManagerMock      = MockRepository.GenerateStrictMock <IResourceManager>();
            _resourceManagerMock.Stub(stub => stub.IsNull).Return(false);
            _resourceManagerMock.Stub(stub => stub.Name).Return("RM1");

            _typeInformationStub = MockRepository.GenerateStub <ITypeInformation>();
            _typeInformationStub.Stub(stub => stub.Name).Return("TypeName");

            _typeInformationForResourceResolutionStub = MockRepository.GenerateStub <ITypeInformation>();
            _typeInformationForResourceResolutionStub.Stub(stub => stub.Name).Return("TypeNameForResourceResolution");

            _propertyInformationStub = MockRepository.GenerateStub <IPropertyInformation>();
            _propertyInformationStub.Stub(stub => stub.Name).Return("PropertyName");

            _memberInformationNameResolverStub = MockRepository.GenerateStub <IMemberInformationNameResolver>();
            _memberInformationNameResolverStub.Stub(stub => stub.GetPropertyName(_propertyInformationStub)).Return("FakePropertyFullName");
            _memberInformationNameResolverStub.Stub(stub => stub.GetTypeName(_typeInformationStub)).Return("FakeTypeFullName");

            _shortPropertyResourceID = "property:PropertyName";
            _longPropertyResourceID  = "property:FakePropertyFullName";
            _shortTypeResourceID     = "type:TypeName";
            _longTypeResourceID      = "type:FakeTypeFullName";

            _service = new ResourceManagerBasedMemberInformationGlobalizationService(_globalizationServiceMock, _memberInformationNameResolverStub);
        }
Ejemplo n.º 9
0
 public DatePickerButtonRenderer(
     IResourceUrlFactory resourceUrlFactory,
     IGlobalizationService globalizationService,
     IRenderingFeatures renderingFeatures)
     : base(resourceUrlFactory, globalizationService, renderingFeatures)
 {
 }
Ejemplo n.º 10
0
 public BocDateTimeValueRenderer(
     IResourceUrlFactory resourceUrlFactory,
     IGlobalizationService globalizationService,
     IRenderingFeatures renderingFeatures)
     : this(resourceUrlFactory, globalizationService, renderingFeatures, new RenderOnlyTextBox(), new RenderOnlyTextBox())
 {
 }
        public static IResourceManager GetResourceManager([NotNull] this IGlobalizationService globalizationService, [NotNull] Type type)
        {
            ArgumentUtility.CheckNotNull("globalizationService", globalizationService);
            ArgumentUtility.CheckNotNull("type", type);

            return(globalizationService.GetResourceManager(TypeAdapter.Create(type)));
        }
Ejemplo n.º 12
0
        /// <summary> Loads the resources into the control's properties. </summary>
        protected override void LoadResources(IResourceManager resourceManager, IGlobalizationService globalizationService)
        {
            ArgumentUtility.CheckNotNull("resourceManager", resourceManager);
            ArgumentUtility.CheckNotNull("globalizationService", globalizationService);

            if (IsDesignMode)
            {
                return;
            }

            base.LoadResources(resourceManager, globalizationService);

            var key = ResourceManagerUtility.GetGlobalResourceKey(NullItemErrorMessage);

            if (!string.IsNullOrEmpty(key))
            {
                NullItemErrorMessage = resourceManager.GetString(key);
            }

            key = ResourceManagerUtility.GetGlobalResourceKey(OptionsTitle);
            if (!string.IsNullOrEmpty(key))
            {
                OptionsTitle = resourceManager.GetString(key);
            }

            if (Command != null)
            {
                Command.LoadResources(resourceManager, globalizationService);
            }

            OptionsMenuItems.LoadResources(resourceManager, globalizationService);
        }
 public TestableBocAutoCompleteReferenceValueRenderer(
     IResourceUrlFactory resourceUrlFactory,
     IGlobalizationService globalizationService,
     IRenderingFeatures renderingFeatures)
     : base(resourceUrlFactory, globalizationService, renderingFeatures)
 {
 }
 public TabbedMenuRenderer(
     IResourceUrlFactory resourceUrlFactory,
     IGlobalizationService globalizationService,
     IRenderingFeatures renderingFeatures)
     : base(resourceUrlFactory, globalizationService, renderingFeatures)
 {
 }
 public BocReferenceValueRenderer(
     IResourceUrlFactory resourceUrlFactory,
     IGlobalizationService globalizationService,
     IRenderingFeatures renderingFeatures)
     : this(resourceUrlFactory, globalizationService, renderingFeatures, () => new DropDownList())
 {
 }
Ejemplo n.º 16
0
 public SingleViewRenderer(
     IResourceUrlFactory resourceUrlFactory,
     IGlobalizationService globalizationService,
     IRenderingFeatures renderingFeatures)
     : base(resourceUrlFactory, globalizationService, renderingFeatures)
 {
 }
Ejemplo n.º 17
0
        void SetCulture(CultureInfo culture)
        {
            IGlobalizationService service = GlobalServices.Instance.GetService <IGlobalizationService>();

            if (service == null)
            {
                return;
            }

            if (culture == null)
            {
                culture = service.CurrentOSCulture;
            }

            service.CurrentCulture   = culture;
            service.CurrentUICulture = culture;

            GridLocalizer.ResetCache();
            DemoLocalizer.ResetCache();

            DemoStringIdLocalizer localizer = this.Resources["localizer"] as DemoStringIdLocalizer;

            if (localizer != null)
            {
                localizer.CultureName = culture.Name;
            }

            UpdateCurrentCultureName();

            grid.Redraw(true);
        }
Ejemplo n.º 18
0
        /// <summary> Loads the resources into the control's properties. </summary>
        protected override void LoadResources(IResourceManager resourceManager, IGlobalizationService globalizationService)
        {
            ArgumentUtility.CheckNotNull("resourceManager", resourceManager);
            ArgumentUtility.CheckNotNull("globalizationService", globalizationService);

            if (IsDesignMode)
            {
                return;
            }
            base.LoadResources(resourceManager, globalizationService);

            string key;

            key = ResourceManagerUtility.GetGlobalResourceKey(TrueDescription);
            if (!string.IsNullOrEmpty(key))
            {
                TrueDescription = resourceManager.GetString(key);
            }

            key = ResourceManagerUtility.GetGlobalResourceKey(FalseDescription);
            if (!string.IsNullOrEmpty(key))
            {
                FalseDescription = resourceManager.GetString(key);
            }
        }
 public TestableBocReferenceValueRenderer(
     IResourceUrlFactory resourceUrlFactory,
     IGlobalizationService globalizationService,
     IRenderingFeatures renderingFeatures,
     Func <DropDownList> dropDownListFactoryMethod)
     : base(resourceUrlFactory, globalizationService, renderingFeatures, dropDownListFactoryMethod)
 {
 }
Ejemplo n.º 20
0
        public GetQuoteRequestViewModelValidator(IGlobalizationService globalizationService)
        {
            _globalizationService = globalizationService;

            RuleFor(x => x.Symbol).NotNull().NotEmpty();
            RuleFor(x => x.Date).NotNull().NotEmpty().Must(x => x.Date.Date <= DateTime.UtcNow.Date).WithMessage("Date cannot be greater than UTC today.");
            RuleFor(x => x.Region).NotNull().NotEmpty().Must(ValidateRegion).WithMessage("Region does not exist.");
        }
Ejemplo n.º 21
0
        public BocListInlineEditingConfigurator(IResourceUrlFactory resourceUrlFactory, IGlobalizationService globalizationService)
        {
            ArgumentUtility.CheckNotNull("resourceUrlFactory", resourceUrlFactory);
            ArgumentUtility.CheckNotNull("globalizationService", globalizationService);

            _resourceUrlFactory   = resourceUrlFactory;
            _globalizationService = globalizationService;
        }
Ejemplo n.º 22
0
 public QuoteService(
     IGlobalizationService globalizationService,
     IExchangeRateService exchangeRateService,
     IExternalFinanceService externalFinancialService)
 {
     _globalizationService     = globalizationService;
     _exchangeRateService      = exchangeRateService;
     _externalFinancialService = externalFinancialService;
 }
Ejemplo n.º 23
0
 /// <summary>
 /// 静态构造方法。
 /// </summary>
 static HtmlHelperExtensions()
 {
     using (var container = AutofacConfig.Container.BeginLifetimeScope())
     {
         _fileStorageService = container.Resolve<IFileService>();
         _permissionService = container.Resolve<IPermissionService>();
         _systemSettingService = container.Resolve<ISystemSettingService>();
         _globalizationService = container.Resolve<IGlobalizationService>();
     }
 }
        public ResourceManagerBasedMemberInformationGlobalizationService(
            IGlobalizationService globalizationService,
            IMemberInformationNameResolver memberInformationNameResolver)
        {
            ArgumentUtility.CheckNotNull("globalizationService", globalizationService);
            ArgumentUtility.CheckNotNull("memberInformationNameResolver", memberInformationNameResolver);

            _globalizationService          = globalizationService;
            _memberInformationNameResolver = memberInformationNameResolver;
        }
Ejemplo n.º 25
0
        /// <summary>
        /// Initializes the <see cref="Context"/> and the <see cref="Control"/> properties from the arguments.
        /// </summary>
        protected RendererBase(IResourceUrlFactory resourceUrlFactory, IGlobalizationService globalizationService, IRenderingFeatures renderingFeatures)
        {
            ArgumentUtility.CheckNotNull("resourceUrlFactory", resourceUrlFactory);
            ArgumentUtility.CheckNotNull("globalizationService", globalizationService);
            ArgumentUtility.CheckNotNull("renderingFeatures", renderingFeatures);

            _resourceUrlFactory   = resourceUrlFactory;
            _globalizationService = globalizationService;
            _renderingFeatures    = renderingFeatures;
        }
 protected BocReferenceValueRenderer(
     IResourceUrlFactory resourceUrlFactory,
     IGlobalizationService globalizationService,
     IRenderingFeatures renderingFeatures,
     Func <DropDownList> dropDownListFactoryMethod)
     : base(resourceUrlFactory, globalizationService, renderingFeatures)
 {
     ArgumentUtility.CheckNotNull("dropDownListFactoryMethod", dropDownListFactoryMethod);
     _dropDownListFactoryMethod = dropDownListFactoryMethod;
 }
 protected BocAutoCompleteReferenceValueRenderer(
     IResourceUrlFactory resourceUrlFactory,
     IGlobalizationService globalizationService,
     IRenderingFeatures renderingFeatures,
     Func <TextBox> textBoxFactory)
     : base(resourceUrlFactory, globalizationService, renderingFeatures)
 {
     ArgumentUtility.CheckNotNull("textBoxFactory", textBoxFactory);
     _textBoxFactory = textBoxFactory;
 }
Ejemplo n.º 28
0
        public void LoadResources(IResourceManager resourceManager, IGlobalizationService globalizationService)
        {
            ArgumentUtility.CheckNotNull("resourceManager", resourceManager);
            ArgumentUtility.CheckNotNull("globalizationService", globalizationService);

            for (int i = 0; i < InnerList.Count; i++)
            {
                IControlItem controlItem = (IControlItem)InnerList[i];
                controlItem.LoadResources(resourceManager, globalizationService);
            }
        }
Ejemplo n.º 29
0
 public MainPageViewModel(ISerializationService serializationService, IFileService fileService, INavigationService navigationService, IGlobalizationService globalizationService, ISettingsService settingService, IResourcesService resourcesService)
 {
     this.Items = new ObservableCollection <Group <RepoItem> >();
     this.serializationService = serializationService;
     this.fileService          = fileService;
     this.navigationService    = navigationService;
     this.globalizationService = globalizationService;
     this.settingsService      = settingService;
     this.resourcesService     = resourcesService;
     this.ItemDetailsCommand   = new DelegateCommand(NavigateToItemDetails);
 }
Ejemplo n.º 30
0
        void UpdateCurrentCultureName()
        {
            IGlobalizationService service = GlobalServices.Instance.GetService <IGlobalizationService>();

            if (service == null)
            {
                currentCultureName.Text = "unknown";
                return;
            }
            currentCultureName.Text = service.CurrentCulture.Name;
        }
        /// <summary>
        /// Contructs a renderer bound to a <see cref="BocList"/> to render and an <see cref="HtmlTextWriter"/> to render to.
        /// </summary>
        /// <remarks>
        /// This class should not be instantiated directly by clients. Instead, a <see cref="BocListRenderer"/> should use a
        /// factory to obtain an instance of this class.
        /// </remarks>
        public BocListNavigationBlockRenderer(
            IResourceUrlFactory resourceUrlFactory,
            IGlobalizationService globalizationService,
            IRenderingFeatures renderingFeatures,
            BocListCssClassDefinition cssClasses)
            : base(resourceUrlFactory, globalizationService, renderingFeatures)
        {
            ArgumentUtility.CheckNotNull("cssClasses", cssClasses);

            _cssClasses = cssClasses;
        }
 public AppSettingsViewModel(IAppSettingsService appSettingsService, IGlobalizationService globalizationService, IStyleService styleService)
 {
     this.appSettingsService = appSettingsService;
     this.globalizationService = globalizationService;
     this.styleService = styleService;
 }