Beispiel #1
0
        public void Update(IContent content)
        {
            var template = content as Template;

            if (template != null)
            {
                var surrogate = new TemplateSurrogateBuilder().Build(template);
                var path      = Path.Combine(
                    TemplatesDirectory,
                    template.Path.ToFileSystemPath(),
                    TemplateFileName);
                this.serializationHelper.Serialize <TemplateSurrogate>(surrogate, path);
            }
        }
Beispiel #2
0
        public void Add(IContent content)
        {
            var template = content as Template;

            if (template != null)
            {
                var surrogate     = new TemplateSurrogateBuilder().Build(template);
                var directoryPath = Path.Combine(
                    TemplatesDirectory,
                    template.Path.ToFileSystemPath());

                if (!this.fileSystemHelper.DirectoryExists(directoryPath))
                {
                    this.fileSystemHelper.CreateDirectory(directoryPath);
                }

                var path = Path.Combine(directoryPath, TemplateFileName);
                this.serializationHelper.Serialize <TemplateSurrogate>(surrogate, path);
            }
        }