示例#1
0
 private bool Equals(Bound other)
 {
     return(ContentHeight.Equals(other.ContentHeight) &&
            ContentWidth.Equals(other.ContentWidth) &&
            Height.Equals(other.Height) &&
            Width.Equals(other.Width));
 }
示例#2
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = ContentHeight.GetHashCode();
         hashCode = (hashCode * 397) ^ ContentWidth.GetHashCode();
         hashCode = (hashCode * 397) ^ Height.GetHashCode();
         hashCode = (hashCode * 397) ^ Width.GetHashCode();
         return(hashCode);
     }
 }
示例#3
0
        protected override void WriteXmlAttributes(XmlWriter writer)
        {
            XmlUtils.WriteRequiredAttributeString(writer, "id", _id);              //NON-NLS-1
            XmlUtils.TryWriteAttributeString(writer, "descriprion", _description); //NON-NLS-1
            XmlUtils.TryWriteAttributeString(writer, "type", _type);               //NON-NLS-1

            if (!string.IsNullOrEmpty(Text))
            {
                XmlUtils.WriteRequiredAttributeString(writer, "text", Text);
            }
            if (!string.IsNullOrEmpty(Format))
            {
                XmlUtils.WriteRequiredAttributeString(writer, "format", Format);
            }
            if (!string.IsNullOrEmpty(Alignment))
            {
                XmlUtils.WriteRequiredAttributeString(writer, "alignment", Alignment);
            }
            if (0 > Width)
            {
                XmlUtils.WriteRequiredAttributeString(writer, "width", Width.ToString());
            }
            if (0 > ContentWidth)
            {
                XmlUtils.WriteRequiredAttributeString(writer, "contentWidth", ContentWidth.ToString());
            }
            if (!string.IsNullOrEmpty(Image))
            {
                XmlUtils.WriteRequiredAttributeString(writer, "image", Image);
            }
            if (!ImageOnRight)
            {
                XmlUtils.WriteRequiredAttributeString(writer, "imageOnRight", ImageOnRight.ToString());
            }
            if (!Visible)
            {
                XmlUtils.WriteRequiredAttributeString(writer, "visible", Visible.ToString());
            }
            if (!Sortable)
            {
                XmlUtils.WriteRequiredAttributeString(writer, "sortable", Sortable.ToString());
            }
            if (!Resizable)
            {
                XmlUtils.WriteRequiredAttributeString(writer, "resizable", Resizable.ToString());
            }
            //if (!string.IsNullOrEmpty(DefaultComparerType))
            //    XmlUtils.WriteRequiredAttributeString(writer, "DefaultComparerType", DefaultComparerType);
            //if (!string.IsNullOrEmpty(SortOrder))
            //    XmlUtils.WriteRequiredAttributeString(writer, "SortOrder", SortOrder);
            if (!Editable)
            {
                XmlUtils.WriteRequiredAttributeString(writer, "editable", Editable.ToString());
            }
            if (!Enabled)
            {
                XmlUtils.WriteRequiredAttributeString(writer, "enabled", Enabled.ToString());
            }
            if (!Selectable)
            {
                XmlUtils.WriteRequiredAttributeString(writer, "selectable", Selectable.ToString());
            }
            if (!string.IsNullOrEmpty(ToolTipText))
            {
                XmlUtils.WriteRequiredAttributeString(writer, "toolTipText", ToolTipText);
            }

            base.WriteXmlAttributes(writer);
        }
示例#4
0
        protected override void RenderAttributes(XElement element, FoRenderOptions options)
        {
            if (Src.IsNullOrWhiteSpace())
            {
                throw new PropertyNotSetException(nameof(Src));
            }
            element.Add(new XAttribute("src", Src));

            if (Width.HasValue())
            {
                element.Add(new XAttribute("width", Width));
            }
            if (Height.HasValue())
            {
                element.Add(new XAttribute("height", Height));
            }
            if (ContentWidth.HasValue())
            {
                element.Add(new XAttribute("content-width", ContentWidth));
            }
            if (ContentHeight.HasValue())
            {
                element.Add(new XAttribute("content-height", ContentHeight));
            }
            if (Scaling != FoScaling.Unspecified)
            {
                element.Add(new XAttribute("scaling", ToKebabCase(Scaling)));
            }
            if (ScalingMethod != FoScalingMethod.Unspecified)
            {
                element.Add(new XAttribute("scaling-method", ToKebabCase(ScalingMethod)));
            }

            if (Margin.HasValue())
            {
                element.Add(new XAttribute("margin", Margin));
            }
            if (MarginTop.HasValue())
            {
                element.Add(new XAttribute("margin-top", MarginTop));
            }
            if (MarginRight.HasValue())
            {
                element.Add(new XAttribute("margin-right", MarginRight));
            }
            if (MarginBottom.HasValue())
            {
                element.Add(new XAttribute("margin-bottom", MarginBottom));
            }
            if (MarginLeft.HasValue())
            {
                element.Add(new XAttribute("margin-left", MarginLeft));
            }

            if (Padding.HasValue())
            {
                element.Add(new XAttribute("padding", Padding));
            }
            if (PaddingTop.HasValue())
            {
                element.Add(new XAttribute("padding-top", PaddingTop));
            }
            if (PaddingRight.HasValue())
            {
                element.Add(new XAttribute("padding-right", PaddingRight));
            }
            if (PaddingBottom.HasValue())
            {
                element.Add(new XAttribute("padding-bottom", PaddingBottom));
            }
            if (PaddingLeft.HasValue())
            {
                element.Add(new XAttribute("padding-left", PaddingLeft));
            }

            base.RenderAttributes(element, options);
        }