Ejemplo n.º 1
0
 private void RadDiagram_ShapeDeserialized(object sender, ShapeSerializationRoutedEventArgs e)
 {
     if (e.Shape as RadDiagramShape != null)
     {
         (e.Shape as RadDiagramShape).Geometry = GeometryParser.GetGeometry(e.SerializationInfo["MyGeometry"].ToString());
         (e.Shape as RadDiagramShape).Content = e.SerializationInfo["DataContent"].ToString();
     }
 }
 //void Default_ItemDeserializing(object sender, SerializationEventArgs<IDiagramItem> e)
 //{
 //    if (e.Entity is StateShape)
 //    {
 //        e.SerializationInfo["StateID"] = (e.Entity as StateShape).StateID;
 //        e.SerializationInfo["Title"] = (e.Entity as StateShape).Title;
 //    }
 //}
 void diagram_ShapeSerialized(object sender, ShapeSerializationRoutedEventArgs e)
 {
     if (e.Shape is StateShape)
     {
         e.SerializationInfo["StateID"] = (e.Shape as StateShape).StateID;
         e.SerializationInfo["Title"]   = (e.Shape as StateShape).Title;
     }
 }
Ejemplo n.º 3
0
        private void RadDiagram_ShapeDeserialized(object sender, ShapeSerializationRoutedEventArgs e)
        {
            var shape = e.Shape as RadDiagramShape;

            if (shape != null)
            {
                shape.Geometry = GeometryParser.GetGeometry(e.SerializationInfo["MyGeometry"].ToString());
                shape.Content  = e.SerializationInfo["DataContent"].ToString();
            }
        }
Ejemplo n.º 4
0
        private void Diagram_ShapeSerialized(object sender, ShapeSerializationRoutedEventArgs e)
        {
            if (!(e.Shape is RadDiagramTextShape))
            {
                return;
            }

            e.SerializationInfo["Content"] = null;
            e.SerializationInfo["SVG"]     = Base64Encode((string)e.Shape.Content);
        }
Ejemplo n.º 5
0
        void diagram_ShapeDeserialized(object sender, ShapeSerializationRoutedEventArgs e)
        {
            // load the saved property
            XmlSerializer serializer = new XmlSerializer(typeof(Epizode));

            StringReader sr = new StringReader((e.Shape as RadDiagramShape).Content.ToString());

            (e.Shape as RadDiagramShape).Tag = (Epizode)serializer.Deserialize(sr);

            //(e.Shape as RadDiagramShape).Tag = (e.Shape as RadDiagramShape).Content;
            (e.Shape as RadDiagramShape).Content = ((Epizode)(e.Shape as RadDiagramShape).Tag).EpizodeNumber;
            this.diagram.AllowDelete             = true;
        }
Ejemplo n.º 6
0
        private void Diagram_ShapeDeserialized(object sender, ShapeSerializationRoutedEventArgs e)
        {
            if (!(e.Shape is RadDiagramTextShape))
            {
                return;
            }

            if (e.SerializationInfo["SVG"] != null)
            {
                e.Shape.Content = Base64Decode((string)e.SerializationInfo["SVG"]);
            }

            if (double.IsNaN(e.Shape.Width) && double.IsNaN(e.Shape.Height))
            {
                e.Shape.Width  = 64;
                e.Shape.Height = 64;
            }
        }
		private void DiagramShapeDeserialized(object sender, ShapeSerializationRoutedEventArgs e)
		{
			if (e.Shape as RadDiagramShape != null)
			{
				RadDiagramShape shape = e.Shape as RadDiagramShape;
				var savedGeometry = e.SerializationInfo["MyGeometry"];
				if (savedGeometry != null)
				{
					shape.Geometry = GeometryParser.GetGeometry(savedGeometry.ToString());
					shape.Background = new SolidColorBrush(){Color = Color.FromArgb(255, 0, 192, 255)};
					shape.StrokeThickness = 0;
				}
			}
			this.diagram.ActiveTool = MouseTool.PointerTool;
			this.pointerToolButton.IsChecked = true;
		}
Ejemplo n.º 8
0
        void diagram_ShapeDeserialized(object sender, ShapeSerializationRoutedEventArgs e)
        {
            // load the saved property
            XmlSerializer serializer = new XmlSerializer(typeof(Epizode));

            StringReader sr = new StringReader((e.Shape as RadDiagramShape).Content.ToString());
            (e.Shape as RadDiagramShape).Tag = (Epizode)serializer.Deserialize(sr);

            //(e.Shape as RadDiagramShape).Tag = (e.Shape as RadDiagramShape).Content;
            (e.Shape as RadDiagramShape).Content = ((Epizode)(e.Shape as RadDiagramShape).Tag).EpizodeNumber;
            this.diagram.AllowDelete = true;
        }