예제 #1
0
//-------------------------------------------------------------------------------------------
        protected override void Render(HtmlTextWriter writer)
        {
            if (!Visible)
            {
                return;
            }
            writer.AddStyleAttribute(HtmlTextWriterStyle.BorderStyle, BorderStyle.ToString());
            writer.AddStyleAttribute(HtmlTextWriterStyle.BorderWidth, BorderWidth.ToString());
            writer.AddAttribute(HtmlTextWriterAttribute.Width, Width.ToString());
            writer.AddAttribute(HtmlTextWriterAttribute.Href, Height.ToString());
            writer.AddAttribute(HtmlTextWriterAttribute.Cellpadding, "0");
            writer.AddAttribute(HtmlTextWriterAttribute.Cellspacing, "0");
            writer.AddAttribute(HtmlTextWriterAttribute.Align, "center");
            writer.RenderBeginTag("table");
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "groupboxtitle");
            writer.RenderBeginTag("tr");
            writer.AddAttribute(HtmlTextWriterAttribute.Background, "images/group-box-bar.gif");
            writer.RenderBeginTag("td");
            writer.Write(Text);
            writer.RenderEndTag();
            writer.RenderEndTag();
            for (int i = 0; i < Items.Count; i++)
            {
                RenderItemRow(writer, Items[i]);
            }
            writer.RenderEndTag();
        }
예제 #2
0
        private void RenderSliderHeader(HtmlTextWriter output)
        {
            output.AddAttribute(
                _direction == DirectionLift.Vertical ? HtmlTextWriterAttribute.Height : HtmlTextWriterAttribute.Width,
                Size.ToString());

            output.AddAttribute("onselectstart", "return false;");
            output.AddAttribute("ondragstart", "return false;");
            output.AddAttribute(HtmlTextWriterAttribute.Cellpadding, "0");
            output.AddAttribute(HtmlTextWriterAttribute.Cellspacing, "0");
            output.AddAttribute(HtmlTextWriterAttribute.Border, "0");
            if (CssClass == string.Empty)
            {
                output.AddStyleAttribute(HtmlTextWriterStyle.BackgroundColor, Utils.Color2Hex(BackColor));
                if (BorderStyle != BorderStyle.None && BorderStyle != BorderStyle.NotSet)
                {
                    output.AddStyleAttribute(HtmlTextWriterStyle.BorderStyle, BorderStyle.ToString());
                    output.AddStyleAttribute(HtmlTextWriterStyle.BorderColor, Utils.Color2Hex(BorderColor));
                    output.AddStyleAttribute(HtmlTextWriterStyle.BorderWidth, BorderWidth.ToString());
                }

                output.AddStyleAttribute("cursor", "default");
            }
            else
            {
                output.AddAttribute(HtmlTextWriterAttribute.Class, CssClass);
            }
        }
예제 #3
0
파일: StyledNode.cs 프로젝트: chances/surf
        public StyledNode(Node node)
        {
            Node            = node;
            SpecifiedValues = new Dictionary <string, List <Value> >();
            Children        = new List <StyledNode>();

            _margins      = new Lazy <EdgeValues>(() => Margin.GetMargins(SpecifiedValues));
            _borderWidths = new Lazy <EdgeValues>(() => BorderWidth.GetBorderWidths(SpecifiedValues));
            _paddings     = new Lazy <EdgeValues>(() => Padding.GetPaddings(SpecifiedValues));
        }
예제 #4
0
        internal static BorderWidth GetBorderWidth(GraphElement element)
        {
            var borderWidth = new BorderWidth {
                Top    = element.contentContainer.resolvedStyle.borderTopWidth,
                Bottom = element.contentContainer.resolvedStyle.borderBottomWidth,
                Left   = element.contentContainer.resolvedStyle.borderLeftWidth,
                Right  = element.contentContainer.resolvedStyle.borderRightWidth
            };

            return(borderWidth);
        }
예제 #5
0
        /// <inheritdoc />
        public bool Equals([AllowNull] Gauge other)
        {
            if (other == null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Shape == other.Shape ||
                     Shape != null &&
                     Shape.Equals(other.Shape)
                     ) &&
                 (
                     Bar == other.Bar ||
                     Bar != null &&
                     Bar.Equals(other.Bar)
                 ) &&
                 (
                     BgColor == other.BgColor ||
                     BgColor != null &&
                     BgColor.Equals(other.BgColor)
                 ) &&
                 (
                     BorderColor == other.BorderColor ||
                     BorderColor != null &&
                     BorderColor.Equals(other.BorderColor)
                 ) &&
                 (
                     BorderWidth == other.BorderWidth ||
                     BorderWidth != null &&
                     BorderWidth.Equals(other.BorderWidth)
                 ) &&
                 (
                     Axis == other.Axis ||
                     Axis != null &&
                     Axis.Equals(other.Axis)
                 ) &&
                 (
                     Equals(Steps, other.Steps) ||
                     Steps != null && other.Steps != null &&
                     Steps.SequenceEqual(other.Steps)
                 ) &&
                 (
                     Threshold == other.Threshold ||
                     Threshold != null &&
                     Threshold.Equals(other.Threshold)
                 ));
        }
예제 #6
0
        /// <inheritdoc />
        public bool Equals([AllowNull] RangeSlider other)
        {
            if (other == null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     BgColor == other.BgColor ||
                     BgColor != null &&
                     BgColor.Equals(other.BgColor)
                     ) &&
                 (
                     BorderColor == other.BorderColor ||
                     BorderColor != null &&
                     BorderColor.Equals(other.BorderColor)
                 ) &&
                 (
                     BorderWidth == other.BorderWidth ||
                     BorderWidth != null &&
                     BorderWidth.Equals(other.BorderWidth)
                 ) &&
                 (
                     AutoRange == other.AutoRange ||
                     AutoRange != null &&
                     AutoRange.Equals(other.AutoRange)
                 ) &&
                 (
                     Equals(Range, other.Range) ||
                     Range != null && other.Range != null &&
                     Range.SequenceEqual(other.Range)
                 ) &&
                 (
                     Thickness == other.Thickness ||
                     Thickness != null &&
                     Thickness.Equals(other.Thickness)
                 ) &&
                 (
                     Visible == other.Visible ||
                     Visible != null &&
                     Visible.Equals(other.Visible)
                 ) &&
                 (
                     Equals(YAxis, other.YAxis) ||
                     YAxis != null && other.YAxis != null &&
                     YAxis.SequenceEqual(other.YAxis)
                 ));
        }
        public override void BeginSnap(GraphElement selectedElement)
        {
            if (IsActive)
            {
                Debug.LogError("SnapService.BeginSnap: Snap to grid already active. Call EndSnap() first.");
            }
            IsActive = true;

            m_BorderWidth = GetBorderWidth(selectedElement); // Needed to snap element on its content container's border

            m_GraphView = selectedElement.GraphView;

            m_GridSpacing = m_GraphView.SafeQ <GridBackground>().Spacing;
        }
예제 #8
0
        public override void BeginSnap(GraphElement selectedElement)
        {
            if (IsActive)
            {
                Debug.LogError("SnapService.BeginSnap: Snap to grid already active. Call EndSnap() first.");
            }
            IsActive = true;

            m_BorderWidth = GetBorderWidth(selectedElement);             // Needed to snap element on its content container's border

            m_GraphView = selectedElement.GetFirstAncestorOfType <GraphView>();

            m_GridSpacing = 100;
        }
예제 #9
0
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;

                if (Shape != null)
                {
                    hashCode = hashCode * 59 + Shape.GetHashCode();
                }

                if (Bar != null)
                {
                    hashCode = hashCode * 59 + Bar.GetHashCode();
                }

                if (BgColor != null)
                {
                    hashCode = hashCode * 59 + BgColor.GetHashCode();
                }

                if (BorderColor != null)
                {
                    hashCode = hashCode * 59 + BorderColor.GetHashCode();
                }

                if (BorderWidth != null)
                {
                    hashCode = hashCode * 59 + BorderWidth.GetHashCode();
                }

                if (Axis != null)
                {
                    hashCode = hashCode * 59 + Axis.GetHashCode();
                }

                if (Steps != null)
                {
                    hashCode = hashCode * 59 + Steps.GetHashCode();
                }

                if (Threshold != null)
                {
                    hashCode = hashCode * 59 + Threshold.GetHashCode();
                }

                return(hashCode);
            }
        }
