예제 #1
0
 public EditAreaWindow(Area area)
 {
     InitializeComponent();
     Area = area.DeepCopyWithObjectId() as Area;
     foreach (ComAction action in area.Actions)
         Area.Actions.Add(action);
     RefreshActions();
 }
예제 #2
0
        public IObject DeepCopy()
        {
            var rect = new Rectangle
                {
                    Width = _rect.Width,
                    Height = _rect.Height,
                    Fill = _rect.Fill,
                    Stroke = _rect.Stroke,
                    StrokeThickness = _rect.StrokeThickness,
                    StrokeDashArray = _rect.StrokeDashArray,
                    SnapsToDevicePixels = _rect.SnapsToDevicePixels,
                    Opacity = _rect.Opacity
                };

            var area = new Area();
            area.Children.Clear();
            area.Children.Add(rect);
            area.AddObjectHandlers();

            return area;
        }
예제 #3
0
        private void LoadObjects()
        {
            var objects = entities[OBJECTS];
            var maxObjId = 0;
            foreach (var obj in objects)
            {
                IObject newObject = null;
                var attributes = ConvertXmlAttributes(obj.Attributes());

                switch (obj.Name.ToString())
                {
                    case "image":
                        newObject = new Picture();
                        break;
                    case "video":
                        newObject = new Video(false);
                        break;
                    case "sound":
                        newObject = new Sound(false);
                        break;
                    case "text":
                        newObject = new Text();
                        break;
                    case "flash":
                        newObject = new FlashAnimation();
                        break;
                    case "area":
                        newObject = new Area();
                        break;
                    case "dropContainer":
                        newObject = new DropContainer();
                        break;
                }

                if (newObject == null) return;
                newObject.Load(attributes);
                if (newObject.ObjectId > maxObjId) maxObjId = newObject.ObjectId;
                Practice.GetInstance().GetSlideById(newObject.SlideId).AddObject(newObject);
            }   
            Practice.SetObjectIdCounter(maxObjId + 1);
        }