Ejemplo n.º 1
0
		TimeZoneInfo GetTimeZone( Tenant tenant)
		{
			return tenant.TimeZone ?? TimeZoneInfo.Local;
		}
Ejemplo n.º 2
0
		Tenant ToTenant(Record r)
		{
			var tenant = new Tenant();
			tenant.Name = r.GetString("name");
			tenant.DisplayName = r.GetString("displayName");
			var cultureName = r.GetString("culture");
			tenant.Culture = cultureName != null ? new CultureInfo(cultureName) : CultureInfo.CurrentCulture;
			var timeZone = r.GetString("timeZone");
			tenant.TimeZone = timeZone != null ? TimeZoneInfo.FindSystemTimeZoneById(timeZone) : TimeZoneInfo.Local;
			var items = r.GetString("items");
			tenant.Items = !string.IsNullOrEmpty(items) ? Json.Deserialize<Map>(items) : new Map();
			return tenant;
		}
Ejemplo n.º 3
0
		CultureInfo GetCulture(string cultureName, Tenant tenant)
		{
			if(cultureName != null)
			{
				return new CultureInfo(cultureName);
			}
			return tenant.Culture ?? CultureInfo.CurrentCulture;
		}
Ejemplo n.º 4
0
		public Tenant LoadTenant(string name)
		{
			if(foo == null)
			{ 
				foo = new Tenant() {
					Culture = new System.Globalization.CultureInfo("es-ES"),
					TimeZone = TimeZoneInfo.Local
				};
			}
			return foo;
		}