예제 #10
0
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;

                if (BgColor != null)
                {
                    hashCode = hashCode * 59 + BgColor.GetHashCode();
                }

                if (BorderColor != null)
                {
                    hashCode = hashCode * 59 + BorderColor.GetHashCode();
                }

                if (BorderWidth != null)
                {
                    hashCode = hashCode * 59 + BorderWidth.GetHashCode();
                }

                if (AutoRange != null)
                {
                    hashCode = hashCode * 59 + AutoRange.GetHashCode();
                }

                if (Range != null)
                {
                    hashCode = hashCode * 59 + Range.GetHashCode();
                }

                if (Thickness != null)
                {
                    hashCode = hashCode * 59 + Thickness.GetHashCode();
                }

                if (Visible != null)
                {
                    hashCode = hashCode * 59 + Visible.GetHashCode();
                }

                if (YAxis != null)
                {
                    hashCode = hashCode * 59 + YAxis.GetHashCode();
                }

                return(hashCode);
            }
        }
예제 #11
0
        /// <summary>
        /// Render this control to the output parameter specified.
        /// </summary>
        /// <param name="output"> The HTML writer to write out to </param>
        protected override void Render(HtmlTextWriter output)
        {
            Attributes.Add("cellSpacing", "1");
            Attributes.Add("cellPadding", "1");
            Attributes.Add("border", "1");
            Attributes.Add("borderWidth", BorderWidth.ToString());
            Attributes.Add("borderColor", formatColour(BorderColor));

            base.RenderBeginTag(output);

            output.Write("<TR>");
            foreach (char c in mCount.ToString().PadLeft(mPadding, '0'))
            {
                output.Write("<TD align=\"middle\">" + c + "</TD>");
            }
            output.Write("</TR>");

            base.RenderEndTag(output);
        }
예제 #12
0
        public override void OnDraw()
        {
            T totalExtra               = BorderWidth.Add(TextPadding);
            RectDouble <T>  Bounds     = new RectDouble <T>(totalExtra.Negative(), totalExtra.Negative(), m_ButtonText.Width.Add(totalExtra), m_ButtonText.Height.Add(totalExtra));
            RoundedRect <T> rectBorder = new RoundedRect <T>(Bounds, m_BorderRadius);

            GetRenderer().Render(rectBorder, new RGBA_Bytes(0, 0, 0));
            RectDouble <T> insideBounds = Bounds;

            insideBounds.Inflate(BorderWidth.Negative());
            RoundedRect <T> rectInside  = new RoundedRect <T>(insideBounds, M.New <T>(Math.Max(m_BorderRadius.Subtract(BorderWidth).ToDouble(), 0)));
            RGBA_Bytes      insideColor = new RGBA_Bytes(1.0, 1.0, 1.0);

            if (MouseOverButton)
            {
                if (MouseDownOnButton)
                {
                    insideColor = new RGBA_Bytes(255, 110, 110);
                }
                else
                {
                    insideColor = new RGBA_Bytes(225, 225, 255);
                }
            }

            GetRenderer().Render(rectInside, insideColor);

#if false
            double x1, y1, x2, y2;
            m_ButtonText.GetTextBounds(out x1, out y1, out x2, out y2);
            RoundedRect rectText    = new RoundedRect(x1, y1, x2, y2, 0);
            conv_stroke rectOutline = new conv_stroke(rectText);
            GetRenderer().Render(rectOutline, new RGBA_Bytes(1.0, 0, 0));
#endif
#if false
            RoundedRect rectText2    = new RoundedRect(m_ButtonText.Bounds, 0);
            conv_stroke rectOutline2 = new conv_stroke(rectText2);
            GetRenderer().Render(rectOutline, new RGBA_Bytes(0, 0, 1.0));
#endif

            base.OnDraw();
        }
예제 #13
0
            /// <summary>
            /// Render this control as an HTML stream.
            /// </summary>
            /// <param name="output">The HTML writer to write out to.</param>
            protected override void Render(HtmlTextWriter output)
            {
                // first of all render the bitmap;
                System.Drawing.Bitmap b = new System.Drawing.Bitmap((int)Width.Value, (int)Height.Value);
                if (backColor_ != null)
                {
                    Graphics g = Graphics.FromImage(b);
                    g.FillRectangle((new Pen((Color)backColor_)).Brush, 0, 0, b.Width, b.Height);
                }
                ps_.Draw(Graphics.FromImage(b), new System.Drawing.Rectangle(0, 0, b.Width, b.Height));

                // then store in context memory.
                Context.Session[prefix() + "PNG"] = b;

                // now render html.
                if (BorderStyle == BorderStyle.None)
                {
                    output.AddAttribute("border", "0");
                }
                else
                {
                    output.AddAttribute("border", BorderWidth.ToString());
                    output.AddAttribute("borderColor", BorderColor.ToKnownColor().ToString());
                }
                output.AddAttribute("cellSpacing", "0");
                output.AddAttribute("cellPadding", "0");
                output.RenderBeginTag("table");
                output.RenderBeginTag("tr");
                output.AddAttribute("vAlign", "center");
                output.AddAttribute("align", "middle");
                output.RenderBeginTag("td");
                output.RenderBeginTag("P");
                output.AddAttribute("src", plotUrl);
                output.AddAttribute("alt", ToolTip);
                output.RenderBeginTag("img");
                output.RenderEndTag();
                output.RenderEndTag();
                output.RenderEndTag();
                output.RenderEndTag();
                output.RenderEndTag();
                output.Flush();
            }
예제 #14
0
        public ButtonWidget(T x, T y, string lable,
                            T textHeight, T textPadding, T borderWidth, T borderRadius)
        {
            m_X = x;
            m_Y = y;
            SetTransform(MatrixFactory <T> .NewTranslation(x, y));
            m_ButtonText = new TextWidget <T>(lable, M.Zero <T>(), M.Zero <T>(), textHeight);
            AddChild(m_ButtonText);

            TextPadding  = textPadding;
            BorderWidth  = borderWidth;
            BorderRadius = borderRadius;

            T totalExtra = BorderWidth.Add(TextPadding);

            m_Bounds.Left   = totalExtra.Negative();
            m_Bounds.Bottom = totalExtra.Negative();
            m_Bounds.Right  = m_ButtonText.Width.Add(totalExtra);
            m_Bounds.Top    = m_ButtonText.Height.Add(totalExtra);
        }
예제 #15
0
        internal override void Render(IRenderData renderData)
        {
            if (IsNotVisible(renderData))
            {
                return;
            }

            renderData.ElementBounds = GetBounds(renderData.ParentBounds);

            if (!IsBackground || renderData.IncludeBackground)
            {
                var pen = new XPen(XColor.FromArgb(BorderColor), BorderWidth.ToXUnit(0));

                if (BackgroundColor != null)
                {
                    var brush = new XSolidBrush(XColor.FromArgb(BackgroundColor.Value));
                    renderData.Graphics.DrawRectangle(pen, brush, renderData.ElementBounds);
                }
                else
                {
                    renderData.Graphics.DrawRectangle(pen, renderData.ElementBounds);
                }
            }
        }
