public void setInit(Canvas _main, Window target, FrameworkControl fw, MTSmoothContainer cont, string _ip, double angle)
 {
     main = _main;
     window = target;
     framework = fw;
     thisCont = cont;
     userIP = _ip;
     gridRotateTrans.Angle = angle;
 }
Example #2
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);
        }
Example #3
0
        void AddFeed(string url)
        {
            ElementProperties prop = new ElementProperties();
            prop.ElementSupport.AddSupportForAll();

            RssList r = new RssList();
            r.Read(url);

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

            canvas1.Children.Add(r);

            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);
        }
Example #4
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);
        }
Example #5
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);

            smartAreaCont = new MTSmoothContainer(smartArea, MainElement, prop);
            framework.RegisterElement(smartAreaCont);

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

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

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

            SingleToneTrans.getInstance().addToArea(smartArea);
            SingleToneTrans.getInstance().addToCont(smartAreaCont);
            _smartArea = smartArea;
        }
Example #6
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();
        }
        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;
            }
        }