Пример #1
0
        internal static string writeHeader(CarboProject carboProject)
        {
            string html = "";

            try
            {
                html = "<HTML><HEAD><TITLE>Carbon Life Calculation for: " + carboProject.Name + " </TITLE>" + System.Environment.NewLine;
                //add header row
                html += "<LINK href = 'https://fonts.googleapis.com/css?family=Oswald' rel='stylesheet'>" + System.Environment.NewLine;

                html += getCSS();
                html += "</HEAD><BODY>";
                html += "<H1>Project Info:</H1>" + System.Environment.NewLine;
                html += "<H2>Name: " + carboProject.Name + "</H2>" + System.Environment.NewLine;
                html += "<H2>Description: " + carboProject.Description + "</H2>" + System.Environment.NewLine;
                html += "<H2>Value: £ " + carboProject.Value + " </H2>" + System.Environment.NewLine;
                html += "<H2>Area: " + carboProject.Area + " m²</H2>" + System.Environment.NewLine;
                html += "<H2>" + Math.Round(carboProject.getTotalEC(), 2) + " tCO<SUB>2</SUB></H2>" + System.Environment.NewLine;
                html += "<H2>" + Math.Round((carboProject.getTotalEC() / carboProject.Area), 2) + " tCO<SUB>2</SUB>/m²</H2>" + System.Environment.NewLine;

                html += "<H2>Category: " + carboProject.Category + "</H2>" + System.Environment.NewLine;
                html += "<H2>Export Date: " + DateTime.Today.ToShortDateString() + "</H2>" + System.Environment.NewLine;

                html += "<H3>" + carboProject.getSummaryText(true, true, true, true) + "</H3>" + System.Environment.NewLine;
            }
            catch (Exception ex)
            {
            }

            return(html);
        }
Пример #2
0
        private void refreshSumary()
        {
            if (CarboLifeProject != null)
            {
                cnv_Totals.Children.Clear();
                summaryTextMemory = "";


                TextBlock TotalText = new TextBlock();
                TotalText.Text       = "Total Embodied Carbon: " + CarboLifeProject.getTotalEC().ToString() + " tCO₂e";
                summaryTextMemory   += TotalText.Text + Environment.NewLine;
                TotalText.FontStyle  = FontStyles.Normal;
                TotalText.FontWeight = FontWeights.Bold;

                TotalText.Foreground        = Brushes.Black;
                TotalText.TextWrapping      = TextWrapping.WrapWithOverflow;
                TotalText.VerticalAlignment = VerticalAlignment.Top;
                TotalText.FontSize          = 16;

                Canvas.SetLeft(TotalText, 5);
                Canvas.SetTop(TotalText, 5);
                cnv_Totals.Children.Add(TotalText);


                TextBlock summaryText = new TextBlock();
                summaryText.Text       = CarboLifeProject.getSummaryText(true, true, true, true);
                summaryTextMemory     += summaryText.Text;
                summaryText.FontStyle  = FontStyles.Normal;
                summaryText.FontWeight = FontWeights.Normal;

                summaryText.Foreground        = Brushes.Black;
                summaryText.TextWrapping      = TextWrapping.WrapWithOverflow;
                summaryText.VerticalAlignment = VerticalAlignment.Top;
                summaryText.FontSize          = 13;

                Canvas.SetLeft(summaryText, 5);
                Canvas.SetTop(summaryText, 25);
                cnv_Totals.Children.Add(summaryText);
            }
        }
Пример #3
0
        private void refreshSumary()
        {
            if (CarboLifeProject != null)
            {
                cnv_Totals.Children.Clear();



                TextBlock summaryText = new TextBlock();
                summaryText.Text = CarboLifeProject.getSummaryText(true, true, true, true);


                summaryText.Foreground        = Brushes.Black;
                summaryText.TextWrapping      = TextWrapping.WrapWithOverflow;
                summaryText.VerticalAlignment = VerticalAlignment.Top;
                summaryText.FontSize          = 16;

                Canvas.SetLeft(summaryText, 5);
                Canvas.SetTop(summaryText, 5);
                cnv_Totals.Children.Add(summaryText);
            }
        }