예제 #16
0
        /// <inheritdoc />
        public bool Equals([AllowNull] Annotation other)
        {
            if (other == null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Visible == other.Visible ||
                     Visible != null &&
                     Visible.Equals(other.Visible)
                     ) &&
                 (
                     X == other.X ||
                     X != null &&
                     X.Equals(other.X)
                 ) &&
                 (
                     Y == other.Y ||
                     Y != null &&
                     Y.Equals(other.Y)
                 ) &&
                 (
                     Z == other.Z ||
                     Z != null &&
                     Z.Equals(other.Z)
                 ) &&
                 (
                     Ax == other.Ax ||
                     Ax != null &&
                     Ax.Equals(other.Ax)
                 ) &&
                 (
                     Ay == other.Ay ||
                     Ay != null &&
                     Ay.Equals(other.Ay)
                 ) &&
                 (
                     XAnchor == other.XAnchor ||
                     XAnchor != null &&
                     XAnchor.Equals(other.XAnchor)
                 ) &&
                 (
                     XShift == other.XShift ||
                     XShift != null &&
                     XShift.Equals(other.XShift)
                 ) &&
                 (
                     YAnchor == other.YAnchor ||
                     YAnchor != null &&
                     YAnchor.Equals(other.YAnchor)
                 ) &&
                 (
                     YShift == other.YShift ||
                     YShift != null &&
                     YShift.Equals(other.YShift)
                 ) &&
                 (
                     Text == other.Text ||
                     Text != null &&
                     Text.Equals(other.Text)
                 ) &&
                 (
                     TextAngle == other.TextAngle ||
                     TextAngle != null &&
                     TextAngle.Equals(other.TextAngle)
                 ) &&
                 (
                     Font == other.Font ||
                     Font != null &&
                     Font.Equals(other.Font)
                 ) &&
                 (
                     Width == other.Width ||
                     Width != null &&
                     Width.Equals(other.Width)
                 ) &&
                 (
                     Height == other.Height ||
                     Height != null &&
                     Height.Equals(other.Height)
                 ) &&
                 (
                     Opacity == other.Opacity ||
                     Opacity != null &&
                     Opacity.Equals(other.Opacity)
                 ) &&
                 (
                     Align == other.Align ||
                     Align != null &&
                     Align.Equals(other.Align)
                 ) &&
                 (
                     VAlign == other.VAlign ||
                     VAlign != null &&
                     VAlign.Equals(other.VAlign)
                 ) &&
                 (
                     BgColor == other.BgColor ||
                     BgColor != null &&
                     BgColor.Equals(other.BgColor)
                 ) &&
                 (
                     BorderColor == other.BorderColor ||
                     BorderColor != null &&
                     BorderColor.Equals(other.BorderColor)
                 ) &&
                 (
                     BorderPad == other.BorderPad ||
                     BorderPad != null &&
                     BorderPad.Equals(other.BorderPad)
                 ) &&
                 (
                     BorderWidth == other.BorderWidth ||
                     BorderWidth != null &&
                     BorderWidth.Equals(other.BorderWidth)
                 ) &&
                 (
                     ShowArrow == other.ShowArrow ||
                     ShowArrow != null &&
                     ShowArrow.Equals(other.ShowArrow)
                 ) &&
                 (
                     ArrowColor == other.ArrowColor ||
                     ArrowColor != null &&
                     ArrowColor.Equals(other.ArrowColor)
                 ) &&
                 (
                     Arrowhead == other.Arrowhead ||
                     Arrowhead != null &&
                     Arrowhead.Equals(other.Arrowhead)
                 ) &&
                 (
                     StartArrowhead == other.StartArrowhead ||
                     StartArrowhead != null &&
                     StartArrowhead.Equals(other.StartArrowhead)
                 ) &&
                 (
                     ArrowSide == other.ArrowSide ||
                     ArrowSide != null &&
                     ArrowSide.Equals(other.ArrowSide)
                 ) &&
                 (
                     ArrowSize == other.ArrowSize ||
                     ArrowSize != null &&
                     ArrowSize.Equals(other.ArrowSize)
                 ) &&
                 (
                     StartArrowSize == other.StartArrowSize ||
                     StartArrowSize != null &&
                     StartArrowSize.Equals(other.StartArrowSize)
                 ) &&
                 (
                     ArrowWidth == other.ArrowWidth ||
                     ArrowWidth != null &&
                     ArrowWidth.Equals(other.ArrowWidth)
                 ) &&
                 (
                     Standoff == other.Standoff ||
                     Standoff != null &&
                     Standoff.Equals(other.Standoff)
                 ) &&
                 (
                     StartStandoff == other.StartStandoff ||
                     StartStandoff != null &&
                     StartStandoff.Equals(other.StartStandoff)
                 ) &&
                 (
                     HoverText == other.HoverText ||
                     HoverText != null &&
                     HoverText.Equals(other.HoverText)
                 ) &&
                 (
                     HoverLabel == other.HoverLabel ||
                     HoverLabel != null &&
                     HoverLabel.Equals(other.HoverLabel)
                 ) &&
                 (
                     CaptureEvents == other.CaptureEvents ||
                     CaptureEvents != null &&
                     CaptureEvents.Equals(other.CaptureEvents)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     TemplateItemName == other.TemplateItemName ||
                     TemplateItemName != null &&
                     TemplateItemName.Equals(other.TemplateItemName)
                 ));
        }
예제 #17
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         int hashCode = 41;
         if (Uri != null)
         {
             hashCode = hashCode * 59 + Uri.GetHashCode();
         }
         if (ChartId != null)
         {
             hashCode = hashCode * 59 + ChartId.GetHashCode();
         }
         if (ServiceId != null)
         {
             hashCode = hashCode * 59 + ServiceId.GetHashCode();
         }
         if (ItemId != null)
         {
             hashCode = hashCode * 59 + ItemId.GetHashCode();
         }
         if (BarWidth != null)
         {
             hashCode = hashCode * 59 + BarWidth.GetHashCode();
         }
         if (BorderWidth != null)
         {
             hashCode = hashCode * 59 + BorderWidth.GetHashCode();
         }
         if (Angle != null)
         {
             hashCode = hashCode * 59 + Angle.GetHashCode();
         }
         if (Rotate != null)
         {
             hashCode = hashCode * 59 + Rotate.GetHashCode();
         }
         if (BarAngle != null)
         {
             hashCode = hashCode * 59 + BarAngle.GetHashCode();
         }
         if (LineCap != null)
         {
             hashCode = hashCode * 59 + LineCap.GetHashCode();
         }
         if (ScaleMin != null)
         {
             hashCode = hashCode * 59 + ScaleMin.GetHashCode();
         }
         if (ScaleMax != null)
         {
             hashCode = hashCode * 59 + ScaleMax.GetHashCode();
         }
         if (Title != null)
         {
             hashCode = hashCode * 59 + Title.GetHashCode();
         }
         if (Units != null)
         {
             hashCode = hashCode * 59 + Units.GetHashCode();
         }
         if (Group != null)
         {
             hashCode = hashCode * 59 + Group.GetHashCode();
         }
         if (FloorplanId != null)
         {
             hashCode = hashCode * 59 + FloorplanId.GetHashCode();
         }
         return(hashCode);
     }
 }
예제 #18
0
        /// <summary>
        /// Returns true if DashboardWidgetOptionsBean instances are equal
        /// </summary>
        /// <param name="input">Instance of DashboardWidgetOptionsBean to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(DashboardWidgetOptionsBean input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     Uri == input.Uri ||
                     (Uri != null &&
                      Uri.Equals(input.Uri))
                     ) &&
                 (
                     ChartId == input.ChartId ||
                     (ChartId != null &&
                      ChartId.Equals(input.ChartId))
                 ) &&
                 (
                     ServiceId == input.ServiceId ||
                     (ServiceId != null &&
                      ServiceId.Equals(input.ServiceId))
                 ) &&
                 (
                     ItemId == input.ItemId ||
                     (ItemId != null &&
                      ItemId.Equals(input.ItemId))
                 ) &&
                 (
                     BarWidth == input.BarWidth ||
                     (BarWidth != null &&
                      BarWidth.Equals(input.BarWidth))
                 ) &&
                 (
                     BorderWidth == input.BorderWidth ||
                     (BorderWidth != null &&
                      BorderWidth.Equals(input.BorderWidth))
                 ) &&
                 (
                     Angle == input.Angle ||
                     (Angle != null &&
                      Angle.Equals(input.Angle))
                 ) &&
                 (
                     Rotate == input.Rotate ||
                     (Rotate != null &&
                      Rotate.Equals(input.Rotate))
                 ) &&
                 (
                     BarAngle == input.BarAngle ||
                     (BarAngle != null &&
                      BarAngle.Equals(input.BarAngle))
                 ) &&
                 (
                     LineCap == input.LineCap ||
                     (LineCap != null &&
                      LineCap.Equals(input.LineCap))
                 ) &&
                 (
                     ScaleMin == input.ScaleMin ||
                     (ScaleMin != null &&
                      ScaleMin.Equals(input.ScaleMin))
                 ) &&
                 (
                     ScaleMax == input.ScaleMax ||
                     (ScaleMax != null &&
                      ScaleMax.Equals(input.ScaleMax))
                 ) &&
                 (
                     Title == input.Title ||
                     (Title != null &&
                      Title.Equals(input.Title))
                 ) &&
                 (
                     Units == input.Units ||
                     (Units != null &&
                      Units.Equals(input.Units))
                 ) &&
                 (
                     Group == input.Group ||
                     (Group != null &&
                      Group.Equals(input.Group))
                 ) &&
                 (
                     FloorplanId == input.FloorplanId ||
                     (FloorplanId != null &&
                      FloorplanId.Equals(input.FloorplanId))
                 ));
        }
