public void Hide() { if (Visibility == Visibility.Collapsed) { return; } Visibility = Visibility.Collapsed; ClearSearch(); HideBox?.Invoke(this, new EventArgs()); }
public void SaveInXML(XmlElement parentNode, CandleChartControl owner) { var node = parentNode.AppendChild(parentNode.OwnerDocument.CreateElement("Comment")); var attrName = node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("Name")); attrName.Value = Name; var attrText = node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("Text")); attrText.Value = Text; var attrColor = node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("Color")); attrColor.Value = color.ToArgb().ToString(); node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("ColorText")).Value = ColorText.ToArgb().ToString(); var attrPivotPrice = node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("PivotPrice")); attrPivotPrice.Value = PivotPrice.ToString(CultureProvider.Common); var attrPivotTime = node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("PivotTime")); attrPivotTime.Value = owner.chart.StockSeries.GetCandleOpenTimeByIndex((int)Math.Round(PivotIndex)).ToString( "ddMMyyyy HHmmss", CultureProvider.Common); var attrArrowLength = node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("ArrowLength")); attrArrowLength.Value = ArrowLength.ToString(); var attrArrowAngle = node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("ArrowAngle")); attrArrowAngle.Value = ArrowAngle.ToString(CultureProvider.Common); var attrHideArrow = node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("HideArrow")); attrHideArrow.Value = HideArrow.ToString(); var attrHideBox = node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("HideBox")); attrHideBox.Value = HideBox.ToString(); node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("DrawFrame")).Value = DrawFrame.ToString(); node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("ColorFill")).Value = ColorFill.ToArgb().ToString(); node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("FillTransparency")).Value = FillTransparency.ToString(); node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("TextCustom")).Value = TextCustom; node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("magic")).Value = Magic.ToString(); }