public void AddObject(VisualObject obj) { var frame = pnKeyFrameContainer.Controls[CurrentSelectedFrame] as conKeyFrame; if (frame != null) { if (string.IsNullOrEmpty(obj.Name)) { obj.Name = obj.GetType().ToString(); } frame.VisualObjects.Add(obj); } }