예제 #19
0
        public bool Equals([AllowNull] Annotation other)
        {
            if (other == null)
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return((Visible == other.Visible && Visible != null && other.Visible != null && Visible.Equals(other.Visible)) &&
                   (Text == other.Text && Text != null && other.Text != null && Text.Equals(other.Text)) &&
                   (TextAngle == other.TextAngle && TextAngle != null && other.TextAngle != null && TextAngle.Equals(other.TextAngle)) &&
                   (Font == other.Font && Font != null && other.Font != null && Font.Equals(other.Font)) &&
                   (Width == other.Width && Width != null && other.Width != null && Width.Equals(other.Width)) &&
                   (Height == other.Height && Height != null && other.Height != null && Height.Equals(other.Height)) &&
                   (Opacity == other.Opacity && Opacity != null && other.Opacity != null && Opacity.Equals(other.Opacity)) &&
                   (Align == other.Align && Align != null && other.Align != null && Align.Equals(other.Align)) &&
                   (VAlign == other.VAlign && VAlign != null && other.VAlign != null && VAlign.Equals(other.VAlign)) &&
                   (BgColor == other.BgColor && BgColor != null && other.BgColor != null && BgColor.Equals(other.BgColor)) &&
                   (BorderColor == other.BorderColor && BorderColor != null && other.BorderColor != null && BorderColor.Equals(other.BorderColor)) &&
                   (BorderPad == other.BorderPad && BorderPad != null && other.BorderPad != null && BorderPad.Equals(other.BorderPad)) &&
                   (BorderWidth == other.BorderWidth && BorderWidth != null && other.BorderWidth != null && BorderWidth.Equals(other.BorderWidth)) &&
                   (ShowArrow == other.ShowArrow && ShowArrow != null && other.ShowArrow != null && ShowArrow.Equals(other.ShowArrow)) &&
                   (ArrowColor == other.ArrowColor && ArrowColor != null && other.ArrowColor != null && ArrowColor.Equals(other.ArrowColor)) &&
                   (Arrowhead == other.Arrowhead && Arrowhead != null && other.Arrowhead != null && Arrowhead.Equals(other.Arrowhead)) &&
                   (StartArrowhead == other.StartArrowhead && StartArrowhead != null && other.StartArrowhead != null && StartArrowhead.Equals(other.StartArrowhead)) &&
                   (ArrowSide == other.ArrowSide && ArrowSide != null && other.ArrowSide != null && ArrowSide.Equals(other.ArrowSide)) &&
                   (ArrowSize == other.ArrowSize && ArrowSize != null && other.ArrowSize != null && ArrowSize.Equals(other.ArrowSize)) &&
                   (StartArrowSize == other.StartArrowSize && StartArrowSize != null && other.StartArrowSize != null && StartArrowSize.Equals(other.StartArrowSize)) &&
                   (ArrowWidth == other.ArrowWidth && ArrowWidth != null && other.ArrowWidth != null && ArrowWidth.Equals(other.ArrowWidth)) &&
                   (Standoff == other.Standoff && Standoff != null && other.Standoff != null && Standoff.Equals(other.Standoff)) &&
                   (StartStandoff == other.StartStandoff && StartStandoff != null && other.StartStandoff != null && StartStandoff.Equals(other.StartStandoff)) &&
                   (Ax == other.Ax && Ax != null && other.Ax != null && Ax.Equals(other.Ax)) &&
                   (Ay == other.Ay && Ay != null && other.Ay != null && Ay.Equals(other.Ay)) &&
                   (AXref == other.AXref && AXref != null && other.AXref != null && AXref.Equals(other.AXref)) &&
                   (AyRef == other.AyRef && AyRef != null && other.AyRef != null && AyRef.Equals(other.AyRef)) &&
                   (XRef == other.XRef && XRef != null && other.XRef != null && XRef.Equals(other.XRef)) &&
                   (X == other.X && X != null && other.X != null && X.Equals(other.X)) &&
                   (XAnchor == other.XAnchor && XAnchor != null && other.XAnchor != null && XAnchor.Equals(other.XAnchor)) &&
                   (XShift == other.XShift && XShift != null && other.XShift != null && XShift.Equals(other.XShift)) &&
                   (YRef == other.YRef && YRef != null && other.YRef != null && YRef.Equals(other.YRef)) &&
                   (Y == other.Y && Y != null && other.Y != null && Y.Equals(other.Y)) &&
                   (YAnchor == other.YAnchor && YAnchor != null && other.YAnchor != null && YAnchor.Equals(other.YAnchor)) &&
                   (YShift == other.YShift && YShift != null && other.YShift != null && YShift.Equals(other.YShift)) &&
                   (ClickToShow == other.ClickToShow && ClickToShow != null && other.ClickToShow != null && ClickToShow.Equals(other.ClickToShow)) &&
                   (XClick == other.XClick && XClick != null && other.XClick != null && XClick.Equals(other.XClick)) &&
                   (YClick == other.YClick && YClick != null && other.YClick != null && YClick.Equals(other.YClick)) &&
                   (HoverText == other.HoverText && HoverText != null && other.HoverText != null && HoverText.Equals(other.HoverText)) &&
                   (HoverLabel == other.HoverLabel && HoverLabel != null && other.HoverLabel != null && HoverLabel.Equals(other.HoverLabel)) &&
                   (CaptureEvents == other.CaptureEvents && CaptureEvents != null && other.CaptureEvents != null && CaptureEvents.Equals(other.CaptureEvents)) &&
                   (Name == other.Name && Name != null && other.Name != null && Name.Equals(other.Name)) &&
                   (TemplateItemName == other.TemplateItemName && TemplateItemName != null && other.TemplateItemName != null && TemplateItemName.Equals(other.TemplateItemName)));
        }
예제 #20
0
        /*********************************************************************************
        *
        * Calendar rendering methods
        *
        *********************************************************************************/

        //Creates the table for the calendar
        private Table CreateTable(DateTime visibleDate, DateTime firstDay, System.Globalization.Calendar threadCalendar)
        {
            Color defaultColor = ForeColor;

            if (defaultColor == Color.Empty)
            {
                defaultColor = Color.Black;
            }
            defaultButtonColorText = ColorTranslator.ToHtml(defaultColor);

            Table table = new Table();

            if (ID != null)
            {
                table.ID = ClientID;
            }
            table.CopyBaseAttributes(this);
            if (ControlStyleCreated)
            {
                table.ApplyStyle(ControlStyle);
            }
            table.Width       = Width;
            table.Height      = Height;
            table.CellPadding = CellPadding;
            table.CellSpacing = CellSpacing;

            // default look
            if ((ControlStyleCreated == false) ||
                BorderWidth.Equals(Unit.Empty))
            {
                table.BorderWidth = Unit.Pixel(1);
            }

            if (ShowGridLines)
            {
                table.GridLines = GridLines.Both;
            }
            else
            {
                table.GridLines = GridLines.None;
            }

            bool useAccessibleHeader = UseAccessibleHeader;

            if (useAccessibleHeader)
            {
                if (table.Attributes["title"] == null)
                {
                    table.Attributes["title"] = string.Empty;
                }
            }

            string caption = Caption;

            if (caption.Length > 0)
            {
                table.Caption      = caption;
                table.CaptionAlign = CaptionAlign;
            }

            if (ShowTitle)
            {
                table.Rows.Add(CreateTitleRow(visibleDate, threadCalendar));
            }

            if (ShowDayHeader)
            {
                table.Rows.Add(CreateDayHeader(firstDay, visibleDate, threadCalendar));
            }

            return(table);
        }
예제 #21
0
        /// <inheritdoc />
        public bool Equals([AllowNull] Legend other)
        {
            if (other == null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     BgColor == other.BgColor ||
                     BgColor != null &&
                     BgColor.Equals(other.BgColor)
                     ) &&
                 (
                     BorderColor == other.BorderColor ||
                     BorderColor != null &&
                     BorderColor.Equals(other.BorderColor)
                 ) &&
                 (
                     BorderWidth == other.BorderWidth ||
                     BorderWidth != null &&
                     BorderWidth.Equals(other.BorderWidth)
                 ) &&
                 (
                     Font == other.Font ||
                     Font != null &&
                     Font.Equals(other.Font)
                 ) &&
                 (
                     Orientation == other.Orientation ||
                     Orientation != null &&
                     Orientation.Equals(other.Orientation)
                 ) &&
                 (
                     TraceOrder == other.TraceOrder ||
                     TraceOrder != null &&
                     TraceOrder.Equals(other.TraceOrder)
                 ) &&
                 (
                     TraceGroupGap == other.TraceGroupGap ||
                     TraceGroupGap != null &&
                     TraceGroupGap.Equals(other.TraceGroupGap)
                 ) &&
                 (
                     ItemSizing == other.ItemSizing ||
                     ItemSizing != null &&
                     ItemSizing.Equals(other.ItemSizing)
                 ) &&
                 (
                     ItemWidth == other.ItemWidth ||
                     ItemWidth != null &&
                     ItemWidth.Equals(other.ItemWidth)
                 ) &&
                 (
                     ItemClick == other.ItemClick ||
                     ItemClick != null &&
                     ItemClick.Equals(other.ItemClick)
                 ) &&
                 (
                     ItemDoubleClick == other.ItemDoubleClick ||
                     ItemDoubleClick != null &&
                     ItemDoubleClick.Equals(other.ItemDoubleClick)
                 ) &&
                 (
                     X == other.X ||
                     X != null &&
                     X.Equals(other.X)
                 ) &&
                 (
                     XAnchor == other.XAnchor ||
                     XAnchor != null &&
                     XAnchor.Equals(other.XAnchor)
                 ) &&
                 (
                     Y == other.Y ||
                     Y != null &&
                     Y.Equals(other.Y)
                 ) &&
                 (
                     YAnchor == other.YAnchor ||
                     YAnchor != null &&
                     YAnchor.Equals(other.YAnchor)
                 ) &&
                 (
                     UiRevision == other.UiRevision ||
                     UiRevision != null &&
                     UiRevision.Equals(other.UiRevision)
                 ) &&
                 (
                     VAlign == other.VAlign ||
                     VAlign != null &&
                     VAlign.Equals(other.VAlign)
                 ) &&
                 (
                     Title == other.Title ||
                     Title != null &&
                     Title.Equals(other.Title)
                 ));
        }
