Esempio n. 1
0
        /// <summary>
        /// Creates a new video and adds it as a touch managed object to the MTElementDictionary withing the framework.
        /// Randomly positions and rotates the photo within the screen area.
        /// </summary>
        /// <param name="filePath">Full path to the image.</param>
        void AddVideo(string filePath)
        {
            VideoControl p = new VideoControl();
            System.Windows.Shapes.Rectangle i = p.SetVideo(filePath);

            ElementProperties prop = new ElementProperties();
            prop.ElementSupport.AddSupportForAll();

            MTContainer cont = new MTSmoothContainer(p, canvas1, prop);
            framework.RegisterElement(cont);

            canvas1.Children.Add(p);

            cont.MaxX = (int)(this.screen_width);
            cont.MaxY = (int)(this.screen_height);
            cont.MinX = (int)(this.screen_width / 10);
            cont.MinY = (int)(this.screen_height / 10);
        }
Esempio n. 2
0
        public void Item_TouchUp(PointF p)
        {
            //절대 좌표로 변경
            PointF globalPt = new PointF(thisCont.ObjectTouches.MoveCenter.X, thisCont.ObjectTouches.MoveCenter.Y);

            if (IsSelecting == true)
            {
                IsSelecting = false;
                main.Children.Remove(fileBoxObject);

                if (fileBoxObject.fileType == "image")
                {
                    ImageView imgView = new ImageView();
                    main.Children.Add(imgView);

                    ElementProperties imgViewProp = new ElementProperties();
                    imgViewProp.ElementSupport.AddSupportForAll();

                    MTSmoothContainer imgViewCont = new MTSmoothContainer(imgView, main, imgViewProp);
                    imgViewCont.SetPosition(globalPt.X, globalPt.Y,
                        thisAngle + thisCont.RotateFilter.Target, 1.0);

                    framework.RegisterElement(imgViewCont);

                    imgView.setInit(main, window, framework, imgViewCont, thisAngle + thisCont.RotateFilter.Target, fileBoxObject.objInfo);
                }
                else if (fileBoxObject.fileType == "ppt")
                {
                    PptViewer pptViewer = new PptViewer();
                    main.Children.Add(pptViewer);

                    ElementProperties pptViewerProp = new ElementProperties();
                    pptViewerProp.ElementSupport.AddSupportForAll();

                    MTSmoothContainer pptViewerCont = new MTSmoothContainer(pptViewer, main, pptViewerProp);
                    pptViewerCont.SetPosition(globalPt.X, globalPt.Y,
                        thisAngle + thisCont.RotateFilter.Target, 1.0);

                    framework.RegisterElement(pptViewerCont);

                    pptViewer.setInit(main, window, framework, pptViewerCont, thisAngle + thisCont.RotateFilter.Target, fileBoxObject.objInfo);                
                }
                else if (fileBoxObject.fileType == "video")
                {
                    VideoControl videoCon = new VideoControl();
                    System.Windows.Shapes.Rectangle i = videoCon.SetVideo(fileBoxObject.objInfo.FilePath);

                    ElementProperties vprop = new ElementProperties();
                    vprop.ElementSupport.AddSupportForAll();

                    MTSmoothContainer cont = new MTSmoothContainer(videoCon, main, vprop);
                    cont.SetPosition(globalPt.X, globalPt.Y,
                        thisAngle + thisCont.RotateFilter.Target, 1.0);

                    framework.RegisterElement(cont);

                    main.Children.Add(videoCon);
// 
//                     cont.MaxX = (int)(this.screen_width);
//                     cont.MaxY = (int)(this.screen_height);
//                     cont.MinX = (int)(this.screen_width / 10);
//                     cont.MinY = (int)(this.screen_height / 10);
                }
                else if (fileBoxObject.fileType == "doc")
                {
                    DocViewer dv = new DocViewer();
                    
                    ElementProperties vprop = new ElementProperties();
                    vprop.ElementSupport.AddSupportForAll();

                    MTSmoothContainer cont = new MTSmoothContainer(dv, main, vprop);
                    cont.SetPosition(globalPt.X, globalPt.Y,
                        thisAngle + thisCont.RotateFilter.Target, 1.0);
                    framework.RegisterElement(cont);

                    dv.setInit(main, window, framework, cont, thisAngle + thisCont.RotateFilter.Target, fileBoxObject.objInfo);                
                
                    main.Children.Add(dv);
                    // 
                    //                     cont.MaxX = (int)(this.screen_width);
                    //                     cont.MaxY = (int)(this.screen_height);
                    //                     cont.MinX = (int)(this.screen_width / 10);
                    //                     cont.MinY = (int)(this.screen_height / 10);
                }
            }
            if (IsMoving == true)
            {
                IsMoving = false;
            }
            if (IsRotating == true)
            {
                IsRotating = false;
                firstAng = false;
            }
        }