CalendarAggregator.CalendarRenderer.RenderHtmlEventsOnly C# (CSharp) Метод

RenderHtmlEventsOnly() публичный Метод

public RenderHtmlEventsOnly ( CalendarAggregator.ZonelessEventStore eventstore, string view, int count, System.DateTime from, System.DateTime to, string source, object>.Dictionary args ) : string
eventstore CalendarAggregator.ZonelessEventStore
view string
count int
from System.DateTime
to System.DateTime
source string
args object>.Dictionary
Результат string
        public string RenderHtmlEventsOnly(ZonelessEventStore eventstore, string view, int count, DateTime from, DateTime to, string source, Dictionary<string,object> args)
        {
            args["advance_to_an_hour_ago"] = true;

            var day_anchors = GetDayAnchorsAsJson(eventstore, view);

            eventstore = GetEventStore(eventstore, view, count, from, to, source, args);

            var builder = new StringBuilder();

            MaybeUseAlternateTemplate(args);

            RenderEventsAsHtml(eventstore, builder, args);

            var html = this.template_html.Replace("__EVENTS__", builder.ToString());

            if (args.ContainsKey("taglist") && (bool) args["taglist"] == true )
                html = this.InsertTagSelector(html, eventstore, view, eventsonly: true);

            html = html.Replace("__APPDOMAIN__", ElmcityUtils.Configurator.appdomain);

            html = html.Replace("__ID__", this.id);
            html = html.Replace("__TITLE__", MakeEventTitle(view));
            html = html.Replace("__META__", MakeEventTitle(view) + " calendars happenings schedules");

            var css_url = GetCssUrl(args);
            html = html.Replace("__CSSURL__", css_url);

            html = HandleJsUrl(html, args);

            html = html.Replace("__GENERATED__", System.DateTime.UtcNow.ToString());

            html = html.Replace("__METADATA__", day_anchors);

            html = InsertImageJson(html);

            html = Utils.RemoveCommentSection(html, "SIDEBAR");
            html = Utils.RemoveCommentSection(html, "JQUERY_UI_CSS");
            html = Utils.RemoveCommentSection(html, "JQUERY_UI");
            html = Utils.RemoveCommentSection(html, "DATEPICKER");
            html = Utils.RemoveCommentSection(html, "HUBTITLE");
            html = Utils.RemoveCommentSection(html, "TAGS");

            html = HandleDefaultArgs(html);

            return html;
        }

Usage Example

Пример #1
0
 private static ContentResult view_calendar_helper(string id, ContentResult r, ZonedEventStore es_zoned, ZonelessEventStore es_zoneless)
 {
     foreach (var evt in es_zoned.events)
         es_zoneless.AddEvent(evt.title, evt.url.ToString(), evt.source, "", "", evt.dtstart.LocalTime, evt.dtend.LocalTime, evt.allday, evt.categories, evt.description, evt.location);
     es_zoneless.events = EventStore.UniqueByTitleAndStart(id, es_zoneless.events, save_tag_sources: false);
     es_zoneless.ExcludePastEvents();
     es_zoneless.SortEventList();
     var cr = new CalendarRenderer(id);
     r.Content = cr.RenderHtmlEventsOnly(es_zoneless, null, 0, DateTime.MinValue, DateTime.MinValue, new Dictionary<string, object>() { { "announce_time_of_day", false }, { "add_to_cal", false }, { "inline_descriptions", true }, {"taglist",false } } );
     return r;
 }