예제 #22
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         if (BgColor != null)
         {
             hashCode = hashCode * 59 + BgColor.GetHashCode();
         }
         if (BorderColor != null)
         {
             hashCode = hashCode * 59 + BorderColor.GetHashCode();
         }
         if (BorderWidth != null)
         {
             hashCode = hashCode * 59 + BorderWidth.GetHashCode();
         }
         if (Font != null)
         {
             hashCode = hashCode * 59 + Font.GetHashCode();
         }
         if (Orientation != null)
         {
             hashCode = hashCode * 59 + Orientation.GetHashCode();
         }
         if (TraceOrder != null)
         {
             hashCode = hashCode * 59 + TraceOrder.GetHashCode();
         }
         if (TraceGroupGap != null)
         {
             hashCode = hashCode * 59 + TraceGroupGap.GetHashCode();
         }
         if (ItemSizing != null)
         {
             hashCode = hashCode * 59 + ItemSizing.GetHashCode();
         }
         if (ItemWidth != null)
         {
             hashCode = hashCode * 59 + ItemWidth.GetHashCode();
         }
         if (ItemClick != null)
         {
             hashCode = hashCode * 59 + ItemClick.GetHashCode();
         }
         if (ItemDoubleClick != null)
         {
             hashCode = hashCode * 59 + ItemDoubleClick.GetHashCode();
         }
         if (X != null)
         {
             hashCode = hashCode * 59 + X.GetHashCode();
         }
         if (XAnchor != null)
         {
             hashCode = hashCode * 59 + XAnchor.GetHashCode();
         }
         if (Y != null)
         {
             hashCode = hashCode * 59 + Y.GetHashCode();
         }
         if (YAnchor != null)
         {
             hashCode = hashCode * 59 + YAnchor.GetHashCode();
         }
         if (UiRevision != null)
         {
             hashCode = hashCode * 59 + UiRevision.GetHashCode();
         }
         if (VAlign != null)
         {
             hashCode = hashCode * 59 + VAlign.GetHashCode();
         }
         if (Title != null)
         {
             hashCode = hashCode * 59 + Title.GetHashCode();
         }
         return(hashCode);
     }
 }
예제 #23
0
파일: Style.cs 프로젝트: saveenr/saveenr
 public Style()
 {
     this.BorderStyle = new BorderStyle();
     this.BorderColor = new BorderColor();
     this.BorderWidth = new BorderWidth();
 }
예제 #24
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         if (Visible != null)
         {
             hashCode = hashCode * 59 + Visible.GetHashCode();
         }
         if (X != null)
         {
             hashCode = hashCode * 59 + X.GetHashCode();
         }
         if (Y != null)
         {
             hashCode = hashCode * 59 + Y.GetHashCode();
         }
         if (Z != null)
         {
             hashCode = hashCode * 59 + Z.GetHashCode();
         }
         if (Ax != null)
         {
             hashCode = hashCode * 59 + Ax.GetHashCode();
         }
         if (Ay != null)
         {
             hashCode = hashCode * 59 + Ay.GetHashCode();
         }
         if (XAnchor != null)
         {
             hashCode = hashCode * 59 + XAnchor.GetHashCode();
         }
         if (XShift != null)
         {
             hashCode = hashCode * 59 + XShift.GetHashCode();
         }
         if (YAnchor != null)
         {
             hashCode = hashCode * 59 + YAnchor.GetHashCode();
         }
         if (YShift != null)
         {
             hashCode = hashCode * 59 + YShift.GetHashCode();
         }
         if (Text != null)
         {
             hashCode = hashCode * 59 + Text.GetHashCode();
         }
         if (TextAngle != null)
         {
             hashCode = hashCode * 59 + TextAngle.GetHashCode();
         }
         if (Font != null)
         {
             hashCode = hashCode * 59 + Font.GetHashCode();
         }
         if (Width != null)
         {
             hashCode = hashCode * 59 + Width.GetHashCode();
         }
         if (Height != null)
         {
             hashCode = hashCode * 59 + Height.GetHashCode();
         }
         if (Opacity != null)
         {
             hashCode = hashCode * 59 + Opacity.GetHashCode();
         }
         if (Align != null)
         {
             hashCode = hashCode * 59 + Align.GetHashCode();
         }
         if (VAlign != null)
         {
             hashCode = hashCode * 59 + VAlign.GetHashCode();
         }
         if (BgColor != null)
         {
             hashCode = hashCode * 59 + BgColor.GetHashCode();
         }
         if (BorderColor != null)
         {
             hashCode = hashCode * 59 + BorderColor.GetHashCode();
         }
         if (BorderPad != null)
         {
             hashCode = hashCode * 59 + BorderPad.GetHashCode();
         }
         if (BorderWidth != null)
         {
             hashCode = hashCode * 59 + BorderWidth.GetHashCode();
         }
         if (ShowArrow != null)
         {
             hashCode = hashCode * 59 + ShowArrow.GetHashCode();
         }
         if (ArrowColor != null)
         {
             hashCode = hashCode * 59 + ArrowColor.GetHashCode();
         }
         if (Arrowhead != null)
         {
             hashCode = hashCode * 59 + Arrowhead.GetHashCode();
         }
         if (StartArrowhead != null)
         {
             hashCode = hashCode * 59 + StartArrowhead.GetHashCode();
         }
         if (ArrowSide != null)
         {
             hashCode = hashCode * 59 + ArrowSide.GetHashCode();
         }
         if (ArrowSize != null)
         {
             hashCode = hashCode * 59 + ArrowSize.GetHashCode();
         }
         if (StartArrowSize != null)
         {
             hashCode = hashCode * 59 + StartArrowSize.GetHashCode();
         }
         if (ArrowWidth != null)
         {
             hashCode = hashCode * 59 + ArrowWidth.GetHashCode();
         }
         if (Standoff != null)
         {
             hashCode = hashCode * 59 + Standoff.GetHashCode();
         }
         if (StartStandoff != null)
         {
             hashCode = hashCode * 59 + StartStandoff.GetHashCode();
         }
         if (HoverText != null)
         {
             hashCode = hashCode * 59 + HoverText.GetHashCode();
         }
         if (HoverLabel != null)
         {
             hashCode = hashCode * 59 + HoverLabel.GetHashCode();
         }
         if (CaptureEvents != null)
         {
             hashCode = hashCode * 59 + CaptureEvents.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (TemplateItemName != null)
         {
             hashCode = hashCode * 59 + TemplateItemName.GetHashCode();
         }
         return(hashCode);
     }
 }
