private void FromXml(System.Xml.XmlNode node) { ID = new Guid(node.Attributes["Id"].Value); Name = node.Attributes["Name"].Value; referenceFrame = node.Attributes["ReferenceFrame"].Value; color = SavedColor.Load(node.Attributes["Color"].Value); opacity = Convert.ToSingle(node.Attributes["Opacity"].Value); if (node.Attributes["StartTime"] != null) { StartTime = Convert.ToDateTime(node.Attributes["StartTime"].Value); } if (node.Attributes["EndTime"] != null) { EndTime = Convert.ToDateTime(node.Attributes["EndTime"].Value); } if (node.Attributes["FadeSpan"] != null) { FadeSpan = TimeSpan.Parse(node.Attributes["FadeSpan"].Value); } if (node.Attributes["FadeType"] != null) { FadeType = (FadeType)Enum.Parse(typeof(FadeType), node.Attributes["FadeType"].Value); } InitializeFromXml(node); }
internal static TextObject FromXml(System.Xml.XmlNode node) { TextObject newTextObject = new TextObject(); newTextObject.Text = node.InnerText; newTextObject.BorderStyle = TextBorderStyle.None; newTextObject.Bold = Convert.ToBoolean(node.Attributes["Bold"].Value); newTextObject.Italic = Convert.ToBoolean(node.Attributes["Italic"].Value); newTextObject.Underline = Convert.ToBoolean(node.Attributes["Underline"].Value); newTextObject.FontSize = Convert.ToSingle(node.Attributes["FontSize"].Value); newTextObject.FontName = node.Attributes["FontName"].Value; newTextObject.ForegroundColor = SavedColor.Load(node.Attributes["ForgroundColor"].Value); newTextObject.BackgroundColor = SavedColor.Load(node.Attributes["BackgroundColor"].Value); if (node.Attributes["BorderStyle"] != null) { newTextObject.BorderStyle = (TextBorderStyle)(Enum.Parse(typeof(TextBorderStyle), node.Attributes["BorderStyle"].Value)); } return(newTextObject); }
public void LoadInstance(string val) { this.Color = SavedColor.Load(val); }
public virtual void InitializeFromXml(System.Xml.XmlNode node) { Name = node.Attributes["Name"].Value; Parent = node.Attributes["Parent"].Value; ReferenceFrameType = (ReferenceFrameTypes)Enum.Parse(typeof(ReferenceFrameTypes), node.Attributes["ReferenceFrameType"].Value); Reference = (ReferenceFrames)Enum.Parse(typeof(ReferenceFrames), node.Attributes["Reference"].Value); ParentsRoationalBase = Boolean.Parse(node.Attributes["ParentsRoationalBase"].Value); MeanRadius = Double.Parse(node.Attributes["MeanRadius"].Value); Oblateness = Double.Parse(node.Attributes["Oblateness"].Value); Heading = Double.Parse(node.Attributes["Heading"].Value); Pitch = Double.Parse(node.Attributes["Pitch"].Value); Roll = Double.Parse(node.Attributes["Roll"].Value); Scale = Double.Parse(node.Attributes["Scale"].Value); Tilt = Double.Parse(node.Attributes["Tilt"].Value); Translation = Vector3d.Parse(node.Attributes["Translation"].Value); if (ReferenceFrameType == ReferenceFrameTypes.FixedSherical) { Lat = Double.Parse(node.Attributes["Lat"].Value); Lng = Double.Parse(node.Attributes["Lng"].Value); Altitude = Double.Parse(node.Attributes["Altitude"].Value); } RotationalPeriod = Double.Parse(node.Attributes["RotationalPeriod"].Value); ZeroRotationDate = Double.Parse(node.Attributes["ZeroRotationDate"].Value); RepresentativeColor = SavedColor.Load(node.Attributes["RepresentativeColor"].Value); ShowAsPoint = Boolean.Parse(node.Attributes["ShowAsPoint"].Value); if (node.Attributes["StationKeeping"] != null) { StationKeeping = Boolean.Parse(node.Attributes["StationKeeping"].Value); } if (node.Attributes["ShowOrbitPath"] != null) { ShowOrbitPath = Boolean.Parse(node.Attributes["ShowOrbitPath"].Value); } if (ReferenceFrameType == ReferenceFrameTypes.Orbital) { SemiMajorAxis = Double.Parse(node.Attributes["SemiMajorAxis"].Value); SemiMajorAxisUnits = (AltUnits)Enum.Parse(typeof(AltUnits), node.Attributes["SemiMajorAxisScale"].Value); Eccentricity = Double.Parse(node.Attributes["Eccentricity"].Value); Inclination = Double.Parse(node.Attributes["Inclination"].Value); ArgumentOfPeriapsis = Double.Parse(node.Attributes["ArgumentOfPeriapsis"].Value); LongitudeOfAscendingNode = Double.Parse(node.Attributes["LongitudeOfAscendingNode"].Value); MeanAnomolyAtEpoch = Double.Parse(node.Attributes["MeanAnomolyAtEpoch"].Value); MeanDailyMotion = Double.Parse(node.Attributes["MeanDailyMotion"].Value); Epoch = Double.Parse(node.Attributes["Epoch"].Value); } if (ReferenceFrameType == ReferenceFrameTypes.Trajectory) { if (node["Trajectory"] != null) { foreach (XmlNode child in node["Trajectory"]) { Trajectory.Add(new TrajectorySample(child.InnerText)); } } } SystemGenerated = false; }
public override void InitializeFromXml(System.Xml.XmlNode node) { PointOpacity = double.Parse(node.Attributes["PointOpacity"].Value); PointColor = SavedColor.Load(node.Attributes["PointColor"].Value); }