protected Image(SerializationInfo info, StreamingContext context) { SuspendEvents = true; Location = Serialization.Serialize.GetPointF(info.GetString("Location")); InterpolationMode = (InterpolationMode)Enum.Parse(typeof(InterpolationMode), info.GetString("InterpolationMode")); if (Serialize.Contains(info, "Path")) { mPath = info.GetString("Path"); } if (Serialize.Contains(info, "Resource")) { mResource = info.GetString("Resource"); } if (Serialize.Contains(info, "Assembly")) { mAssembly = info.GetString("Assembly"); } //Load image if (mPath != null) { SetImage(Component.Instance.GetBitmap(mPath)); } if (mResource != null) { SetImage(Component.Instance.GetResource(mResource, mAssembly)); } SuspendEvents = false; }
protected TableItem(SerializationInfo info, StreamingContext context) { SuspendEvents = true; Text = info.GetString("Text"); Forecolor = Color.FromArgb(Convert.ToInt32(info.GetString("Forecolor"))); Backcolor = Color.FromArgb(Convert.ToInt32(info.GetString("Backcolor"))); SetIndent(info.GetSingle("Indent")); if (Serialize.Contains(info, "Font")) { SetFont(Serialize.GetFont(info.GetString("Font"))); } if (Serialize.Contains(info, "Tag")) { Tag = info.GetValue("Tag", typeof(object)); } if (Serialize.Contains(info, "Parent", typeof(TableItem))) { SetParent((TableItem)info.GetValue("Parent", typeof(TableItem))); } if (Serialize.Contains(info, "Table", typeof(Table))) { SetTable((Table)info.GetValue("Table", typeof(Table))); } SuspendEvents = false; }
//Creates a new element from the supplied XML. protected internal Element(SerializationInfo info, StreamingContext context) { mCursor = null; SuspendEvents = true; SetPath(Serialize.GetPath(info.GetString("Path"))); mKey = info.GetString("Key"); mLayerKey = string.Empty; BorderColor = Color.FromArgb(Convert.ToInt32(info.GetString("BorderColor"))); BorderStyle = (DashStyle)Enum.Parse(typeof(DashStyle), info.GetString("BorderStyle")); BorderWidth = info.GetSingle("BorderWidth"); DrawShadow = info.GetBoolean("DrawShadow"); SmoothingMode = (SmoothingMode)Enum.Parse(typeof(SmoothingMode), info.GetString("SmoothingMode")); Opacity = info.GetByte("Opacity"); Tooltip = info.GetString("Tooltip"); Visible = info.GetBoolean("Visible"); mZOrder = info.GetInt32("ZOrder"); if (Serialize.Contains(info, "Tag")) { Tag = info.GetValue("Tag", typeof(object)); } SuspendEvents = false; }
//Deserializes info into a new solid element protected SolidElement(SerializationInfo info, StreamingContext context) : base(info, context) { SuspendEvents = true; BackColor = Color.FromArgb(Convert.ToInt32(info.GetString("BackColor"))); Clip = info.GetBoolean("Clip"); GradientMode = (LinearGradientMode)Enum.Parse(typeof(LinearGradientMode), info.GetString("GradientMode"), true); GradientColor = Color.FromArgb(Convert.ToInt32(info.GetString("GradientColor"))); DrawGradient = info.GetBoolean("DrawGradient"); DrawBorder = info.GetBoolean("DrawBorder"); DrawBackground = info.GetBoolean("DrawBackground"); Location = Serialize.GetPointF(info.GetString("Location")); SetInternalRectangle(Serialize.GetRectangleF(info.GetString("InternalRectangle"))); if (Serialize.Contains(info, "Rotation")) { Rotation = info.GetSingle("Rotation"); } if (Serialize.Contains(info, "Label", typeof(TextLabel))) { Label = (TextLabel)info.GetValue("Label", typeof(TextLabel)); } if (Serialize.Contains(info, "Image", typeof(Image))) { Image = (Image)info.GetValue("Image", typeof(Image)); } if (Serialize.Contains(info, "StencilItem", typeof(StencilItem))) { mStencilItem = (StencilItem)info.GetValue("StencilItem", typeof(StencilItem)); } SuspendEvents = false; }
//Deserializes info into a new solid element protected Shape(SerializationInfo info, StreamingContext context) : base(info, context) { Ports = new Elements(typeof(Port), "Port"); SuspendEvents = true; AllowMove = info.GetBoolean("AllowMove"); AllowScale = info.GetBoolean("AllowScale"); if (Serialize.Contains(info, "AllowRotate")) { AllowRotate = info.GetBoolean("AllowRotate"); } DrawSelected = info.GetBoolean("DrawSelected"); Selected = info.GetBoolean("Selected"); KeepAspect = info.GetBoolean("KeepAspect"); MinimumSize = Serialize.GetSizeF(info.GetString("MinimumSize")); MaximumSize = Serialize.GetSizeF(info.GetString("MaximumSize")); Direction = (Direction)Enum.Parse(typeof(Direction), info.GetString("Dock"), true); Interaction = (UserInteraction)Enum.Parse(typeof(UserInteraction), info.GetString("Interaction"), true); if (Serialize.Contains(info, "Ports", typeof(Elements))) { Ports = (Elements)info.GetValue("Ports", typeof(Elements)); } if (Serialize.Contains(info, "Animation", typeof(Animation))) { Animation = (Animation)info.GetValue("Animation", typeof(Animation)); } SuspendEvents = false; }
//Deserializes info into a new Line protected Line(SerializationInfo info, StreamingContext context) : base(info, context) { Ports = new Elements(typeof(Port), "Port"); SuspendEvents = true; AllowMove = info.GetBoolean("AllowMove"); DrawSelected = info.GetBoolean("DrawSelected"); Selected = info.GetBoolean("Selected"); LineJoin = (LineJoin)Enum.Parse(typeof(LineJoin), info.GetString("LineJoin"), true); Interaction = (UserInteraction)Enum.Parse(typeof(UserInteraction), info.GetString("Interaction"), true); Start = (Origin)info.GetValue("Start", typeof(Origin)); End = (Origin)info.GetValue("End", typeof(Origin)); if (Serialize.Contains(info, "Ports", typeof(Elements))) { Ports = (Elements)info.GetValue("Ports", typeof(Elements)); } if (Serialize.Contains(info, "Animation", typeof(Animation))) { Animation = (Animation)info.GetValue("Animation", typeof(Animation)); } SuspendEvents = false; }
protected ComplexLine(SerializationInfo info, StreamingContext context) : base(info, context) { SuspendEvents = true; mSegments = (Segments)info.GetValue("Segments", typeof(Segments)); if (Serialize.Contains(info, "AllowExpand")) { mAllowExpand = info.GetBoolean("AllowExpand"); } SuspendEvents = false; }
//Deserializes info into a new solid element protected TextLabel(SerializationInfo info, StreamingContext context) : base(info, context) { SuspendEvents = true; Size = Serialization.Serialize.GetSizeF(info.GetString("Size")); if (Serialize.Contains(info, "StringFormat")) { SetFormat(Serialize.GetStringFormat(info.GetString("StringFormat"))); } SuspendEvents = false; }
protected TableGroup(SerializationInfo info, StreamingContext context) : base(info, context) { SuspendEvents = true; Expanded = info.GetBoolean("Expanded"); Rows = (TableItems)info.GetValue("Rows", typeof(TableItems)); if (Serialize.Contains(info, "Groups", typeof(TableItems))) { Groups = (TableItems)info.GetValue("Groups", typeof(TableItems)); } SuspendEvents = false; }
protected Link(SerializationInfo info, StreamingContext context) : base(info, context) { SuspendEvents = true; if (Serialize.Contains(info, "Label", typeof(Label))) { Label = (Label)info.GetValue("Label", typeof(Label)); } if (Serialize.Contains(info, "Image", typeof(Image))) { Image = (Image)info.GetValue("Image", typeof(Image)); } SuspendEvents = false; }
//Deserializes info into a new origin protected Origin(SerializationInfo info, StreamingContext context) { Location = Serialize.GetPointF(info.GetString("Location")); Marker = (MarkerBase)info.GetValue("Marker", typeof(MarkerBase)); AllowMove = info.GetBoolean("AllowMove"); if (Serialize.Contains(info, "Shape", typeof(Shape))) { Shape = (Shape)info.GetValue("Shape", typeof(Shape)); } if (Serialize.Contains(info, "Port", typeof(Port))) { Port = (Port)info.GetValue("Port", typeof(Port)); } }
//Deserializes info into a new Line protected Segment(SerializationInfo info, StreamingContext context) { SuspendEvents = true; SetStart((Origin)info.GetValue("Start", typeof(Origin))); SetEnd((Origin)info.GetValue("End", typeof(Origin))); if (Serialize.Contains(info, "Label", typeof(TextLabel))) { Label = (TextLabel)info.GetValue("Label", typeof(TextLabel)); } if (Serialize.Contains(info, "Image", typeof(Image))) { Image = (Image)info.GetValue("Image", typeof(Image)); } SuspendEvents = false; }
//Creates a new element from the supplied XML. protected Label(SerializationInfo info, StreamingContext context) { SuspendEvents = true; Text = info.GetString("Text"); Offset = Serialization.Serialize.GetPointF(info.GetString("Offset")); Opacity = info.GetByte("Opacity"); Color = Color.FromArgb(Convert.ToInt32(info.GetString("Color"))); Visible = info.GetBoolean("Visible"); //Only set if exists eg is not default if (Serialize.Contains(info, "Font")) { SetFont(Serialize.GetFont(info.GetString("Font"))); } SuspendEvents = false; }
protected Connector(SerializationInfo info, StreamingContext context) : base(info, context) { SuspendEvents = true; Avoid = info.GetBoolean("Avoid"); Rounded = info.GetBoolean("Rounded"); Padding = (SizeF)Serialize.GetSizeF(info.GetString("Padding")); SetPoints(Serialize.GetPointFArrayList(info.GetString("Points"))); if (Serialize.Contains(info, "Label", typeof(TextLabel))) { Label = (TextLabel)info.GetValue("Label", typeof(TextLabel)); } if (Serialize.Contains(info, "Image", typeof(Image))) { Image = (Image)info.GetValue("Image", typeof(Image)); } if (Serialize.Contains(info, "Jump")) { Jump = info.GetBoolean("Jump"); } SuspendEvents = false; }