예제 #25
0
        /// <inheritdoc />
        public bool Equals([AllowNull] ColorBar other)
        {
            if (other == null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     ThicknessMode == other.ThicknessMode ||
                     ThicknessMode != null &&
                     ThicknessMode.Equals(other.ThicknessMode)
                     ) &&
                 (
                     Thickness == other.Thickness ||
                     Thickness != null &&
                     Thickness.Equals(other.Thickness)
                 ) &&
                 (
                     LenMode == other.LenMode ||
                     LenMode != null &&
                     LenMode.Equals(other.LenMode)
                 ) &&
                 (
                     Len == other.Len ||
                     Len != null &&
                     Len.Equals(other.Len)
                 ) &&
                 (
                     X == other.X ||
                     X != null &&
                     X.Equals(other.X)
                 ) &&
                 (
                     XAnchor == other.XAnchor ||
                     XAnchor != null &&
                     XAnchor.Equals(other.XAnchor)
                 ) &&
                 (
                     XPad == other.XPad ||
                     XPad != null &&
                     XPad.Equals(other.XPad)
                 ) &&
                 (
                     Y == other.Y ||
                     Y != null &&
                     Y.Equals(other.Y)
                 ) &&
                 (
                     YAnchor == other.YAnchor ||
                     YAnchor != null &&
                     YAnchor.Equals(other.YAnchor)
                 ) &&
                 (
                     YPad == other.YPad ||
                     YPad != null &&
                     YPad.Equals(other.YPad)
                 ) &&
                 (
                     OutlineColor == other.OutlineColor ||
                     OutlineColor != null &&
                     OutlineColor.Equals(other.OutlineColor)
                 ) &&
                 (
                     OutlineWidth == other.OutlineWidth ||
                     OutlineWidth != null &&
                     OutlineWidth.Equals(other.OutlineWidth)
                 ) &&
                 (
                     BorderColor == other.BorderColor ||
                     BorderColor != null &&
                     BorderColor.Equals(other.BorderColor)
                 ) &&
                 (
                     BorderWidth == other.BorderWidth ||
                     BorderWidth != null &&
                     BorderWidth.Equals(other.BorderWidth)
                 ) &&
                 (
                     BgColor == other.BgColor ||
                     BgColor != null &&
                     BgColor.Equals(other.BgColor)
                 ) &&
                 (
                     TickMode == other.TickMode ||
                     TickMode != null &&
                     TickMode.Equals(other.TickMode)
                 ) &&
                 (
                     NTicks == other.NTicks ||
                     NTicks != null &&
                     NTicks.Equals(other.NTicks)
                 ) &&
                 (
                     Tick0 == other.Tick0 ||
                     Tick0 != null &&
                     Tick0.Equals(other.Tick0)
                 ) &&
                 (
                     DTick == other.DTick ||
                     DTick != null &&
                     DTick.Equals(other.DTick)
                 ) &&
                 (
                     Equals(TickVals, other.TickVals) ||
                     TickVals != null && other.TickVals != null &&
                     TickVals.SequenceEqual(other.TickVals)
                 ) &&
                 (
                     Equals(TickText, other.TickText) ||
                     TickText != null && other.TickText != null &&
                     TickText.SequenceEqual(other.TickText)
                 ) &&
                 (
                     Ticks == other.Ticks ||
                     Ticks != null &&
                     Ticks.Equals(other.Ticks)
                 ) &&
                 (
                     TickLen == other.TickLen ||
                     TickLen != null &&
                     TickLen.Equals(other.TickLen)
                 ) &&
                 (
                     TickWidth == other.TickWidth ||
                     TickWidth != null &&
                     TickWidth.Equals(other.TickWidth)
                 ) &&
                 (
                     TickColor == other.TickColor ||
                     TickColor != null &&
                     TickColor.Equals(other.TickColor)
                 ) &&
                 (
                     ShowTickLabels == other.ShowTickLabels ||
                     ShowTickLabels != null &&
                     ShowTickLabels.Equals(other.ShowTickLabels)
                 ) &&
                 (
                     TickFont == other.TickFont ||
                     TickFont != null &&
                     TickFont.Equals(other.TickFont)
                 ) &&
                 (
                     TickAngle == other.TickAngle ||
                     TickAngle != null &&
                     TickAngle.Equals(other.TickAngle)
                 ) &&
                 (
                     TickFormat == other.TickFormat ||
                     TickFormat != null &&
                     TickFormat.Equals(other.TickFormat)
                 ) &&
                 (
                     Equals(TickFormatStops, other.TickFormatStops) ||
                     TickFormatStops != null && other.TickFormatStops != null &&
                     TickFormatStops.SequenceEqual(other.TickFormatStops)
                 ) &&
                 (
                     TickPrefix == other.TickPrefix ||
                     TickPrefix != null &&
                     TickPrefix.Equals(other.TickPrefix)
                 ) &&
                 (
                     ShowTickPrefix == other.ShowTickPrefix ||
                     ShowTickPrefix != null &&
                     ShowTickPrefix.Equals(other.ShowTickPrefix)
                 ) &&
                 (
                     TickSuffix == other.TickSuffix ||
                     TickSuffix != null &&
                     TickSuffix.Equals(other.TickSuffix)
                 ) &&
                 (
                     ShowTickSuffix == other.ShowTickSuffix ||
                     ShowTickSuffix != null &&
                     ShowTickSuffix.Equals(other.ShowTickSuffix)
                 ) &&
                 (
                     SeparateThousands == other.SeparateThousands ||
                     SeparateThousands != null &&
                     SeparateThousands.Equals(other.SeparateThousands)
                 ) &&
                 (
                     ExponentFormat == other.ExponentFormat ||
                     ExponentFormat != null &&
                     ExponentFormat.Equals(other.ExponentFormat)
                 ) &&
                 (
                     MinExponent == other.MinExponent ||
                     MinExponent != null &&
                     MinExponent.Equals(other.MinExponent)
                 ) &&
                 (
                     ShowExponent == other.ShowExponent ||
                     ShowExponent != null &&
                     ShowExponent.Equals(other.ShowExponent)
                 ) &&
                 (
                     Title == other.Title ||
                     Title != null &&
                     Title.Equals(other.Title)
                 ) &&
                 (
                     TickValsSrc == other.TickValsSrc ||
                     TickValsSrc != null &&
                     TickValsSrc.Equals(other.TickValsSrc)
                 ) &&
                 (
                     TickTextSrc == other.TickTextSrc ||
                     TickTextSrc != null &&
                     TickTextSrc.Equals(other.TickTextSrc)
                 ));
        }
