public void bt1_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); fBox.Tag = "f/" + userIP; SingleToneTrans.getInstance().addToFileBox(fBox); isCreated = true; } else { main.Children.Remove(fBox); framework.UnregisterElement(fBoxCont.Id); fBox = new FileBox3(); SingleToneTrans.getInstance().removeFileBox(fBox); isCreated = false; } }
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; }
public override void Drag(float x, float y) { //Console.WriteLine("Drag"); ContactsObject s = Source as ContactsObject; if (s == null) { return; } PointIn ptIn = new PointIn(); PointF pt = s.thisCont.ObjectTouches.MoveCenter; ipAddress = ""; posState = 0; //SmartArea 영역 탐색 foreach (SmartArea f in SingleToneTrans.getInstance().smartAreaList) { if (ptIn.setPtinRect(s.window, f, pt, f.objRotateTrans.Angle)) { ipAddress = f.userIP; posState = 1; s.img_send.Visibility = Visibility.Visible; break; } else if (posState != 1) { s.img_send.Visibility = Visibility.Hidden; posState = 0; } } base.Drag(x, y); }
public override void Drag(float x, float y) { //Console.WriteLine("Drag"); ContactsBox s = Source as ContactsBox; if (s == null) { return; } state = 0; sendIP = ""; PointIn ptIn = new PointIn(); PointF pt = s.thisCont.ObjectTouches.MoveCenter; double ang = s.thisAngle + s.thisCont.RotateFilter.Target; foreach (SmartArea a in SingleToneTrans.getInstance().smartAreaList) { if (ptIn.setPtinRect(s.window, a, pt, ang)) { state = 1; sendIP = a.userIP; break; } else { sendIP = ""; state = 0; } } s.Item_TouchMove(pt, state); base.Drag(x, y); }
public void findContainer(string ipAddress, float offsetX, float offsetY, double angle) { foreach (MTSmoothContainer s in SingleToneTrans.getInstance().contList) { if (s.userIP == ipAddress) { s.SetPosition(offsetX, offsetY, angle, 1.0); } } }
public void removeSmartArea(string _ip) { //Init SmartArea Control SmartArea smartArea = SingleToneTrans.getInstance().getArea(_ip); MTSmoothContainer cont = SingleToneTrans.getInstance().getCont(_ip); SingleToneTrans.getInstance().removeArea(smartArea); SingleToneTrans.getInstance().removeCont(cont); main.Children.Remove(smartArea); framework.UnregisterElement(cont.Id); cont.isRemoved = true; }
public void removeSmartArea(string _ip) { //Init SmartArea Control SmartArea smartArea = SingleToneTrans.getInstance().getArea(_ip); SingleToneTrans.getInstance().addToArea(smartArea); int _index = SingleToneTrans.getInstance().getAreaIndex(smartArea); MTSmoothContainer cont = SingleToneTrans.getInstance().getIndexAtCont(_index); MainElement.Children.Remove(smartArea); framework.UnregisterElement(cont.Id); cont.isRemoved = true; }
public override void Drag(float x, float y) { //Console.WriteLine("Drag"); ImageView s = Source as ImageView; if (s == null) { return; } PointIn ptIn = new PointIn(); PointF pt = s.thisCont.ObjectTouches.MoveCenter; double ang = s.thisAngle + s.thisCont.RotateFilter.Target; //FileBox 영역 탐색 foreach (var f in SingleToneTrans.getInstance().fileBoxList) { if (ptIn.setPtinRect(s.window, f, pt, ang)) { fe = f; posState = 1; s.img_cloud.Visibility = Visibility.Visible; break; } else { s.img_cloud.Visibility = Visibility.Hidden; posState = 0; } } //SmartArea 영역 탐색 foreach (var f in SingleToneTrans.getInstance().smartAreaList) { if (ptIn.setPtinRect(s.window, f, pt, ang)) { fe = f; posState = 2; s.img_cloud.Visibility = Visibility.Visible; break; } else if (posState != 1) { s.img_cloud.Visibility = Visibility.Hidden; posState = 0; } } base.Drag(x, y); }