Ejemplo n.º 1
0
        public List <SupportedCulture> LoadCultures(string initCulture = null, MixCmsContext _context = null, IDbContextTransaction _transaction = null)
        {
            V_0 = ViewModelBase <MixCmsContext, MixCulture, SystemCultureViewModel> .Repository.GetModelList(_context, _transaction);

            V_1 = new List <SupportedCulture>();
            if (V_0.get_IsSucceed())
            {
                V_2 = V_0.get_Data().GetEnumerator();
                try
                {
                    while (V_2.MoveNext())
                    {
                        V_3             = V_2.get_Current();
                        stackVariable16 = new SupportedCulture();
                        stackVariable16.set_Icon(V_3.get_Icon());
                        stackVariable16.set_Specificulture(V_3.get_Specificulture());
                        stackVariable16.set_Alias(V_3.get_Alias());
                        stackVariable16.set_FullName(V_3.get_FullName());
                        stackVariable16.set_Description(V_3.get_FullName());
                        stackVariable16.set_Id(V_3.get_Id());
                        stackVariable16.set_Lcid(V_3.get_Lcid());
                        stackVariable16.set_IsSupported(string.op_Equality(V_3.get_Specificulture(), initCulture));
                        V_1.Add(stackVariable16);
                    }
                }
                finally
                {
                    ((IDisposable)V_2).Dispose();
                }
            }
            return(V_1);
        }
