// http://msdn.microsoft.com/en-us/library/windows/desktop/dd318691(v=vs.85).aspx private static ushort GetLanguage(PrimaryLanguage primary, SecondaryLanguage secondary) { var p = (ushort)((ushort)primary & 0x3ff); var s = (ushort)((ushort)secondary >> 10) << 10; return((ushort)(p | s)); }
public List <String> DescribeSelf() { List <String> output = new List <string>(); output.Add("## Crawler [" + Crawler + "]"); output.Add(" > Language of preference: " + PrimaryLanguage.ToString()); output.Add(" > Secondary language: " + SecondaryLanguage.ToString()); return(output); }
public void AddListOfSataticLabel(List <GlobalizationDetailAc> globalizationDetail) { try { foreach (var globalization in globalizationDetail) { if (string.IsNullOrEmpty(globalization.ValueSl)) { globalization.ValueSl = null; } if (_secondaryLanguageContext.Fetch(y => y.GlobalizationDetailId == globalization.Id && y.CompanyId == globalization.CompanyId).Any()) { var secondary = _secondaryLanguageContext.First(y => y.GlobalizationDetailId == globalization.Id && y.CompanyId == globalization.CompanyId); secondary.ValueSl = globalization.ValueSl; secondary.CompanyId = globalization.CompanyId; secondary.ModifiedDateTime = DateTime.UtcNow; _secondaryLanguageContext.Update(secondary); _secondaryLanguageContext.SaveChanges(); } else { SecondaryLanguage language = new SecondaryLanguage() { GlobalizationDetailId = globalization.Id, ValueSl = globalization.ValueSl, CompanyId = globalization.CompanyId, CreatedDateTime = DateTime.UtcNow }; _secondaryLanguageContext.Add(language); _secondaryLanguageContext.SaveChanges(); } } } catch (Exception ex) { _errorLog.LogException(ex); throw; } }
// http://msdn.microsoft.com/en-us/library/windows/desktop/dd318691(v=vs.85).aspx private static ushort GetLanguage(PrimaryLanguage primary, SecondaryLanguage secondary) { var p = (ushort)((ushort)primary & 0x3ff); var s = (ushort)((ushort)secondary >> 10) << 10; return (ushort)(p | s); }