예제 #26
0
        protected override void Render(HtmlTextWriter output)
        {
            output.WriteBeginTag("table");
            if (CssClass != string.Empty)
            {
                output.WriteAttribute("class", CssClass);
            }
            if (!cellPadding.IsEmpty)
            {
                output.WriteAttribute("cellPadding", cellPadding.ToString());
            }
            if (!cellSpacing.IsEmpty)
            {
                output.WriteAttribute("cellSpacing", cellSpacing.ToString());
            }
            if (!BorderWidth.IsEmpty)
            {
                output.WriteAttribute("border", BorderWidth.ToString());
            }
            if (!Width.IsEmpty)
            {
                output.WriteAttribute("width", Width.ToString());
            }
            if (!Height.IsEmpty)
            {
                output.WriteAttribute("height", Height.ToString());
            }
            output.Write(HtmlTextWriter.TagRightChar);
            output.WriteFullBeginTag("tr");
            if (r.ImageUrlMedium != string.Empty)
            {
                output.WriteBeginTag("td");
                output.WriteAttribute("valign", "top");
                output.WriteAttribute("rowspan", "2");
                output.Write(HtmlTextWriter.TagRightChar);
                output.WriteBeginTag("img");
                output.WriteAttribute("src", r.ImageUrlMedium);
                output.Write(HtmlTextWriter.SelfClosingTagEnd);
                output.WriteEndTag("td");

                output.WriteBeginTag("td");
                output.WriteAttribute("width", "100%");
                output.Write(HtmlTextWriter.TagRightChar);
            }
            else
            {
                output.WriteBeginTag("td");
                output.WriteAttribute("colspan", "2");
                output.WriteAttribute("width", "100%");
                output.Write(HtmlTextWriter.TagRightChar);
            }

            output.WriteBeginTag("div");
            output.WriteAttribute("class", this.titleCssClass);
            output.Write(HtmlTextWriter.TagRightChar);
            output.Write(r.Title);
            output.WriteEndTag("div");
            output.Write("by ");
            output.Write(r.Authors);
            output.WriteFullBeginTag("hr");

            if (r.AmazonReleaseDate != DateTime.MinValue &&
                r.AmazonReleaseDate != DateTime.Parse("12/30/1899"))
            {
                output.Write("<strong>Released:</strong> ");
                output.Write(r.AmazonReleaseDate.ToString("MMMM d, yyyy"));
            }
            else
            {
                output.Write("<strong>Published:</strong> ");
                output.Write(r.PublishYear);
            }

            if (r.Publisher != string.Empty)
            {
                output.Write("<br>");
                output.Write("<strong>Publisher:</strong> ");
                output.Write(r.Publisher);
            }

            if (r.Isbn != string.Empty)
            {
                output.Write("<br><strong>ISBN:</strong> ");
                output.Write(r.Isbn);
            }
            output.WriteEndTag("td");

//			output.WriteBeginTag("td");
//			output.WriteAttribute("valign", "top");
//			output.Write(HtmlTextWriter.TagRightChar);
//
////			if(r.AmazonListPrice != decimal.Zero)
//				output.Write("<strong>List Price:</strong> {0:c}<br>", r.AmazonListPrice);
////			if(r.AmazonListPrice != decimal.Zero)
//				output.Write("<strong>Amazon Price:</strong> {0:c}<br>", r.AmazonOurPrice);
//			if(r.AmazonAvailability != string.Empty)
//				output.Write("<strong>Availability:</strong> {0:c}", r.AmazonAvailability);
//			output.WriteEndTag("td");

            output.WriteEndTag("tr");

            output.WriteFullBeginTag("tr");
            output.WriteBeginTag("td");
            output.WriteAttribute("colspan", "3");
            output.Write(HtmlTextWriter.TagRightChar);
            if (r.AmazonAsin != string.Empty)
            {
                output.Write(AmazonFunctions.RenderBuyButton(r.AmazonAsin));
            }
            output.WriteEndTag("td");
            output.WriteEndTag("tr");

            output.WriteFullBeginTag("tr");
            output.WriteBeginTag("td");
            output.WriteAttribute("colspan", "3");
            output.Write(HtmlTextWriter.TagRightChar);
            output.WriteBeginTag("a");
            output.WriteAttribute("href", "javascript://");
            output.WriteAttribute("onclick", "divAbstract.style.display='block';divContents.style.display='none';");
            output.Write(HtmlTextWriter.TagRightChar);
            output.Write("Abstract");
            output.WriteEndTag("a");
            output.Write(" | ");
            output.WriteBeginTag("a");
            output.WriteAttribute("href", "javascript://");
            output.WriteAttribute("onclick", "divAbstract.style.display='none';divContents.style.display='block';");
            output.Write(HtmlTextWriter.TagRightChar);
            output.Write("Contents");
            output.WriteEndTag("a");
            output.WriteEndTag("td");
            output.WriteEndTag("tr");

            output.WriteFullBeginTag("tr");
            output.WriteBeginTag("td");
            output.WriteAttribute("colspan", "3");
            output.Write(HtmlTextWriter.TagRightChar);
            output.WriteBeginTag("div");
            output.WriteAttribute("id", "divAbstract");
            output.WriteAttribute("style", "width:100%;");
            output.Write(HtmlTextWriter.TagRightChar);
            output.Write(r.AbstractText);
            output.WriteEndTag("div");
            output.WriteBeginTag("div");
            output.WriteAttribute("id", "divContents");
            output.WriteAttribute("style", "width:100%;display='none';");
            output.Write(HtmlTextWriter.TagRightChar);
            output.Write(r.ContentsText);
            output.WriteEndTag("div");
            output.WriteEndTag("td");
            output.WriteEndTag("tr");

            output.WriteEndTag("table");
        }
예제 #27
0
        internal void CreateStyle(Page Page, string RootCSS)
        {
            if (Page == null)
            {
                throw (new InvalidOperationException("Cannot access the page class"));
            }
            else if (Page.Header == null)
            {
                throw (new InvalidOperationException("Cannot access the page header. Set runat attribute of head tag to server."));
            }


            CustomStyle ul = new CustomStyle();

            ul.Style["margin"]          = "0";
            ul.Style["padding-bottom"]  = RealHeight.ToString();
            ul.Style["padding-left"]    = "0px";
            ul.Style["height"]          = "auto !important";
            ul.Style["list-style-type"] = "none";

            if (BorderStyle != System.Web.UI.WebControls.BorderStyle.NotSet && BorderStyle != System.Web.UI.WebControls.BorderStyle.None)
            {
                ul.Style["border-top"]    = "0 !important";
                ul.Style["border-left"]   = "0 !important";
                ul.Style["border-right"]  = "0 !important";
                ul.Style["border-bottom"] = BorderStyle.ToString().ToLower() + " " + BorderWidth.ToString() + " " + System.Drawing.ColorTranslator.ToHtml(BorderColor);
            }
            Page.Header.StyleSheet.CreateStyleRule(ul, null, RootCSS);

            CustomStyle li = new CustomStyle();

            li.Style["list-style-type"] = "none";
            li.Style["margin"]          = "0";
            li.Style["padding"]         = "0";
            li.Style["display"]         = "inline";
            Page.Header.StyleSheet.CreateStyleRule(li, null, RootCSS + " li");

            CustomStyle liA = new CustomStyle();

            liA.Style["float"]           = "left";
            liA.Style["line-height"]     = "14px";
            liA.Style["padding"]         = "2px 10px 2px 10px;";
            liA.Style["text-decoration"] = "none";
            liA.Style["margin-top"]      = "2px";
            if (TabSeparator.IsEmpty)
            {
                liA.Style["margin-right"] = "2px";
            }
            else
            {
                liA.Style["margin-right"] = TabSeparator.ToString();
            }

            if (!ForeColor.IsEmpty)
            {
                liA.Style["color"] = ForeColor.ToString();
            }
            Page.Header.StyleSheet.CreateStyleRule(liA, null, RootCSS + " a:link, " + RootCSS + " a:visited, " + RootCSS + " span");
            if (!_TabStyle.IsEmpty)
            {
                Page.Header.StyleSheet.CreateStyleRule(_TabStyle, null, RootCSS + " a:link, " + RootCSS + " a:visited, " + RootCSS + " span");
            }


            CustomStyle liAselected = new CustomStyle();

            liAselected.Style["padding"]    = "4px 10px 2px 10px;";
            liAselected.Style["margin-top"] = "0px";

            if (_SelectedTabStyle.BorderStyle == System.Web.UI.WebControls.BorderStyle.NotSet || _SelectedTabStyle.BorderStyle == System.Web.UI.WebControls.BorderStyle.None)
            {
                if (!SelectedTabBackColor.IsEmpty)
                {
                    liAselected.Style["border-bottom"] = "solid 1px " + System.Drawing.ColorTranslator.ToHtml(SelectedTabBackColor);
                }
                else
                {
                    liAselected.Style["border-bottom"] = "solid 1px white";
                }

                /*
                 * .Style("border-bottom") = _SelectedTabStyle.BorderStyle.ToString().ToLower() & " " & _SelectedTabStyle.BorderWidth.ToString() & " " & Drawing.ColorTranslator.ToHtml(_SelectedTabStyle.BorderColor)
                 */
            }
            Page.Header.StyleSheet.CreateStyleRule(liAselected, null, RootCSS + " li.selected a:link, " + RootCSS + " li.selected a:visited, " + RootCSS + " li.selected span");
            if (!_SelectedTabStyle.IsEmpty)
            {
                Page.Header.StyleSheet.CreateStyleRule(_SelectedTabStyle, null, RootCSS + " li.selected a:link, " + RootCSS + " li.selected a:visited, " + RootCSS + " li.selected span");
            }
        }
예제 #28
0
        /// <summary>
        ///     ''' returns css "style=" tag for this control
        ///     ''' based on standard control visual properties
        ///     ''' </summary>
        private string CssStyle()
        {
            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            string strColor;

            {
                var withBlock = sb;
                withBlock.Append(" style='");

                if (BorderWidth.ToString().Length > 0)
                {
                    withBlock.Append("border-width:");
                    withBlock.Append(BorderWidth.ToString());
                    withBlock.Append(";");
                }
                if (BorderStyle != System.Web.UI.WebControls.BorderStyle.NotSet)
                {
                    withBlock.Append("border-style:");
                    withBlock.Append(BorderStyle.ToString());
                    withBlock.Append(";");
                }
                strColor = HtmlColor(BorderColor);
                if (strColor.Length > 0)
                {
                    withBlock.Append("border-color:");
                    withBlock.Append(strColor);
                    withBlock.Append(";");
                }

                strColor = HtmlColor(BackColor);
                if (strColor.Length > 0)
                {
                    withBlock.Append("background-color:" + strColor + ";");
                }

                strColor = HtmlColor(ForeColor);
                if (strColor.Length > 0)
                {
                    withBlock.Append("color:" + strColor + ";");
                }

                if (Font.Bold)
                {
                    withBlock.Append("font-weight:bold;");
                }

                if (Font.Italic)
                {
                    withBlock.Append("font-style:italic;");
                }

                if (Font.Underline)
                {
                    withBlock.Append("text-decoration:underline;");
                }

                if (Font.Strikeout)
                {
                    withBlock.Append("text-decoration:line-through;");
                }

                if (Font.Overline)
                {
                    withBlock.Append("text-decoration:overline;");
                }

                if (Font.Size.ToString().Length > 0)
                {
                    withBlock.Append("font-size:" + Font.Size.ToString() + ";");
                }

                if (Font.Names.Length > 0)
                {
                    withBlock.Append("font-family:");
                    foreach (var strFontFamily in Font.Names)
                    {
                        withBlock.Append(strFontFamily);
                        withBlock.Append(",");
                    }
                    withBlock.Length = withBlock.Length - 1;
                    withBlock.Append(";");
                }

                if (Height.ToString() != "")
                {
                    withBlock.Append("height:" + Height.ToString() + ";");
                }
                if (Width.ToString() != "")
                {
                    withBlock.Append("width:" + Width.ToString() + ";");
                }

                withBlock.Append("'");
            }
            if (sb.ToString() == " style=''")
            {
                return("");
            }
            else
            {
                return(sb.ToString());
            }
        }
