Beispiel #1
0
        public string GetRecommendedPath(FileInformation fileInformation)
        {
            var values = FilePlaceholderFiller.GetPlaceholders(
                _photoFilenameTemplate.Fragments.OfType <PlaceholderFragment>().Select(x => x.Value), fileInformation);
            var path = _photoFilenameTemplate.ToString(values.ToDictionary(x => x.Key, x => x.Value ?? string.Empty));

            return(ClearPath(path));
        }
Beispiel #2
0
        public TemplateString GetFilenameTemplate(FileInformation fileInformation)
        {
            var values = FilePlaceholderFiller.GetPlaceholders(
                _photoFilenameTemplate.Fragments.OfType <PlaceholderFragment>().Select(x => x.Value), fileInformation);
            var nonNullValues = values.Where(x => x.Value != null).ToDictionary(x => x.Key, x => x.Value !);

            var path = _photoFilenameTemplate.ToString(nonNullValues).ToForwardSlashes();

            return(TemplateString.Parse(path));
        }