コード例 #1
0
 private static void UpdateCurrentThreadCulture(int value)
 {
     Thread.CurrentThread.CurrentUICulture =
         new CultureInfo(LocalizationConverter.Convert(value));
     Thread.CurrentThread.CurrentCulture =
         new CultureInfo(LocalizationConverter.Convert(value));
 }
コード例 #2
0
        public CommandWindow(ICondition condition)
        {
            InitializeComponent();
            Condition = condition;

            Title = new LocalizationConverter().Convert(Condition, null, null, null) as string;

            Initialize(condition, condition.GetType());
        }
コード例 #3
0
        public CommandWindow(ICommand command)
        {
            InitializeComponent();
            Command = command;

            Title = new LocalizationConverter().Convert(Command, null, null, null) as string;

            Initialize(command, command.GetType());
        }
コード例 #4
0
        private void convertIndividualProteinNode(XElement proteinNode)
        {
            var membraneLocation = EnumHelper.ParseValue <MembraneLocation>(proteinNode.GetAttribute("membraneLocation"));
            var tissueLocation   = EnumHelper.ParseValue <TissueLocation>(proteinNode.GetAttribute("tissueLocation"));
            var intracellularVascularEndoLocation =
                EnumHelper.ParseValue <IntracellularVascularEndoLocation>(proteinNode.GetAttribute("intracellularVascularEndoLocation"));

            var localization = LocalizationConverter.ConvertToLocalization(tissueLocation, membraneLocation, intracellularVascularEndoLocation);

            proteinNode.AddAttribute("localization", localization.ToString());
            _converted = true;
        }
コード例 #5
0
        public void Data_with_prefix_should_be_empty()
        {
            DISetup.SetupContainer();
            var locManager = new Mock <ILocalizationManager>();

            locManager.Setup(s => s.GetResource(It.Is <string>(s => s == "prefix.test"))).Returns("test localization");
            DISetup.Container.RegisterInstance(locManager.Object);
            var converter = new LocalizationConverter();
            var result    = converter.Convert("test 2", null, "prefix", null);

            result.Should().BeNull();
        }
コード例 #6
0
        private Localization retrieveLocalizationFrom(SnapshotExpressionProfile snapshot, SnapshotContext snapshotContext)
        {
            if (!snapshotContext.IsV9FormatOrEarlier)
            {
                return(ModelValueFor(snapshot.Localization));
            }

            //reset ot ensure we update all parameters
            var intracellularVascularEndoLocation = ModelValueFor(snapshot.IntracellularVascularEndoLocation);
            var tissueLocation   = ModelValueFor(snapshot.TissueLocation);
            var membraneLocation = ModelValueFor(snapshot.MembraneLocation);

            return(LocalizationConverter.ConvertToLocalization(tissueLocation, membraneLocation, intracellularVascularEndoLocation));
        }
コード例 #7
0
        private async Task <List <Sound> > GetPackagedSoundsAsync()
        {
            if (_packagedSoundCache == null)
            {
                StorageFolder appInstalledFolder = Windows.ApplicationModel.Package.Current.InstalledLocation;
                StorageFolder assets             = await appInstalledFolder.GetFolderAsync("Assets");

                StorageFile dataFile = await assets.GetFileAsync(DataFileName);

                using Stream dataStream = await dataFile.OpenStreamForReadAsync();

                var sounds = await JsonSerializer.DeserializeAsync <List <Sound> >(dataStream);

                foreach (var s in sounds)
                {
                    s.Name = LocalizationConverter.ConvertSoundName(s.Name);
                }

                _packagedSoundCache = sounds;
            }

            return(_packagedSoundCache.ToList());
        }
コード例 #8
0
 public LocalizationBinding(string path)
     : base(path)
 {
     Converter = new LocalizationConverter();
 }
コード例 #9
0
 public static CultureInfo GetCurrentCulture()
 {
     return(new CultureInfo(LocalizationConverter.Convert(culture)));
 }
コード例 #10
0
ファイル: SystemNews.cs プロジェクト: shukanov-artyom/VTS
 public string GetText(int lang)
 {
     return(SystemNewsLocalized.First(l => l.Language ==
                                      LocalizationConverter.Convert(lang)).NewsContentText);
 }
コード例 #11
0
ファイル: SystemNews.cs プロジェクト: shukanov-artyom/VTS
 public string GetTopic(int lang)
 {
     return(SystemNewsLocalized.First(l => l.Language ==
                                      LocalizationConverter.Convert(lang)).Header);
 }