Пример #1
0
        void temp_Tick(object sender, EventArgs e)
        {
            DispatcherTimer currentTimer = sender as DispatcherTimer;
            counterAndCenter current = (counterAndCenter)currentTimer.Tag;
            WebStack.sviContent content = (WebStack.sviContent)current.svi.Tag;

            if (current.counter == 2000 && !content.used)
            {
                //TODO make sure you cant do it more than once! WHAT IS A WORKSPACEELEMENT AND HOW DO I GET IT ???

                //LADSArtworkMode.DockableItem item = new LADSArtworkMode.DockableItem(artwork.MainScatterview, artwork, artwork.Bar, System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\Data\\Images\\Metadata\\riso000695_1md.jpg");
                LADSArtworkMode.DockableItem item = new LADSArtworkMode.DockableItem(artwork.MainScatterView, artwork, artwork.Bar, current.s, ref current.svi, kw);
                item.Center = current.t.GetCenterPosition(artwork.MainScatterView);
                Image temp = new Image();
                temp.Source = current.s;
                item.image.Source = current.s;
                item.Content = temp;
                item.CaptureTouch(current.t);

                currentTimer.Stop();
                sviContent temp2 = ((sviContent)(current.svi.Tag));
                temp2.time = null;
                current.svi.Tag = temp2;
            }
            current.counter++;
            currentTimer.Tag = current;
        }
Пример #2
0
        void moveLayer_PreviewTouchDown(object sender, TouchEventArgs e)
        {
            toggleStackAnim(null);
            toggleSearchOff();

            ScatterViewItem currentScatter = sender as ScatterViewItem;
            fixedCenter = currentScatter.Center;

            if (curveTimer == null)
            {
                if (selectionCurve)
                {
                    List<ScatterViewItem> svList = new List<ScatterViewItem>();
                    if (checkInside(e.TouchDevice.GetCenterPosition(topCanvas)))
                    {
                        Canvas scatterCanvas = new Canvas();
                        scatterCanvas.Height = 100;
                        scatterCanvas.Width = 100;
                        double offsetCount = 0;

                        foreach (ScatterViewItem i in sviList)
                        {
                            if(checkInside2(i.Center))
                            {
                                svList.Add(i);
                                WebStack.sviContent content = (WebStack.sviContent)i.Tag;
                                if (content.used)
                                {
                                    svList.Clear();
                                    break;
                                }
                                Image temp = new Image();
                                temp.Source = content.im.Source;
                                temp.Height = 100;
                                temp.Width = 100;

                                scatterCanvas.Children.Add(temp);
                                Canvas.SetLeft(temp, offsetCount);
                                offsetCount += 10;
                            }

                        }

                        if (svList.Count > 0)
                        {
                            WebStack.sviContent content = (WebStack.sviContent)sviList[0].Tag;
                            LADSArtworkMode.DockableItem item = new LADSArtworkMode.DockableItem(artwork.MainScatterView, artwork, artwork.Bar, content.im.Source, svList,this);
                            item.Center = e.TouchDevice.GetCenterPosition(artwork.MainScatterView);
                            item.Content = scatterCanvas;
                            item.CaptureTouch(e.TouchDevice);
                        }
                    }

                    minX = double.MaxValue;
                    minY = double.MaxValue;
                    maxX = double.MinValue;
                    maxY = double.MinValue;

                    minXin = double.MaxValue;
                    minYin = double.MaxValue;
                    maxXin = double.MinValue;
                    maxYin = double.MinValue;

                    foreach (Line i in curveDraw)
                      topCanvas.Children.Remove(i);

                    curveDraw.Clear();
                    curvePoints.Clear();
                    selectionCurve = false;
                }
                else
                {
                    curvePoints.Clear();

                    curvePoints.Add(e.TouchDevice.GetCenterPosition(topCanvas));
                    startPoint = curvePoints[curvePoints.Count - 1];
                    beforePoint = startPoint;

                    curveTimer = new DispatcherTimer();
                    count = 0;
                    curveTimer.Tick += new EventHandler(curveTimer_Tick);
                    curveTimer.Start();
                }
            }
        }