예제 #1
0
        private static void RenderIndicatorSummary(IndicatorResult result, IRenderingContext context)
        {
            context.Document.WriteLine("<table>");

            context.Document.WriteLine("<tr><td>Signal</td><td>{0}</td></tr>", HtmlRenderingUtils.GetDisplayText(result.Signal));
            context.Document.WriteLine("<tr><td>Gain/Risk ratio</td><td>{0}</td></tr>", HtmlRenderingUtils.GetDisplayText(result.GainRiskRatio));
            context.Document.WriteLine("<tr><td>Expected gain</td><td>{0}</td></tr>", HtmlRenderingUtils.GetDisplayText(result.ExpectedGain));

            context.Document.WriteLine("</table>");
        }
예제 #2
0
        private void RenderStockDetails(StockHandle stock, TextWriter document)
        {
            var details = new Dictionary <string, object>();

            details["Name"]     = stock.Name;
            details["Isin"]     = stock.Isin;
            details["Currency"] = stock.StockExchange.Currency.Name;

            HtmlRenderingUtils.RenderDictionary(details, document);
        }
        private void RenderIndicatorSummeryRow(IndicatorResult result, IRenderingContext context)
        {
            context.Document.WriteLine("<tr>");

            context.Document.WriteLine("<td>{0}</td>", result.Indicator);
            RenderSignal(result, context);
            context.Document.WriteLine("<td align=\"right\">{0}</td>", HtmlRenderingUtils.GetDisplayText(result.GainRiskRatio));
            context.Document.WriteLine("<td align=\"right\">{0}</td>", HtmlRenderingUtils.GetDisplayText(result.ExpectedGain));

            context.Document.WriteLine("</tr>");
        }
예제 #4
0
            private void RenderCellValue(TableRow row, TableColumn column)
            {
                var value = row[column];

                if (value is ValueWithDetails)
                {
                    Render((ValueWithDetails)value);
                }
                else
                {
                    myContext.Document.WriteLine(HtmlRenderingUtils.GetDisplayText(value));
                }
            }
예제 #5
0
            private void Render(ValueWithDetails valueWithDetails)
            {
                if (valueWithDetails.Details == null)
                {
                    myContext.Document.WriteLine(HtmlRenderingUtils.GetDisplayText(valueWithDetails.Value));
                }
                else
                {
                    using (var childCtx = myContext.CreateChildContext(valueWithDetails.Details.Reference, valueWithDetails.Details.Name + ".html"))
                    {
                        childCtx.Render(valueWithDetails.Details);

                        myContext.Document.WriteLine("<a href=\"{0}\">{1}</a>", childCtx.RelativeDocumentUrl(myContext), HtmlRenderingUtils.GetDisplayText(valueWithDetails.Value));
                    }
                }
            }
        private void RenderSignal(IndicatorResult result, IRenderingContext context)
        {
            if (result.Report == null)
            {
                context.Document.WriteLine("<td>{0}</td>", HtmlRenderingUtils.GetDisplayText(result.Signal));
            }
            else
            {
                using (var childCtx = context.CreateChildContext(result.Indicator, result.Report.Name + ".html"))
                {
                    childCtx.Render(result.Report);

                    context.Document.WriteLine("<td><a href=\"{0}\">{1}</a></td>",
                                               childCtx.RelativeDocumentUrl(context), HtmlRenderingUtils.GetDisplayText(result.Signal));
                }
            }
        }
예제 #7
0
        public void Render(KeyValueSection section, IRenderingContext context)
        {
            context.Document.WriteLine("<h2>{0}</h2>", section.Name);

            HtmlRenderingUtils.RenderDictionary(section.Entries, context.Document);
        }