/// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         int hashCode = 41;
         if (AnnotationLayout != null)
         {
             hashCode = hashCode * 59 + AnnotationLayout.GetHashCode();
         }
         if (TextParameters != null)
         {
             hashCode = hashCode * 59 + TextParameters.GetHashCode();
         }
         if (Title != null)
         {
             hashCode = hashCode * 59 + Title.GetHashCode();
         }
         if (Subject != null)
         {
             hashCode = hashCode * 59 + Subject.GetHashCode();
         }
         hashCode = hashCode * 59 + ShowBorder.GetHashCode();
         if (Color != null)
         {
             hashCode = hashCode * 59 + Color.GetHashCode();
         }
         return(hashCode);
     }
 }
Beispiel #2
0
        public virtual System.Xml.XmlNode ToXml(System.Xml.XmlNode node)
        {
            if (node == null)
            {
                node = node.OwnerDocument.CreateElement("control");
            }
            Helper.XmlHelper.AddAttribute("name", Name, node);
            Helper.XmlHelper.AddAttribute("border-visible", ShowBorder.ToString(), node);
            Helper.XmlHelper.AddRectangleAttribute(Rectangle, node);

            return(node);
        }
        /// <summary>
        /// Chart 설정 또는 변량에 대해 XML로 생성합니다.
        /// </summary>
        /// <param name="writer">xml writer</param>
        public override void GenerateXmlAttributes(System.Xml.XmlWriter writer)
        {
            base.GenerateXmlAttributes(writer);

            if (ShowBorder.HasValue)
            {
                writer.WriteAttributeString(Prefix + "ShowBorder", ShowBorder.GetHashCode().ToString());
            }

            if (BorderColor.HasValue)
            {
                writer.WriteAttributeString(Prefix + "BorderColor", BorderColor.Value.ToHexString());
            }
        }
Beispiel #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BarItem"/> class. 
 /// </summary>
 public BarItem()
 {
     caption = string.Empty;
     enabled = true;
     Height = 0;
     imageIndex = -1;
     MouseDown = false;
     MouseOver = false;
     owner = null;
     selected = false;
     Top = 0;
     tag = null;
     toolTipText = string.Empty;
     appearance = new AppearanceItem();
     appearance.AppearanceChanged += OnAppearanceChanged;
     showBorder = ShowBorder.Inherit;
 }
