public EditDropContainerWindow(DropContainer drop) { InitializeComponent(); Droppable = drop.DeepCopyWithObjectId() as DropContainer; foreach (ComAction action in drop.Actions) Droppable.Actions.Add(action); RefreshActions(); }
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); }
public IObject DeepCopy() { var newDrop = new DropContainer(_draggedPartnerId) { Height = Height, Width = Width, SlideId = SlideId, Visible = Visible }; return newDrop; }