public CreatorSettingsMigrationStorage(IStorage baseStorage, IFontHelper fontHelper, int targetVersion, ISettingsBackup settingsBackup)
 {
     _baseStorage    = baseStorage;
     _fontHelper     = fontHelper;
     _targetVersion  = targetVersion;
     _settingsBackup = settingsBackup;
 }
Ejemplo n.º 2
0
        public StampUserControlViewModel(IInteractionInvoker interactionInvoker, IFontHelper fontHelper, TokenHelper tokenHelper, ITranslationUpdater translationUpdater, ISelectedProfileProvider profile) : base(translationUpdater, profile)
        {
            _interactionInvoker = interactionInvoker;
            _fontHelper         = fontHelper;

            if (CurrentProfile != null)
            {
                UpdateFontButtonText(CurrentProfile.Stamping);
            }
        }
 public StampUserControlViewModel(IInteractionInvoker interactionInvoker, IFontHelper fontHelper, ITokenHelper tokenHelper,
                                  ITranslationUpdater translationUpdater, ISelectedProfileProvider profile, ITokenViewModelFactory tokenViewModelFactory, IDispatcher dispatcher)
     : base(translationUpdater, profile, dispatcher)
 {
     _interactionInvoker    = interactionInvoker;
     _fontHelper            = fontHelper;
     _tokenHelper           = tokenHelper;
     _translationUpdater    = translationUpdater;
     _tokenViewModelFactory = tokenViewModelFactory;
     _translationUpdater.RegisterAndSetTranslation(tf =>
     {
         _tokenReplacer = _tokenHelper.TokenReplacerWithPlaceHolders;
         var tokens     = _tokenHelper.GetTokenListForStamp();
         SetTokenViewModels(_tokenViewModelFactory, tokens);
     });
 }
Ejemplo n.º 4
0
 public BookBuilder(
    IEnumerable<BookImage> images,
    IList<double> headerSizes,
    IFontHelper helper,
    Size pageSize,
    double textSize,
    bool hyphenation,
    bool useCssFontSize)
 {
     _images = images;
     _headerSizes = headerSizes;
     _helper = helper;
     _pageSize = pageSize;
     _textSize = textSize;
     _hyphenation = hyphenation;
     _useCssFontSize = useCssFontSize;
 }
Ejemplo n.º 5
0
        public LineBuilder(
            double lineWidth, 
            IList<double> headerSizes, 
            double textSize, 
            IFontHelper helper, 
            bool hyphenation,
            bool useCssFontSize)
        {
            _headerSizes = headerSizes;
            _textSize = textSize;
            _helper = helper;
            _hyphenation = hyphenation;
            _useCssFontSize = useCssFontSize;
            _lineWidth = lineWidth;

            _output = new Queue<TokenBlockBase>();
            _hypher = new HyphenBuilder();
        }
Ejemplo n.º 6
0
        public LineBuilder(
            double lineWidth,
            IList <double> headerSizes,
            double textSize,
            IFontHelper helper,
            bool hyphenation,
            bool useCssFontSize)
        {
            _headerSizes    = headerSizes;
            _textSize       = textSize;
            _helper         = helper;
            _hyphenation    = hyphenation;
            _useCssFontSize = useCssFontSize;
            _lineWidth      = lineWidth;

            _output = new Queue <TokenBlockBase>();
            _hypher = new HyphenBuilder();
        }
Ejemplo n.º 7
0
 public BookBuilder(
     BookTokenIterator bookTokens,
     IEnumerable <BookImage> images,
     IList <double> headerSizes,
     IFontHelper helper,
     Size pageSize,
     double textSize,
     bool hyphenation,
     bool useCssFontSize)
 {
     _bookTokens     = bookTokens;
     _images         = images;
     _headerSizes    = headerSizes;
     _helper         = helper;
     _pageSize       = pageSize;
     _textSize       = textSize;
     _hyphenation    = hyphenation;
     _useCssFontSize = useCssFontSize;
 }
Ejemplo n.º 8
0
        public static IBookBuilder GetBookParser(string bookType, BookTokenIterator bookTokens, int fontSize, Size pageSize, IEnumerable <BookImage> images)
        {
            var headerSizes = new ReadOnlyCollection <double>(new List <double> {
                24, 32, 42
            });
            IFontHelper activeFontHelper = GetActiveFontMetrics(AppSettings.Default.FontSettings.FontFamily.Source);

            switch (bookType)
            {
            case "fb2":
            case "txt":
            case "epub":
            case "html":
                return(new BookBuilder(bookTokens, images, headerSizes, activeFontHelper, pageSize, fontSize, AppSettings.Default.Hyphenation, AppSettings.Default.UseCSSFontSize));

            default:
                throw new NotSupportedException("Book type '" + bookType + "' is not supported!");
            }
        }
Ejemplo n.º 9
0
        public DocumentTabViewModel(DocumentTabTranslation translation, IInteractionInvoker interactionInvoker, IFontHelper fontHelper, TokenHelper tokenHelper)
        {
            _interactionInvoker = interactionInvoker;
            _fontHelper         = fontHelper;
            Translation         = translation;

            TokenReplacer = tokenHelper.TokenReplacerWithPlaceHolders;

            TitleViewModel = new TokenViewModel(
                s => CurrentProfile.TitleTemplate = s,
                () => CurrentProfile?.TitleTemplate,
                tokenHelper.GetTokenListForTitle());

            AuthorViewModel = new TokenViewModel(
                s => CurrentProfile.AuthorTemplate = s,
                () => CurrentProfile?.AuthorTemplate,
                tokenHelper.GetTokenListForAuthor());

            SubjectViewModel = new TokenViewModel(s => CurrentProfile.SubjectTemplate = s, () => CurrentProfile?.SubjectTemplate, tokenHelper.GetTokenListForSubjectAndKeyword());
            KeywordViewModel = new TokenViewModel(s => CurrentProfile.KeywordTemplate = s, () => CurrentProfile?.KeywordTemplate, tokenHelper.GetTokenListForSubjectAndKeyword());
        }
Ejemplo n.º 10
0
 public CreatorSettingsUpgrader(Data settingsData, IFontHelper fontHelper) : base(settingsData)
 {
     _fontHelper         = fontHelper;
     VersionSettingPaths = new string[] { @"CreatorAppSettings\SettingsVersion", @"ApplicationSettings\SettingsVersion", @"ApplicationProperties\SettingsVersion" };
 }