예제 #1
0
        public SplitView RightIsSmaller(UnitSize rightSize)
        {
            RightComponent.Width = $"calc({rightSize.ToString()} - {SplitterComponent.Width})";
            LeftComponent.Width  = $"calc(100% - {rightSize.ToString()})";

            return(this);
        }
예제 #2
0
        public SplitView LeftIsSmaller(UnitSize leftSize)
        {
            LeftComponent.Width  = $"calc({leftSize.ToString()} - {SplitterComponent.Width})";
            RightComponent.Width = $"calc(100% - {leftSize.ToString()})";

            return(this);
        }
        /// <summary>
        /// The ToString method returns a string representation of the USCookingVolumeMeasurement
        /// </summary>
        /// <returns>String representation of the USCookingVolumeMeasurement</returns>
        public override string ToString()
        {
            //add S to end of unit if more than 1
            string unitString = Amount.CompareTo(1) > 0 ? UnitSize.ToString().ToLower() + "s" : UnitSize.ToString().ToLower();

            return(Amount.ToString() + " " + unitString);
        }
예제 #4
0
 private static void SetHtmlElementHeight(HTMLElement htmlElement, UnitSize height)
 {
     htmlElement.SetStyle(cssStyleDeclaration =>
     {
         cssStyleDeclaration.height = height.ToString();
     });
 }
예제 #5
0
 public SplitView(UnitSize splitterSize = null)
 {
     LeftComponent           = Raw(Div(_()));
     SplitterComponent       = Raw(Div(_("tss-splitter")));
     RightComponent          = Raw(Div(_()));
     SplitterComponent.Width = (splitterSize is object && splitterSize.Unit != Unit.Auto && splitterSize.Unit != Unit.Inherit)
                                   ? splitterSize.ToString()
                                   : "8px";
     LeftComponent.Height     = "100%";
     SplitterComponent.Height = "100%";
     RightComponent.Height    = "100%";
     SplitInMiddle();
     InnerElement = Div(_("tss-splitview"), LeftComponent.Render(), SplitterComponent.Render(), RightComponent.Render());
 }
예제 #6
0
        internal static IComponent CreateGradientOverlay(IComponent component, UnitSize maxContentHeight)
        {
            var container = component.Render();

            container.style.overflow  = "hidden";
            container.style.maxHeight = maxContentHeight.ToString();
            container.style.setProperty("isolation", "isolate");
            container.style.position = "relative"; //otherwise the position:absolute of the style bellow doesnt work

            var gradient = Div(_("card-gradient-overlay"));

            gradient.style.top = $"calc({maxContentHeight} - 40px)";
            container.appendChild(gradient);
            return(Raw(container));
        }
예제 #7
0
        /// <inheritdoc/>
        public override string ModelSummary()
        {
            using (StringWriter htmlWriter = new StringWriter())
            {
                htmlWriter.Write("\r\n<div class=\"activityentry\"><span class=\"setvalue\">");
                // get amount
                htmlWriter.Write(LabourPerUnit.ToString() + "</span> days labour is required");
                if (UnitType != LabourUnitType.Fixed)
                {
                    if (UnitSize == 1)
                    {
                        htmlWriter.Write(" for each ");
                    }
                    else
                    {
                        htmlWriter.Write(" for every <span class=\"setvalue\">" + UnitSize.ToString("#,##0.##") + "</span>");
                    }

                    htmlWriter.Write("<span class=\"setvalue\">" + UnitType2HTML() + "</span>");
                    if (WholeUnitBlocks)
                    {
                        htmlWriter.Write(" and will be supplied in blocks");
                    }
                }
                htmlWriter.Write("</div>");

                if (MinimumPerPerson > 0)
                {
                    htmlWriter.Write("\r\n<div class=\"activityentry\">Labour will not be supplied if less than <span class=\"setvalue\">" + MinimumPerPerson.ToString() + "</span> day" + ((MinimumPerPerson == 1) ? "" : "s") + " is required</div>");
                }

                if (MaximumPerPerson > 0 && MaximumPerPerson < 30)
                {
                    htmlWriter.Write("\r\n<div class=\"activityentry\">No individual can provide more than <span class=\"setvalue\">" + MaximumPerPerson.ToString() + "</span> days</div>");
                }

                if (ApplyToAll)
                {
                    htmlWriter.Write("\r\n<div class=\"activityentry\">All people matching the below criteria (first level) will perform this task. (e.g. all children)</div>");
                }

                return(htmlWriter.ToString());
            }
        }
예제 #8
0
 public SettingForm()
 {
     InitializeComponent();
     textBox1.Text = UnitSize.ToString();
     textBox2.Text = EA.ToString();
 }
        /// <summary>
        /// The ToHTMLFormattedString method returns a string that includes HTML tags to better display fractions
        /// </summary>
        /// <returns>String containing HTML-formatted representation of USCookingVolumeMeasurement </returns>
        public override string ToHTMLFormattedString()
        {
            string unitString = Amount.CompareTo(1) > 0 ? UnitSize.ToString().ToLower() + "s" : UnitSize.ToString().ToLower();

            return(Amount.ToHTMLFormattedString() + " " + unitString);
        }