Beispiel #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BarItem"/> class.
 /// </summary>
 public BarItem()
 {
     caption     = string.Empty;
     enabled     = true;
     Height      = 0;
     imageIndex  = -1;
     MouseDown   = false;
     MouseOver   = false;
     owner       = null;
     selected    = false;
     Top         = 0;
     tag         = null;
     toolTipText = string.Empty;
     appearance  = new AppearanceItem();
     appearance.AppearanceChanged += OnAppearanceChanged;
     showBorder = ShowBorder.Inherit;
 }
        /// <summary>
        /// Returns true if FreeTextAnnotationParameters instances are equal
        /// </summary>
        /// <param name="input">Instance of FreeTextAnnotationParameters to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(FreeTextAnnotationParameters input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     AnnotationLayout == input.AnnotationLayout ||
                     (AnnotationLayout != null &&
                      AnnotationLayout.Equals(input.AnnotationLayout))
                     ) &&
                 (
                     TextParameters == input.TextParameters ||
                     (TextParameters != null &&
                      TextParameters.Equals(input.TextParameters))
                 ) &&
                 (
                     Title == input.Title ||
                     (Title != null &&
                      Title.Equals(input.Title))
                 ) &&
                 (
                     Subject == input.Subject ||
                     (Subject != null &&
                      Subject.Equals(input.Subject))
                 ) &&
                 (
                     ShowBorder == input.ShowBorder ||
                     ShowBorder.Equals(input.ShowBorder)
                 ) &&
                 (
                     Color == input.Color ||
                     (Color != null &&
                      Color.Equals(input.Color))
                 ));
        }
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         int hashCode = 41;
         if (AnnotationLayout != null)
         {
             hashCode = hashCode * 59 + AnnotationLayout.GetHashCode();
         }
         hashCode = hashCode * 59 + LinkType.GetHashCode();
         hashCode = hashCode * 59 + LinkPage.GetHashCode();
         if (LinkUri != null)
         {
             hashCode = hashCode * 59 + LinkUri.GetHashCode();
         }
         hashCode = hashCode * 59 + ShowBorder.GetHashCode();
         if (Color != null)
         {
             hashCode = hashCode * 59 + Color.GetHashCode();
         }
         return(hashCode);
     }
 }
        /// <summary>
        /// Returns true if LinkAnnotationParameters instances are equal
        /// </summary>
        /// <param name="input">Instance of LinkAnnotationParameters to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(LinkAnnotationParameters input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     AnnotationLayout == input.AnnotationLayout ||
                     (AnnotationLayout != null &&
                      AnnotationLayout.Equals(input.AnnotationLayout))
                     ) &&
                 (
                     LinkType == input.LinkType ||
                     LinkType.Equals(input.LinkType)
                 ) &&
                 (
                     LinkPage == input.LinkPage ||
                     LinkPage.Equals(input.LinkPage)
                 ) &&
                 (
                     LinkUri == input.LinkUri ||
                     (LinkUri != null &&
                      LinkUri.Equals(input.LinkUri))
                 ) &&
                 (
                     ShowBorder == input.ShowBorder ||
                     ShowBorder.Equals(input.ShowBorder)
                 ) &&
                 (
                     Color == input.Color ||
                     (Color != null &&
                      Color.Equals(input.Color))
                 ));
        }
    /// <summary>
    /// Initializes the control properties.
    /// </summary>
    protected override void SetupControl()
    {
        if (StopProcessing)
        {
            // Do not process
        }
        else
        {
            // Default height if nothing additional is shown
            int height = heightDefault;

            // If faces and stream are shown
            if (ShowFaces && ShowStream)
            {
                height = heightStreamFaces;
            }
            // If only stream is shown
            else if (ShowStream)
            {
                height = heightStream;
            }
            // If only faces are shown
            else if (ShowFaces)
            {
                height = heightFaces;
            }

            // If stream or faces are shown and header is too
            if (ShowHeader && (ShowFaces || ShowStream))
            {
                height = height + 35;
            }

            if (UseHTML5)
            {
                StringBuilder sb = new StringBuilder();
                sb.Append("<div class=\"fb-like-box\" data-href=\"", HTMLHelper.EncodeForHtmlAttribute(FBPageUrl),
                          "\" data-width=\"", Width, "\" data-height=\"", height, "\" data-header=\"",
                          ShowHeader, "\" data-stream=\"", ShowStream, "\" data-show-faces=\"",
                          ShowFaces, "\" data-colorscheme=\"", ColorScheme, "\" data-force-wall=\"",
                          ForceWall, "\" data-show-border=\"", ShowBorder, "\"");
                sb.Append("></div>");
                string fbApiKey = FacebookConnectHelper.GetFacebookApiKey(SiteContext.CurrentSiteName);
                if (String.IsNullOrEmpty(fbApiKey))
                {
                    ShowError(lblErrorMessage, "socialnetworking.facebook.apikeynotset");
                }
                // Register Facebook javascript SDK
                ScriptHelper.RegisterFacebookJavascriptSDK(Page, LocalizationContext.PreferredCultureCode, fbApiKey);
                ltlLikeBox.Text = sb.ToString();
            }
            else
            {
                // Iframe code
                string src = "http://www.facebook.com/plugins/likebox.php";

                string query = URLHelper.AddUrlParameter(null, "href", FBPageUrl);
                query = URLHelper.AddUrlParameter(query, "header", ShowHeader.ToString());
                query = URLHelper.AddUrlParameter(query, "width", Width.ToString());
                query = URLHelper.AddUrlParameter(query, "show_faces", ShowFaces.ToString());
                query = URLHelper.AddUrlParameter(query, "stream", ShowStream.ToString());
                query = URLHelper.AddUrlParameter(query, "colorscheme", ColorScheme);
                query = URLHelper.AddUrlParameter(query, "height", height.ToString());
                query = URLHelper.AddUrlParameter(query, "force_wall", ForceWall.ToString());
                query = URLHelper.AddUrlParameter(query, "show_border", ShowBorder.ToString());

                src = HTMLHelper.EncodeForHtmlAttribute(URLHelper.AppendQuery(src, query));

                ltlLikeBox.Text  = "<iframe src=\"" + src + "\"";
                ltlLikeBox.Text += " scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:" + Width + "px; height:" + height + "px;\"></iframe>";
            }
        }
    }
