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

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

public RenderDynamicViewWithCaching ( ControllerContext context, string view_key, ViewRenderer view_renderer, string view, int count, System.DateTime from, System.DateTime to, string source, object>.Dictionary args ) : string
context ControllerContext
view_key string
view_renderer ViewRenderer
view string
count int
from System.DateTime
to System.DateTime
source string
args object>.Dictionary
Результат string
        public string RenderDynamicViewWithCaching(ControllerContext context, string view_key, ViewRenderer view_renderer, string view, int count, DateTime from, DateTime to, string source, Dictionary<string,object> args)
        {
            try
            {
                var view_is_cached = this.cache[view_key] != null;
                byte[] view_data;
                byte[] response_body;
                if (view_is_cached)
                    view_data = (byte[])cache[view_key];
                else
                    view_data = Encoding.UTF8.GetBytes(view_renderer(eventstore: null, view: view, count: count, from: from, to: to, source:source, args: args));

                response_body = CacheUtils.MaybeSuppressResponseBodyForView(context, view_data);
                return Encoding.UTF8.GetString(response_body);
            }
            catch (Exception e)
            {
                GenUtils.PriorityLogMsg("exception", "RenderDynamicViewWithCaching: " + view_key, e.Message + e.StackTrace);
                return RenderDynamicViewWithoutCaching(context, view_renderer, view, count, from, to, source, args: args);
            }
        }