public CollectionSettings(NewCollectionSettings collectionInfo) : this(collectionInfo.PathToSettingsFile) { AllowNewBooks = collectionInfo.AllowNewBooks; Language1.FontName = collectionInfo.Language1.FontName; Language1 = collectionInfo.Language1; Language2 = collectionInfo.Language2; Language3 = collectionInfo.Language3; Language2.FontName = Language3.FontName = WritingSystem.GetDefaultFontName(); Country = collectionInfo.Country; Province = collectionInfo.Province; District = collectionInfo.District; IsSourceCollection = collectionInfo.IsSourceCollection; XMatterPackName = collectionInfo.XMatterPackName; PageNumberStyle = collectionInfo.PageNumberStyle; BrandingProjectKey = collectionInfo.BrandingProjectKey; SubscriptionCode = collectionInfo.SubscriptionCode; if (BrandingProjectKey == "Local Community") { // migrate for 4.4 BrandingProjectKey = "Local-Community"; } AudioRecordingMode = collectionInfo.AudioRecordingMode; AudioRecordingTrimEndMilliseconds = collectionInfo.AudioRecordingTrimEndMilliseconds; Save(); }
public string GetCollectionStylesCss(bool omitDirection) { var sb = new StringBuilder(); sb.AppendLine("/* *** DO NOT EDIT! *** These styles are controlled by the Settings dialog box in Bloom. */"); sb.AppendLine("/* They may be over-ridden by rules in customCollectionStyles.css or customBookStyles.css */"); // note: css pseudo elements cannot have a @lang attribute. So this is needed to show page numbers in scripts not covered by Andika New Basic. WritingSystem.AddSelectorCssRule(sb, ".numberedPage::after", Language1.FontName, Language1.IsRightToLeft, Language1.LineHeight, Language1.BreaksLinesOnlyAtSpaces, omitDirection); Language1.AddSelectorCssRule(sb, omitDirection); if (Language2Iso639Code != Language1Iso639Code) { Language2.AddSelectorCssRule(sb, omitDirection); } if (!string.IsNullOrEmpty(Language3Iso639Code) && Language3Iso639Code != Language1Iso639Code && Language3Iso639Code != Language2Iso639Code) { Language3.AddSelectorCssRule(sb, omitDirection); } return(sb.ToString()); }
public CollectionSettings() { //Note: I'm not convinced we actually ever rely on dynamic name lookups anymore? //See: https://issues.bloomlibrary.org/youtrack/issue/BL-7832 Func <string> getCodeOfDefaultLanguageForNaming = () => Language2.Iso639Code; Language1 = new WritingSystem(1, getCodeOfDefaultLanguageForNaming); Language2 = new WritingSystem(2, getCodeOfDefaultLanguageForNaming); Language3 = new WritingSystem(3, getCodeOfDefaultLanguageForNaming); LanguagesZeroBased = new WritingSystem[3]; this.LanguagesZeroBased[0] = Language1; this.LanguagesZeroBased[1] = Language2; this.LanguagesZeroBased[2] = Language3; BrandingProjectKey = "Default"; PageNumberStyle = "Decimal"; XMatterPackName = kDefaultXmatterName; Language2Iso639Code = "en"; AllowNewBooks = true; CollectionName = "dummy collection"; AudioRecordingMode = TalkingBookApi.AudioRecordingMode.Sentence; AudioRecordingTrimEndMilliseconds = kDefaultAudioRecordingTrimEndMilliseconds; }