Beispiel #10
0
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
            e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;

            if (BackgroundImage == null)
            {
                //渐变背景
                if (BackBrush != null && BackBrush != SystemBrushes.Control)
                {
                    RectangleF rect = new RectangleF(ClientRectangle.Width * fx, ClientRectangle.Height * fy, ClientRectangle.Width * fw, ClientRectangle.Height * fh);
                    if (rect.Width > 0 && rect.Height > 0)
                    {
                        e.Graphics.FillRectangle(new LinearGradientBrush(rect, BackBrush.LinearColors[0], BackBrush.LinearColors[1], BackAngle), ClientRectangle);
                    }
                }
            }

            if (ShowHeaderBackground)
            {
                e.Graphics.FillRectangle(new SolidBrush(HeaderBackground), new Rectangle(0, 0, Width, 26));
            }

            //标题头
            if (ShowHeader)
            {
                Point titlePoint = new Point(10, 3);
                titlePoint.X = ShowIcon ? 35 : 5;
                if (ShowIcon)
                {
                    ImageAttributes imgAtt = new ImageAttributes();
                    imgAtt.SetWrapMode(WrapMode.TileFlipXY);
                    using (var image = Icon.ToBitmap())
                    {
                        var rec = new Rectangle(borderWidth + 10, titlePoint.Y, 20, 20);
                        e.Graphics.DrawImage(image, rec, 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, imgAtt);
                    }
                }
                TextRenderer.DrawText(e.Graphics, Text, MetroFonts.Subtitle, titlePoint, HeaderForeColor);
            }

            //ControlPaint.DrawSizeGrip(e.Graphics, Color.Black, ClientRectangle.Width - 20, ClientRectangle.Height - 20, 19, 19);
            if (Resizable && SizeGripStyle == SizeGripStyle.Show)
            {
                using (SolidBrush b = new SolidBrush(Color.Black))
                {
                    Size resizeHandleSize = new Size(2, 2);
                    e.Graphics.FillRectangles(b, new Rectangle[] {
                        new Rectangle(new Point(ClientRectangle.Width - 6, ClientRectangle.Height - 6), resizeHandleSize),
                        new Rectangle(new Point(ClientRectangle.Width - 10, ClientRectangle.Height - 10), resizeHandleSize),
                        new Rectangle(new Point(ClientRectangle.Width - 10, ClientRectangle.Height - 6), resizeHandleSize),
                        new Rectangle(new Point(ClientRectangle.Width - 6, ClientRectangle.Height - 10), resizeHandleSize),
                        new Rectangle(new Point(ClientRectangle.Width - 14, ClientRectangle.Height - 6), resizeHandleSize),
                        new Rectangle(new Point(ClientRectangle.Width - 6, ClientRectangle.Height - 14), resizeHandleSize)
                    });
                }
            }

            //功能按钮
            if (DesignMode && ControlBox)
            {
                if (MinimizeBox)
                {
                    if (MaximizeBox)
                    {
                        TextRenderer.DrawText(e.Graphics, "0", new Font("Webdings", 9.25f), new Rectangle(ClientRectangle.Width - 91, 1, 30, 25),
                                              ControlBoxForeColor, ControlBoxBackColor, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter);
                    }
                    else
                    {
                        TextRenderer.DrawText(e.Graphics, "0", new Font("Webdings", 9.25f), new Rectangle(ClientRectangle.Width - 61, 1, 30, 25),
                                              ControlBoxForeColor, ControlBoxBackColor, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter);
                    }
                }
                if (MaximizeBox)
                {
                    TextRenderer.DrawText(e.Graphics, "1", new Font("Webdings", 9.25f), new Rectangle(ClientRectangle.Width - 61, 1, 30, 25),
                                          ControlBoxForeColor, ControlBoxBackColor, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter);
                }
                TextRenderer.DrawText(e.Graphics, "r", new Font("Webdings", 9.25f), new Rectangle(ClientRectangle.Width - 31, 1, 30, 25),
                                      ControlBoxForeColor, ControlBoxBackColor, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter);
            }
            //边框
            ButtonBorderStyle leftBorder   = ShowBorder.HasFlag(BorderState.Left) ? ButtonBorderStyle.Solid : ButtonBorderStyle.None;
            ButtonBorderStyle topBorder    = ShowBorder.HasFlag(BorderState.Top) ? ButtonBorderStyle.Solid : ButtonBorderStyle.None;
            ButtonBorderStyle rightBorder  = ShowBorder.HasFlag(BorderState.Right) ? ButtonBorderStyle.Solid : ButtonBorderStyle.None;
            ButtonBorderStyle bottomBorder = ShowBorder.HasFlag(BorderState.Bottom) ? ButtonBorderStyle.Solid : ButtonBorderStyle.None;

            ControlPaint.DrawBorder(e.Graphics, ClientRectangle, BorderColor, 1, leftBorder, BorderColor, 1, topBorder,
                                    BorderColor, 1, rightBorder, BorderColor, 1, bottomBorder);

            e.Graphics.DrawArc(new Pen(BorderColor), 0, 0, 3, 3, 180, 90);
            e.Graphics.DrawArc(new Pen(BorderColor), ClientRectangle.Width - 3, 0, 3, 3, 270, 90);
            e.Graphics.DrawArc(new Pen(BorderColor), ClientRectangle.Width - 3, ClientRectangle.Height - 3, 3, 3, 0, 90);
            e.Graphics.DrawArc(new Pen(BorderColor), 0, ClientRectangle.Height - 3, 3, 3, 90, 90);
        }
