예제 #1
0
 public IObject DeepCopy()
 {
     var flash = new FlashPlayer
         {
             Source = Flash.Source,
             Width = Width,
             Height = Height
         };
     flash.FlashLoadMovie();
     flash.FlashStop();
     flash.FlashLoop(false);
     var newFlash = new FlashAnimation
         {
             Height = Height,
             Width = Width,
             ObjectName = Utilities.GiveUniqueName(flash.Source),
             ObjectPath = flash.Source.LocalPath,
         };
     newFlash.Children.Clear();
     newFlash.Children.Add(flash);
     return newFlash;
 }
예제 #2
0
        public static FlashAnimation NewFlashAnimation()
        {
            var w = new AddFlashAnimationWindow();
            if (w.ShowDialog() != true) return null;

            var mainWin = DesignerMainWindow.GetInstance();
            var currentMousePosition = mainWin.GetCurrentMousePosition();

            var flash = new FlashAnimation
                {
                    Flash = {Source = w.FlashPlayer.Source},
                    Width = w.FlashPlayer.Width,
                    Height = w.FlashPlayer.Height
                };
            flash.ObjectName = Utilities.GiveUniqueName(flash.Flash.Source);
            flash.ObjectPath = flash.Flash.Source.LocalPath;

            InkCanvas.SetTop(flash, currentMousePosition.Y);
            InkCanvas.SetLeft(flash, currentMousePosition.X);
            SetZIndex(flash, Practice.GetInstance().GetSlideByPosition(mainWin.GetCurrentSlideNr()).SlideObjects.Count);

            flash.Flash.FlashLoadMovie();
            flash.Flash.FlashStop();
            flash.Flash.FlashLoop(false);

            return flash;
        }
예제 #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);
        }