Ejemplo n.º 2
0
			V_1 = Expression.Parameter(System.Type.GetTypeFromHandle(// 
			// Current member / type: System.Void Mix.Cms.Lib.ViewModels.MixPosts.UpdateViewModel::LoadAttributes(Mix.Cms.Lib.Models.Cms.MixCmsContext,Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction)
			// Exception in: System.Void LoadAttributes(Mix.Cms.Lib.Models.Cms.MixCmsContext,Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction)
			// Specified method is not supported.
			// 
			// mailto: [email protected]


		private List<SupportedCulture> LoadCultures(string initCulture = null, MixCmsContext _context = null, IDbContextTransaction _transaction = null)
		{
			V_0 = ViewModelBase<MixCmsContext, MixCulture, SystemCultureViewModel>.Repository.GetModelList(_context, _transaction);
			V_1 = new List<SupportedCulture>();
			if (V_0.get_IsSucceed())
			{
				V_2 = V_0.get_Data().GetEnumerator();
				try
				{
					while (V_2.MoveNext())
					{
						V_3 = new Mix.Cms.Lib.ViewModels.MixPosts.UpdateViewModel.u003cu003ec__DisplayClass219_0();
						V_3.u003cu003e4__this = this;
						V_3.culture = V_2.get_Current();
						stackVariable19 = V_1;
						V_4 = new SupportedCulture();
						V_4.set_Icon(V_3.culture.get_Icon());
						V_4.set_Specificulture(V_3.culture.get_Specificulture());
						V_4.set_Alias(V_3.culture.get_Alias());
						V_4.set_FullName(V_3.culture.get_FullName());
						V_4.set_Description(V_3.culture.get_FullName());
						V_4.set_Id(V_3.culture.get_Id());
						V_4.set_Lcid(V_3.culture.get_Lcid());
						stackVariable49 = V_4;
						if (string.op_Equality(V_3.culture.get_Specificulture(), initCulture))
						{
							stackVariable55 = true;
						}
						else
						{
							stackVariable58 = _context.get_MixPost();
							V_5 = Expression.Parameter(System.Type.GetTypeFromHandle(// 
Ejemplo n.º 3
0
 public void ChangeCulture(SupportedCulture culture)
 {
     if (culture == SupportedCulture.Auto)
     {
         Resources.Culture = defaultCultureInfo;
     }
     else
     {
         Resources.Culture = CultureInfo.GetCultureInfo(culture.ToString());
     }
     RaisePropertyChanged(nameof(Resources));
 }
Ejemplo n.º 4
0
        private void StringifyNumerics(SupportedCulture supportedCulture)
        {
            var stringifier = Container.ResolveKeyed <INumericStringifier>(supportedCulture);

            Range selection = GetSelectionOrUsedRange(App.ActiveSheet);

            selection.ApplyForEachCellOfType <double, object>(
                value =>
            {
                var newValue = stringifier.StringifyNumber(value);
                return((object)newValue ?? value);
            });
        }
        public static void InitializeDatabase(LocalizationContext context)
        {
            var cultureNL = new SupportedCulture()
            {
                IsSupported = true, Name = "nl"
            };
            var cultureEN = new SupportedCulture()
            {
                IsSupported = true, Name = "en"
            };

            context.SupportedCultures.Add(cultureNL);
            context.SupportedCultures.Add(cultureEN);
            context.SaveChanges();

            var collection = new Dictionary <LocalizationKey, (SupportedCulture Culture, string Value)[]>()
Ejemplo n.º 6
0
		public static List<SupportedCulture> LoadCultures(int id, string initCulture = null, MixCmsContext _context = null, IDbContextTransaction _transaction = null)
		{
			V_0 = new Helper.u003cu003ec__DisplayClass0_0();
			V_0.id = id;
			V_1 = ViewModelBase<MixCmsContext, MixCulture, SystemCultureViewModel>.Repository.GetModelList(_context, _transaction);
			V_2 = new List<SupportedCulture>();
			if (V_1.get_IsSucceed())
			{
				V_3 = V_1.get_Data().GetEnumerator();
				try
				{
					while (V_3.MoveNext())
					{
						V_4 = new Helper.u003cu003ec__DisplayClass0_1();
						V_4.CSu0024u003cu003e8__locals1 = V_0;
						V_4.culture = V_3.get_Current();
						stackVariable22 = V_2;
						V_5 = new SupportedCulture();
						V_5.set_Icon(V_4.culture.get_Icon());
						V_5.set_Specificulture(V_4.culture.get_Specificulture());
						V_5.set_Alias(V_4.culture.get_Alias());
						V_5.set_FullName(V_4.culture.get_FullName());
						V_5.set_Description(V_4.culture.get_FullName());
						V_5.set_Id(V_4.culture.get_Id());
						V_5.set_Lcid(V_4.culture.get_Lcid());
						stackVariable52 = V_5;
						if (string.op_Equality(V_4.culture.get_Specificulture(), initCulture))
						{
							stackVariable58 = true;
						}
						else
						{
							stackVariable61 = _context.get_MixPage();
							V_6 = Expression.Parameter(Type.GetTypeFromHandle(// 
							// Current member / type: System.Collections.Generic.List`1<Mix.Domain.Core.Models.SupportedCulture> Mix.Cms.Lib.ViewModels.MixPages.Helper::LoadCultures(System.Int32,System.String,Mix.Cms.Lib.Models.Cms.MixCmsContext,Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction)
							// Exception in: System.Collections.Generic.List<Mix.Domain.Core.Models.SupportedCulture> LoadCultures(System.Int32,System.String,Mix.Cms.Lib.Models.Cms.MixCmsContext,Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction)
							// Specified method is not supported.
							// 
							// mailto: [email protected]

	}
}
Ejemplo n.º 7
0
		private List<SupportedCulture> LoadCultures(string initCulture = null, MixCmsContext _context = null, IDbContextTransaction _transaction = null)
		{
			V_0 = ViewModelBase<MixCmsContext, MixCulture, SystemCultureViewModel>.Repository.GetModelList(_context, _transaction);
			V_1 = new List<SupportedCulture>();
			if (V_0.get_IsSucceed())
			{
				V_2 = V_0.get_Data().GetEnumerator();
				try
				{
					while (V_2.MoveNext())
					{
						V_3 = new Mix.Cms.Lib.ViewModels.MixMedias.ReadViewModel.u003cu003ec__DisplayClass80_0();
						V_3.u003cu003e4__this = this;
						V_3.culture = V_2.get_Current();
						stackVariable19 = V_1;
						V_4 = new SupportedCulture();
						V_4.set_Icon(V_3.culture.get_Icon());
						V_4.set_Specificulture(V_3.culture.get_Specificulture());
						V_4.set_Alias(V_3.culture.get_Alias());
						V_4.set_FullName(V_3.culture.get_FullName());
						V_4.set_Description(V_3.culture.get_FullName());
						V_4.set_Id(V_3.culture.get_Id());
						V_4.set_Lcid(V_3.culture.get_Lcid());
						stackVariable49 = V_4;
						if (string.op_Equality(V_3.culture.get_Specificulture(), initCulture))
						{
							stackVariable55 = true;
						}
						else
						{
							stackVariable58 = _context.get_MixMedia();
							V_5 = Expression.Parameter(Type.GetTypeFromHandle(// 
							// Current member / type: System.Collections.Generic.List`1<Mix.Domain.Core.Models.SupportedCulture> Mix.Cms.Lib.ViewModels.MixMedias.ReadViewModel::LoadCultures(System.String,Mix.Cms.Lib.Models.Cms.MixCmsContext,Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction)
							// Exception in: System.Collections.Generic.List<Mix.Domain.Core.Models.SupportedCulture> LoadCultures(System.String,Mix.Cms.Lib.Models.Cms.MixCmsContext,Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction)
							// Specified method is not supported.
							// 
							// mailto: [email protected]

	}
}
        public void Add_writes_to_database()
        {
            var options = new DbContextOptionsBuilder <LocalizationContext>()
                          .UseInMemoryDatabase(databaseName: "Add_writes_to_database")
                          .Options;

            using (var context = new LocalizationContext(options))
            {
                var culture = new SupportedCulture()
                {
                    IsSupported = true, Name = "nl"
                };
                context.SupportedCultures.Add(culture);

                var key = new LocalizationKey()
                {
                    Base = "Hello.World.Test", Key = "HELLO_WORLD"
                };
                context.LocalizationKeys.Add(key);

                context.LocalizationRecords.Add(new LocalizationRecord()
                {
                    Culture         = culture,
                    LocalizationKey = key,
                    Status          = RecordStatus.HumanTranslated,
                    Text            = "Hallo wereld!"
                }).State = EntityState.Added;

                context.SaveChanges();
            }

            using (var context = new LocalizationContext(options))
            {
                Assert.Equal(1, context.SupportedCultures.Count());
                Assert.Equal("nl", context.SupportedCultures.Single().Name);
                Assert.Equal("Hallo wereld!", context.LocalizationRecords.Single().Text);
            }
        }
Ejemplo n.º 9
0
 // Die Kultur hat sich geändert
 void OnSelectedCultureChanged(object sender, EventArgs e)
 {
     CurrentCulture = GlobalizationUtilities.TheInstance.SelectedCulture;
 }
Ejemplo n.º 10
0
 // Konstruktor. Richtet Kultur und Änderungsbenachrichtigung ein
 public ViewModelBase()
 {
     _currentCulture = GlobalizationUtilities.TheInstance.SelectedCulture;
     GlobalizationUtilities.TheInstance.SelectedCultureChanged += OnSelectedCultureChanged;
 }