Esempio n. 1
0
        private void ReloadNetwork(object sender, EventArgs e)
        {
            long GetID;
            GetID = PadID;
            LocalNet l = new LocalNet();
            l._FieldBackground = PadParent;
            l.Clear_Canvas();

            l.Draw_Local_Network((int)GetID);
        }
        private void MovetoSelectedNode(object sender, SelectionChangedEventArgs e)
        {
            string selectname;
            string selectid;

            double fromx, tox, fromy, toy;
            int duration = 500;
            int travelID;

            System.Windows.Point Rubberpoint = new System.Windows.Point();

            selectname = ((System.Windows.Controls.ContentControl)(((System.Windows.Controls.Primitives.Selector)(sender)).SelectedItem)).Content.ToString();
            selectid = ((System.Windows.FrameworkElement)(((System.Windows.Controls.Primitives.Selector)(sender)).SelectedItem)).Tag.ToString();
            
            int loop;

            for (loop = 0; loop < UniverseBackground.Children.Count; loop++)
            {
                UIElement childVisual = (UIElement)VisualTreeHelper.GetChild(UniverseBackground, loop);
                Visual myvisual = (Visual)VisualTreeHelper.GetChild(UniverseBackground, loop);

                if (((string)((System.Windows.FrameworkElement)(childVisual)).Tag != null))
                {
                    if (((string)((System.Windows.FrameworkElement)(childVisual)).Tag).Contains("EDGE")) 
                        {
                        }
                    else
                    {
                        if (((string)((System.Windows.FrameworkElement)(childVisual)).Tag).Contains(selectid))
                        {

                            Rubberpoint.X = Canvas.GetLeft(childVisual)+5;
                            Rubberpoint.Y = Canvas.GetTop(childVisual)+5;
                            
                          

                     // BUG      fromx = XWhisker.X1;
                     //       tox = Rubberpoint.X;
                     //       fromy = YWhisker.Y1;
                     //       toy = Rubberpoint.Y;

                     //       Animator.AnimatePenner(XWhisker, Line.X1Property, Tween.Equations.CubicEaseIn, fromx, tox, duration, OnAnimationComplete, OnAnimationComplete);
                     //       Animator.AnimatePenner(XWhisker, Line.X2Property, Tween.Equations.CubicEaseIn, fromx, tox, duration, OnAnimationComplete, OnAnimationComplete);
                     //       Animator.AnimatePenner(YWhisker, Line.Y1Property, Tween.Equations.CubicEaseIn, fromy, toy, duration, OnAnimationComplete, OnAnimationComplete);
                     //       Animator.AnimatePenner(YWhisker, Line.Y2Property, Tween.Equations.CubicEaseIn, fromy, toy, duration, OnAnimationComplete, OnAnimationComplete);

                            // Get the Tag of the selection Pt - this is the index from the database for the node...
                            if (((System.Windows.FrameworkElement)(childVisual)).Tag != null)
                            {
                                travelID = Convert.ToInt32(((System.Windows.FrameworkElement)(childVisual)).Tag);
                                LocalNet l = new LocalNet();
                                l._FieldBackground = FieldBackground;
                                l.Clear_Canvas();
                                l.Draw_Local_Network(travelID);
                            }
                        


                        }
                    }
                }


            }

        }
 public void Build_Local_Network(int StartID)
 {
     LocalNet l = new LocalNet();
     l._FieldBackground = FieldBackground;
     l.Clear_Canvas();
     l.Draw_Local_Network(StartID);
               
 }
        public void Padback_Selection(object sender, MouseButtonEventArgs e)
        {
            double fromx, fromy;
            double tox, toy;
            int duration = 500;
            int childindex;
            int travelID;
            string tagvalue;
            System.Windows.Point Rubberpoint = new System.Windows.Point();
            if (e.ClickCount == 2)
            {
                Rubberpoint = e.GetPosition(PadParent);
                childindex = GetChildIndexClickedOn(Rubberpoint);
                if (childindex != -1)
                {
                    UIElement childVisual = (UIElement)VisualTreeHelper.GetChild(PadParent, childindex);
                    Visual myvisual = (Visual)VisualTreeHelper.GetChild(PadParent, childindex);
                    
                    tagvalue = ((System.Windows.FrameworkElement)(sender)).Tag.ToString();
                    DrillLabel.Content = "Values for:" + tagvalue.ToString();
                    ListBoxItem lbi = new ListBoxItem();
                                       
                    lbi.Content = tagvalue;
                    DrillList.Items.Add(lbi);

                    Drill_Into_Pad(tagvalue);
            //   BUG     fromx = WhiskX.X1;
            //        tox = Rubberpoint.X;
            //        fromy = WhiskY.Y1;
            //        toy = Rubberpoint.Y;

//                    Animator.AnimatePenner(WhiskX, Line.X1Property, Tween.Equations.CubicEaseIn, fromx, tox, duration, OnAnimationComplete, OnAnimationComplete);
//                    Animator.AnimatePenner(WhiskX, Line.X2Property, Tween.Equations.CubicEaseIn, fromx, tox, duration, OnAnimationComplete, OnAnimationComplete);
//                    Animator.AnimatePenner(WhiskY, Line.Y1Property, Tween.Equations.CubicEaseIn, fromy, toy, duration, OnAnimationComplete, OnAnimationComplete);
//                    Animator.AnimatePenner(WhiskY, Line.Y2Property, Tween.Equations.CubicEaseIn, fromy, toy, duration, OnAnimationComplete, OnAnimationComplete);

                    // Get the Tag of the selection Pt - this is the index from the database for the node...
                    if (((System.Windows.FrameworkElement)(childVisual)).Tag != null)
                    {
                        if (((System.Windows.FrameworkElement)(childVisual)).Tag.ToString() != "METRIC")
                        {
                            travelID = Convert.ToInt32(((System.Windows.FrameworkElement)(childVisual)).Tag);
                            LocalNet l = new LocalNet();
                            l._FieldBackground = ChildCanvas;
                            l.Clear_Canvas();
                            l.Draw_Local_Network(travelID);
                        }
                    }
                    
                }
            }
       
        }
 private void ReloadNetwork(object sender, EventArgs e)
 {
     LocalNet l = new LocalNet();
     l._FieldBackground = PadParent;
     l.Clear_Canvas();
     l.Draw_Local_Network(1);
 }