public void ProcessRequest( HttpContext context ) { try { //Cache the sitemap for 8 hours... DataCache cache = CacheFactory.GetCache(); string CacheKey = "TimelineXml"; timeline root = cache[CacheKey] as timeline ; if (root == null) //we'll have to build it... { ILoggingDataService logService = LoggingDataServiceFactory.GetService(SiteConfig.GetLogPathFromCurrentContext()); IBlogDataService dataService = BlogDataServiceFactory.GetService(SiteConfig.GetContentPathFromCurrentContext(), logService); SiteConfig siteConfig = SiteConfig.GetSiteConfig(); root = new timeline(); root.events = new eventCollection(); int i = 0; //All Pages (stop after 750...it gets too big and the browser can't handle it...we'd need // to include dynamic paging EntryCollection entryCache = dataService.GetEntries(false); //Fortunately this comes in ordered by post date, descending foreach(Entry e in entryCache) { if (e.IsPublic && (++i < 750)) { //then add permalinks string url = SiteUtilities.GetPermaLinkUrl(siteConfig, (ITitledEntry)e); @event foo = new @event(e.CreatedLocalTime, false, TruncateDotDotDot(StripAllTags(e.Title), 50), url); foo.text += String.Format("<div align=\"right\"><a href=\"{0}\">More...</a></div>",url); root.events.Add(foo); } } cache.Insert(CacheKey,root,DateTime.Now.AddHours(8)); } XmlSerializer x = new XmlSerializer(typeof(timeline)); x.Serialize(HttpContext.Current.Response.OutputStream,root); HttpContext.Current.Response.ContentType = "text/xml"; } catch(Exception exc) { ErrorTrace.Trace(System.Diagnostics.TraceLevel.Error,exc); } }
public void ProcessRequest(HttpContext context) { try { //Cache the sitemap for 8 hours... DataCache cache = CacheFactory.GetCache(); string CacheKey = "TimelineXml"; timeline root = cache[CacheKey] as timeline; if (root == null) //we'll have to build it... { ILoggingDataService logService = LoggingDataServiceFactory.GetService(SiteConfig.GetLogPathFromCurrentContext()); IBlogDataService dataService = BlogDataServiceFactory.GetService(SiteConfig.GetContentPathFromCurrentContext(), logService); SiteConfig siteConfig = SiteConfig.GetSiteConfig(); root = new timeline(); root.events = new eventCollection(); int i = 0; //All Pages (stop after 750...it gets too big and the browser can't handle it...we'd need // to include dynamic paging EntryCollection entryCache = dataService.GetEntries(false); //Fortunately this comes in ordered by post date, descending foreach (Entry e in entryCache) { if (e.IsPublic && (++i < 750)) { //then add permalinks string url = SiteUtilities.GetPermaLinkUrl(siteConfig, (ITitledEntry)e); @event foo = new @event(e.CreatedLocalTime, false, TruncateDotDotDot(StripAllTags(e.Title), 50), url); foo.text += String.Format("<div align=\"right\"><a href=\"{0}\">More...</a></div>", url); root.events.Add(foo); } } cache.Insert(CacheKey, root, DateTime.Now.AddHours(8)); } XmlSerializer x = new XmlSerializer(typeof(timeline)); x.Serialize(HttpContext.Current.Response.OutputStream, root); HttpContext.Current.Response.ContentType = "text/xml"; } catch (Exception exc) { ErrorTrace.Trace(System.Diagnostics.TraceLevel.Error, exc); } }
// Use this for initialization void Start() { //Start Couroutine StartCoroutine(record()); //Add objects to lists rewindableObjects = new List<GameObject>(GameObject.FindGameObjectsWithTag("Phys")); for (int i = 0; i < rewindableObjects.Count; i++) { //make a new timeline timeline thisOne = new timeline(); thisOne.id = rewindableObjects[i].name; timelines.Add(thisOne); } }