protected void LoadStreamThing(ContentStreamViewer viewer, IThingGraph graph, IStreamThing thing) { try { viewer.IsStreamOwner = IsStreamOwner; if (viewer.ContentId != thing.Id) { SaveStream(graph, viewer); var content = graph.ContentOf(thing); if (viewer is SheetViewer) { content.Source = thing.Id; } if (viewer is HtmlContentViewer) { var htmlViewr = (HtmlContentViewer)viewer; htmlViewr.ContentThing = thing; htmlViewr.ThingGraph = graph; } viewer.SetContent(content); viewer.ContentId = thing.Id; } } catch (Exception ex) { ExceptionHandler.Catch(ex, MessageType.OK); } finally { thing.ClearRealSubject(!IsStreamOwner); } }
public virtual WebContent GetContentFromThing(IThingGraph graph, IThing thing) { var info = graph.ContentOf(thing); var uri = GetUri(thing); return(GetContentFromContent(info, uri)); }
public IEnumerable <Content <Stream> > PageStreams(IThingGraph graph, IThing document) { if (graph == null || document == null) { return(new Content <Stream> [0]); } return(Pages(graph, document) .Where(page => page is IStreamThing) .Select(page => graph.ContentOf(page))); }
protected virtual bool DisplaySheet(IGraphSceneDisplay <IVisual, IVisualEdge> display, IThing thing, IThingGraph thingGraph) { var streamThing = thing as IStreamThing; try { if (streamThing != null && streamThing.StreamType == ContentTypes.LimadaSheet) { var content = thingGraph.ContentOf(streamThing); content.Source = streamThing.Id; DisplaySheet(display, content); return(true); } } catch (Exception e) { Trace.WriteLine("Error on displaying sheet {0}", e.Message); Debug.WriteLine(e.StackTrace); } return(false); }