Ejemplo n.º 1
0
        /// <summary>
        /// Binds the list of slides for this module to the <see cref="SlidesRepeater"/>.
        /// </summary>
        private void BindData()
        {
            var slides = Slide.GetSlides(this.ModuleId, true);

            this.SlidesRepeater.DataSource = slides;
            this.SlidesRepeater.DataBind();

            this.NoSlidesSection.Visible = !slides.Any();
        }
Ejemplo n.º 2
0
        /// <summary>Exports the module content</summary>
        /// <param name="moduleId">The module ID.</param>
        /// <returns>The module's content as XML.</returns>
        public string ExportModule(int moduleId)
        {
            var output = new StringBuilder();

            output.Append("<slides>");

            try
            {
                foreach (var slide in Slide.GetSlides(moduleId))
                {
                    output.Append("<slide>");
                    output.AppendFormat(CultureInfo.InvariantCulture, "<content>{0}</content>", slide.Content);
                    output.AppendFormat(CultureInfo.InvariantCulture, "<link>{0}</link>", slide.Link);

                    output.AppendFormat(CultureInfo.InvariantCulture, "<imagelink>{0}</imagelink>", slide.ImageLink);
                    output.AppendFormat(CultureInfo.InvariantCulture, "<startdate>{0}</startdate>", slide.StartDate);

                    if (slide.EndDate.HasValue)
                    {
                        output.AppendFormat(CultureInfo.InvariantCulture, "<enddate>{0}</enddate>", slide.EndDate);
                    }

                    output.AppendFormat(CultureInfo.InvariantCulture, "<pagerimagelink>{0}</pagerimagelink>", slide.PagerImageLink);
                    output.AppendFormat(CultureInfo.InvariantCulture, "<title>{0}</title>", slide.Title);
                    output.AppendFormat(CultureInfo.InvariantCulture, "<sortorder>{0}</sortorder>", slide.SortOrder);
                    output.AppendFormat(CultureInfo.InvariantCulture, "<tracklink>{0}</tracklink>", slide.TrackLink);

                    // output imagedata and tab paths for multi-instance portibility
                    ProcessExport(slide.ImageLink, "image", output);
                    ProcessExport(slide.Link, "link", output);

                    output.Append("</slide>");
                }
            }
            catch (Exception exc)
            {
                Exceptions.LogException(exc);
            }

            output.Append("</slides>");
            return(output.ToString());
        }