예제 #29
0
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("Polyline=[Typ=0x");
            sb.Append(Type.ToString("x2"));
            if (Type >= 0x100)
            {
                sb.Append(Subtype.ToString("x2"));
            }
            sb.Append(" " + Polylinetype.ToString() + " ");
            switch (Polylinetype)
            {
            case PolylineType.Day2:
                sb.Append(colDayColor[0].ToString());
                sb.Append(" " + colDayColor[1].ToString());
                break;

            case PolylineType.Day2_Night2:
                sb.Append(colDayColor[0].ToString());
                sb.Append(" " + colDayColor[1].ToString());
                sb.Append(" " + colNightColor[0].ToString());
                sb.Append(" " + colNightColor[1].ToString());
                break;

            case PolylineType.Day1_Night2:
                sb.Append(colDayColor[0].ToString());
                sb.Append(" " + colNightColor[0].ToString());
                sb.Append(" " + colNightColor[1].ToString());
                break;

            case PolylineType.NoBorder_Day2_Night1:
                sb.Append(colDayColor[0].ToString());
                sb.Append(" " + colDayColor[1].ToString());
                sb.Append(" " + colNightColor[0].ToString());
                break;

            case PolylineType.NoBorder_Day1:
                sb.Append(colDayColor[0].ToString());
                break;

            case PolylineType.NoBorder_Day1_Night1:
                sb.Append(colDayColor[0].ToString());
                sb.Append(" " + colNightColor[0].ToString());
                break;
            }
            if (BitmapHeight > 0)
            {
                sb.Append(" " + XBitmapDay.ToString());
            }
            if (InnerWidth > 0)
            {
                sb.Append(" Width=" + InnerWidth.ToString());
                if (BorderWidth > 0)
                {
                    sb.Append(" Border=" + BorderWidth.ToString());
                }
            }
            if (FontType != Fontdata.Default)
            {
                sb.Append(" Fonttyp=[" + FontType.ToString() + "]");
            }
            if (FontColType != FontColours.No)
            {
                sb.Append(" CustomColours=[");
                switch (FontColType)
                {
                case FontColours.Day:
                    sb.Append("Day=" + colFontColour[0].ToString());
                    break;

                case FontColours.Night:
                    sb.Append("Night=" + colFontColour[1].ToString());
                    break;

                case FontColours.DayAndNight:
                    sb.Append("Day=" + colFontColour[0].ToString());
                    sb.Append(" Night=" + colFontColour[0].ToString());
                    break;
                }
                sb.Append("]");
            }
            if (WithString)
            {
                sb.Append(" " + Text.ToString());
            }
            sb.Append(" ]");
            return(sb.ToString());
        }
예제 #30
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         if (ThicknessMode != null)
         {
             hashCode = hashCode * 59 + ThicknessMode.GetHashCode();
         }
         if (Thickness != null)
         {
             hashCode = hashCode * 59 + Thickness.GetHashCode();
         }
         if (LenMode != null)
         {
             hashCode = hashCode * 59 + LenMode.GetHashCode();
         }
         if (Len != null)
         {
             hashCode = hashCode * 59 + Len.GetHashCode();
         }
         if (X != null)
         {
             hashCode = hashCode * 59 + X.GetHashCode();
         }
         if (XAnchor != null)
         {
             hashCode = hashCode * 59 + XAnchor.GetHashCode();
         }
         if (XPad != null)
         {
             hashCode = hashCode * 59 + XPad.GetHashCode();
         }
         if (Y != null)
         {
             hashCode = hashCode * 59 + Y.GetHashCode();
         }
         if (YAnchor != null)
         {
             hashCode = hashCode * 59 + YAnchor.GetHashCode();
         }
         if (YPad != null)
         {
             hashCode = hashCode * 59 + YPad.GetHashCode();
         }
         if (OutlineColor != null)
         {
             hashCode = hashCode * 59 + OutlineColor.GetHashCode();
         }
         if (OutlineWidth != null)
         {
             hashCode = hashCode * 59 + OutlineWidth.GetHashCode();
         }
         if (BorderColor != null)
         {
             hashCode = hashCode * 59 + BorderColor.GetHashCode();
         }
         if (BorderWidth != null)
         {
             hashCode = hashCode * 59 + BorderWidth.GetHashCode();
         }
         if (BgColor != null)
         {
             hashCode = hashCode * 59 + BgColor.GetHashCode();
         }
         if (TickMode != null)
         {
             hashCode = hashCode * 59 + TickMode.GetHashCode();
         }
         if (NTicks != null)
         {
             hashCode = hashCode * 59 + NTicks.GetHashCode();
         }
         if (Tick0 != null)
         {
             hashCode = hashCode * 59 + Tick0.GetHashCode();
         }
         if (DTick != null)
         {
             hashCode = hashCode * 59 + DTick.GetHashCode();
         }
         if (TickVals != null)
         {
             hashCode = hashCode * 59 + TickVals.GetHashCode();
         }
         if (TickText != null)
         {
             hashCode = hashCode * 59 + TickText.GetHashCode();
         }
         if (Ticks != null)
         {
             hashCode = hashCode * 59 + Ticks.GetHashCode();
         }
         if (TickLen != null)
         {
             hashCode = hashCode * 59 + TickLen.GetHashCode();
         }
         if (TickWidth != null)
         {
             hashCode = hashCode * 59 + TickWidth.GetHashCode();
         }
         if (TickColor != null)
         {
             hashCode = hashCode * 59 + TickColor.GetHashCode();
         }
         if (ShowTickLabels != null)
         {
             hashCode = hashCode * 59 + ShowTickLabels.GetHashCode();
         }
         if (TickFont != null)
         {
             hashCode = hashCode * 59 + TickFont.GetHashCode();
         }
         if (TickAngle != null)
         {
             hashCode = hashCode * 59 + TickAngle.GetHashCode();
         }
         if (TickFormat != null)
         {
             hashCode = hashCode * 59 + TickFormat.GetHashCode();
         }
         if (TickFormatStops != null)
         {
             hashCode = hashCode * 59 + TickFormatStops.GetHashCode();
         }
         if (TickPrefix != null)
         {
             hashCode = hashCode * 59 + TickPrefix.GetHashCode();
         }
         if (ShowTickPrefix != null)
         {
             hashCode = hashCode * 59 + ShowTickPrefix.GetHashCode();
         }
         if (TickSuffix != null)
         {
             hashCode = hashCode * 59 + TickSuffix.GetHashCode();
         }
         if (ShowTickSuffix != null)
         {
             hashCode = hashCode * 59 + ShowTickSuffix.GetHashCode();
         }
         if (SeparateThousands != null)
         {
             hashCode = hashCode * 59 + SeparateThousands.GetHashCode();
         }
         if (ExponentFormat != null)
         {
             hashCode = hashCode * 59 + ExponentFormat.GetHashCode();
         }
         if (MinExponent != null)
         {
             hashCode = hashCode * 59 + MinExponent.GetHashCode();
         }
         if (ShowExponent != null)
         {
             hashCode = hashCode * 59 + ShowExponent.GetHashCode();
         }
         if (Title != null)
         {
             hashCode = hashCode * 59 + Title.GetHashCode();
         }
         if (TickValsSrc != null)
         {
             hashCode = hashCode * 59 + TickValsSrc.GetHashCode();
         }
         if (TickTextSrc != null)
         {
             hashCode = hashCode * 59 + TickTextSrc.GetHashCode();
         }
         return(hashCode);
     }
 }
예제 #31
0
 public Style()
 {
     this.BorderStyle = new BorderStyle();
     this.BorderColor = new BorderColor();
     this.BorderWidth = new BorderWidth();
 }