示例#1
0
        public void bt_filebox_Click(object sender, RoutedEventArgs e)
        {
            if (main.Children.Contains(fBox) == false)
            {
                fBox = new FileBox3();
                main.Children.Add(fBox);

                fBoxProp.ElementSupport.AddSupport(TouchAction.Tap);
                fBoxProp.ElementSupport.AddSupport(TouchAction.Drag);
                fBoxProp.ElementSupport.AddSupport(TouchAction.ScrollY);

                fBoxCont = new MTSmoothContainer(fBox, main, fBoxProp);
                fBoxCont.SetPosition(thisPosition.X, thisPosition.Y,
                                     thisAngle + thisCont.RotateFilter.Target, 1.0);

                framework.RegisterElement(fBoxCont);
                fBox.setInit(main, window, framework, fBoxCont, thisAngle, userIP);

                isCreated = true;
            }
            else
            {
                main.Children.Remove(fBox);
                framework.UnregisterElement(fBoxCont.Id);
                fBox      = new FileBox3();
                isCreated = false;
            }
        }
示例#2
0
        void bt1_Click(object sender, RoutedEventArgs e)
        {
            if (!(main.Children.Contains(pMenu)))
            {
                PointF globalPt = new PointF(thisCont.ObjectTouches.MoveCenter.X, thisCont.ObjectTouches.MoveCenter.Y);
                pMenu = new phoneMenu();

                main.Children.Add(pMenu);

                pMenuProp.ElementSupport.AddSupportForAll();

                pMenuCont = new MTSmoothContainer(pMenu, main, pMenuProp);

                pMenuCont.SetPosition(globalPt.X, globalPt.Y, gridRotateTrans.Angle, 1.0);
                framework.RegisterElement(pMenuCont);

                pMenu.setInit(main, window, framework, pMenuCont, gridRotateTrans.Angle, userIP);
            }
            else
            {
                main.Children.Remove(pMenu);
                framework.UnregisterElement(pMenuCont.Id);
                pMenuCont.isRemoved = true;
            }
        }
示例#3
0
        public void Item_TouchUp(PointF p, string ipAddress)
        {
            //절대 좌표로 변경
            PointF globalPt = new PointF(thisCont.ObjectTouches.MoveCenter.X, thisCont.ObjectTouches.MoveCenter.Y);

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

                if (itemState == 1) //연락처 전송
                {
                    contactsObj.sendContact(ipAddress);
                }
                else if (itemState == 2)
                {
                }
                else
                {
                    ContactsObject cObj = new ContactsObject(window, main, contactsObj.contacts);

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

                    MTSmoothContainer cObjCont = new MTSmoothContainer(cObj, main, cObjProp);
                    framework.RegisterElement(cObjCont);

                    cObj.setInit(framework, cObjCont);

                    main.Children.Add(cObj);

                    cObjCont.SetPosition(globalPt.X, globalPt.Y, thisAngle + thisCont.RotateFilter.Target, 1.0);
                }
            }
        }
示例#4
0
        public void createSmartArea(string _ip, PointF pt, double angle)
        {
            //Init SmartArea Control
            SmartArea smartArea = new SmartArea();

            ElementProperties prop = new ElementProperties();

            prop.ElementSupport.AddSupport(TouchFramework.TouchAction.Drag);
            prop.ElementSupport.AddSupport(TouchFramework.TouchAction.Tap);

            MTSmoothContainer smartAreaCont = new MTSmoothContainer(smartArea, main, prop);

            framework.RegisterElement(smartAreaCont);

            smartArea.Tag        = _ip;
            smartAreaCont.userIP = _ip;

            main.Children.Add(smartArea);
            smartArea.setInit(main, window, framework, smartAreaCont, _ip, angle);

            smartAreaCont.SetPosition(pt.X, pt.Y, angle, 1.0);

            SingleToneTrans.getInstance().addToArea(smartArea);
            SingleToneTrans.getInstance().addToCont(smartAreaCont);
        }
示例#5
0
        void addControl()
        {
            //Center Menu
            ElementProperties prop_c = new ElementProperties();

            prop_c.ElementSupport.AddSupport(TouchFramework.TouchAction.Tap);

            CenterMenuCont = new MTSmoothContainer(center_menu, MainElement, prop_c);
            CenterMenuCont.SetPosition((float)MainElement.ActualWidth / 2, (float)MainElement.ActualHeight / 2, 0, 1.0);
            framework.RegisterElement(CenterMenuCont);

            center_menu.setInit(MainElement, window, framework, CenterMenuCont, 0);

            MainElement.Children.Add(center_menu);

            //SmartPhoneCont
            ElementProperties prop2 = new ElementProperties();

            prop2.ElementSupport.AddSupportForAll();

            smartPhoneCont = new MTSmoothContainer(smartPhone_img, MainElement, prop2);
            framework.RegisterElement(smartPhoneCont);

            //createSmartArea();
        }
示例#6
0
        /// <summary>
        /// Creates a new photo 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 AddPhoto(string filePath)
        {
            BitmapImage bi = new BitmapImage(new Uri(filePath));
            Photo       p  = new Photo();

            System.Windows.Controls.Image i = p.SetPicture(filePath);

            RenderOptions.SetBitmapScalingMode(i, BitmapScalingMode.HighQuality);

            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);
        }
示例#7
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;
            }
        }