Beispiel #11
0
        /// <summary>
        /// 속성들을 Xml Attribute로 생성합니다.
        /// </summary>
        /// <param name="writer">Attribute를 쓸 Writer</param>
        public override void GenerateXmlAttributes(XmlWriter writer)
        {
            base.GenerateXmlAttributes(writer);

            if (StartValue.HasValue)
            {
                writer.WriteAttributeString("StartValue", StartValue.ToString());
            }
            if (EndValue.HasValue)
            {
                writer.WriteAttributeString("EndValue", EndValue.ToString());
            }
            if (DisplayValue.IsNotWhiteSpace())
            {
                writer.WriteAttributeString("DisplayValue", DisplayValue);
            }
            if (ValueInside.HasValue)
            {
                writer.WriteAttributeString("ValueInside", ValueInside.GetHashCode().ToString());
            }

            if (Color.HasValue)
            {
                writer.WriteAttributeString("Color", Color.Value.ToHexString());
            }
            if (Thickness.HasValue)
            {
                writer.WriteAttributeString("Thickness", Thickness.ToString());
            }

            if (ShowBorder.HasValue)
            {
                writer.WriteAttributeString("ShowBorder", ShowBorder.GetHashCode().ToString());
            }
            if (BorderColor.HasValue)
            {
                writer.WriteAttributeString("BorderColor", BorderColor.Value.ToHexString());
            }

            if (Radius.HasValue)
            {
                writer.WriteAttributeString("Radius", Radius.ToString());
            }
            if (InnerRadius.HasValue)
            {
                writer.WriteAttributeString("InnerRadius", InnerRadius.ToString());
            }

            if (Dashed.HasValue)
            {
                writer.WriteAttributeString("Dashed", Dashed.GetHashCode().ToString());
            }
            if (DashLen.HasValue)
            {
                writer.WriteAttributeString("DashLen", DashLen.ToString());
            }
            if (DashGap.HasValue)
            {
                writer.WriteAttributeString("DashGap", DashGap.ToString());
            }

            if (UseMarker.HasValue)
            {
                writer.WriteAttributeString("UseMarker", UseMarker.GetHashCode().ToString());
            }
            if (MarkerColor.HasValue)
            {
                writer.WriteAttributeString("MarkerColor", MarkerColor.Value.ToHexString());
            }
            if (MarkerBorderColor.HasValue)
            {
                writer.WriteAttributeString("MarkerBorderColor", MarkerBorderColor.Value.ToHexString());
            }
            if (MarkerRadius.HasValue)
            {
                writer.WriteAttributeString("MarkerRadius", MarkerRadius.ToString());
            }
            if (MarkerTooltext.IsNotWhiteSpace())
            {
                writer.WriteAttributeString("MarkerTooltext", MarkerTooltext);
            }
        }
Beispiel #12
0
        internal Rectangle BorderRectangle(ShowBorder value)
        {
            if (value == ShowBorder.ShowXBorder)
                return new Rectangle(recXaxis.X - innerMargin / 2,
                                     recXaxis.Y - innerMargin / 2,
                                     recXaxis.Width + innerMargin,
                                     recXaxis.Height + innerMargin);

            else if (value == ShowBorder.ShowYBorder)
                return new Rectangle(recYaxis.X - innerMargin / 2,
                                     recYaxis.Y - innerMargin / 2,
                                     recYaxis.Width + innerMargin,
                                     recYaxis.Height + innerMargin);

            else if (value == ShowBorder.ShowGridBorder)
                return new Rectangle(recGrids.X - innerMargin / 2,
                                     recGrids.Y - innerMargin / 2,
                                     recGrids.Width + innerMargin,
                                     recGrids.Height + innerMargin);
            else
                return new Rectangle(0, 0, 1, 1);
        }
Beispiel #13
0
        //draw current border with border Line Color
        private void DrawBorderOf(ShowBorder value)
        {
            Point[] ps = new Point[5];

            if (value == ShowBorder.ShowXBorder)
                DrawXBorder(plotGraphics, ps, pltBorder.lineColor);

            else if (value == ShowBorder.ShowYBorder)
                DrawYBorder(plotGraphics, ps, pltBorder.lineColor);

            else if (value == ShowBorder.ShowGridBorder)
                DrawGridBorder(plotGraphics, ps, pltBorder.lineColor);
        }
Beispiel #14
0
        internal void DrawBorder(ShowBorder value)
        {
            if (pltBorder.showBorder != value) 
            {
                EraiseBorder();

                DrawBorderOf(value);

                pltBorder.showBorder = value;
            }
        }
Beispiel #15
0
 internal PlotBorder() {
     lineColor = Color.Blue;
     lineWidth = 1;
     showBorder = ShowBorder.ShowNone;    
 }