public void SaveInXML(XmlElement parentNode, CandleChartControl owner) { var node = parentNode.AppendChild(parentNode.OwnerDocument.CreateElement("Asterisk")); node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("Name")).Value = Name; node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("Text")).Value = Text; node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("Sign")).Value = Sign; node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("magic")).Value = Magic.ToString(); node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("ColorLine")).Value = ColorLine.ToArgb().ToString(); node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("ColorFill")).Value = ColorFill.ToArgb().ToString(); node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("ColorText")).Value = ColorText.ToArgb().ToString(); node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("Price")).Value = Price.ToString(CultureProvider.Common); if (DateStart.HasValue) { node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("PivotTime")).Value = DateStart.Value.ToString("ddMMyyyy HHmmss", CultureProvider.Common); } node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("Shape")).Value = Shape.ToString(); node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("Transparency")).Value = Transparency.ToString(); node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("TransparencyText")).Value = TransparencyText.ToString(); node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("Radius")).Value = Radius.ToString(); node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("magic")).Value = Magic.ToString(); }
public override string GetJsonString() { return("{objectId:" + GetObjectIdForJSON() + ",start:" + Start + ",length:" + Length + ",repeat:" + Repetitions + ",state:" + InitialState + ",name:'" + Type + "',c7:0,additionalData:" + RotationDegrees + ",additionalData2:" + RotationDegrees + ",scaleX:" + ScaleX + ",scaleY:" + ScaleY + ",color:" + RGBColor + ",transparency:" + Transparency.ToString("0.##", System.Globalization.CultureInfo.GetCultureInfo("en-US").NumberFormat) + ",v:0,e0:" + GetE0Value() + ",e1:" + e1 + ",e2:" + e2 + GetE3Value() + "}"); }
protected void WriteXmlBaseImpl(XmlWriter writer) { if (Fill != null) { writer.WriteAttributeString(nameof(Fill), ColorTranslator.ToHtml((Color)Fill)); } if (Stroke != null) { writer.WriteAttributeString(nameof(Stroke), ColorTranslator.ToHtml((Color)Stroke)); } writer.WriteAttributeString(nameof(Transparency), Transparency.ToString()); writer.WriteAttributeString(nameof(LayerName), LayerName); }
public override void Render(StringBuilder sb) { if (string.IsNullOrWhiteSpace(DEF) && string.IsNullOrWhiteSpace(USE) && DiffuseColor != null) { DEF = "Mat" + Guid.NewGuid().ToString(); } AddProperty("DEF", DEF); AddProperty("USE", USE); AddProperty("diffuseColor", Vector3.ToString(DiffuseColor)); AddProperty("emissiveColor", Vector3.ToString(EmissiveColor)); AddProperty("specularColor", Vector3.ToString(SpecularColor)); AddProperty("textureScale", Vector2.ToString(TextureScale)); AddProperty("transparency", Transparency == null ? null : Transparency.ToString()); AddProperty("ambientIntensity", AmbientIntensity == null ? null : AmbientIntensity.ToString()); AddProperty("shininess", Shininess == null ? null : Shininess.ToString()); AddProperty("occluded", Occluded.ToSlamString()); base.Render(sb); }
public override string ToString() { if (!IsTransparent) { return(string.Concat(new string[] { "rgb(", Red.ToString(), ", ", Green.ToString(), ", ", Blue.ToString(), ")", (Transparency != 0u) ? ("+t" + Transparency.ToString()) : "" })); } return("transparent"); }
public override string ToString() { return ($"[{nameof(Color)}: {Color.ToString()}, {nameof(Specular)}: {Specular.ToString()}, {nameof(Transparency)}: {Transparency.ToString()}, {nameof(Reflective)}: {Reflective.ToString()}]"); }
public override void WriteTo(ArcXmlWriter writer) { try { writer.WriteStartElement(XmlName); if (Angle > 0) { writer.WriteAttributeString("angle", Angle.ToString()); } if (Antialiasing) { writer.WriteAttributeString("antialiasing", "true"); } if (!BlockOut.IsEmpty) { writer.WriteAttributeString("blockout", ColorConverter.ToArcXml(BlockOut)); } if (!String.IsNullOrEmpty(Font) && String.Compare(Font, "Arial", true) != 0) { writer.WriteAttributeString("font", Font); } if (!FontColor.IsEmpty && FontColor != Color.Black) { writer.WriteAttributeString("fontcolor", ColorConverter.ToArcXml(FontColor)); } if (FontSize != 12) { writer.WriteAttributeString("fontsize", FontSize.ToString()); } if (FontStyle != FontStyle.Regular) { writer.WriteAttributeString("fontstyle", ArcXmlEnumConverter.ToArcXml(typeof(FontStyle), FontStyle)); } if (!Glowing.IsEmpty) { writer.WriteAttributeString("glowing", ColorConverter.ToArcXml(Glowing)); } if (HAlignment != HorizontalAlignment.Right) { writer.WriteAttributeString("halignment", ArcXmlEnumConverter.ToArcXml(typeof(HorizontalAlignment), HAlignment)); } if (Interval > 0) { writer.WriteAttributeString("interval", Interval.ToString()); } if (!Outline.IsEmpty) { writer.WriteAttributeString("outline", ColorConverter.ToArcXml(Outline)); } if (!Overlap) { writer.WriteAttributeString("overlap", "false"); } if (PrintMode != PrintMode.None) { writer.WriteAttributeString("printmode", ArcXmlEnumConverter.ToArcXml(typeof(PrintMode), PrintMode)); } if (0 <= Transparency && Transparency < 1) { writer.WriteAttributeString("transparency", Transparency.ToString("0.000")); } if (VAlignment != VerticalAlignment.Top) { writer.WriteAttributeString("valignment", ArcXmlEnumConverter.ToArcXml(typeof(VerticalAlignment), VAlignment)); } writer.WriteEndElement(); } catch (Exception ex) { if (ex is ArcXmlException) { throw ex; } else { throw new ArcXmlException(String.Format("Could not write {0} object.", GetType().Name), ex); } } }