Esempio n. 1
0
 public Padure(Canvas canv,Canvas md)
 {
     c = canv;
     this.md = md;
     
     md.Children.Clear();
     ServiceReference1.TranzactiiClient tc = new ServiceReference1.TranzactiiClient(bind, endpoint);
     tc.GetHistoryPadureCompleted += new EventHandler<ServiceReference1.GetHistoryPadureCompletedEventArgs>(tc_GetHistoryPadureCompleted);
     tc.GetHistoryPadureAsync();
  
 }
Esempio n. 2
0
        public pesteHarta(Canvas can, PlaneProjection p,Image img, Canvas md,MapLayers mapLayer,Map map)
        {
            ServiceReference1.TranzactiiClient tc = new ServiceReference1.TranzactiiClient(bind, endpoint);
            tc.GetHistoryPadureCompleted += new EventHandler<ServiceReference1.GetHistoryPadureCompletedEventArgs>(tc_GetHistoryPadureCompleted);
            tc.GetHistoryPadureAsync();
           // retine = md;
            this.mapLayer = mapLayer;
            this.map = map;
            this.md = md;
            this.p = p;
            this.img = img;

            // Alex code
            // Preia meniul de login din LoginForm
            // La intoarcerea din padure sau campie Meniu Dreapta contine MeniuAnimal sau MeniuPlanta
            // iar la intoarcere este necesar ca in Meniu Dreapta sa se afle PaginaUser

            // Nu mai e nevoie de toata partea asta
            /*UIElement[] array = LoginForm.getInstance().getMeniuDreapta();
            for (int i = 0; i < array.Length; i++)
            {
                if (array[i].GetType() == typeof(PaginaUser))
                {
                    Rember = (PaginaUser)array[i];
                    break;
                }
            }*/
            
            md.Children.Clear();

            // Preia instanta PaginaUser
            // Actualizeaza regiunea curenta
            Rember = PaginaUser.getInstance();
            Rember.updateCurrentRegion();

            // Adaug manual PaginaUser, altfel apare un bug in care nu am nici un
            // meniu in partea stanga
            // Verific daca are deja parinte sa nu dea eroare
            if (Rember.Parent == null)
            {
                this.md.Children.Add(Rember);
            }
            
            // End of Alex code

            verifica = null;
            tmr.Interval = new TimeSpan(0, 0, 0, 0, 200);
            tmr.Tick += new EventHandler(tmr_Tick);
            tmr.Start();
            #region Padure
            Padure = new Path()
            {
                StrokeThickness = 4,

            };
            Padure.MouseLeftButtonDown += new MouseButtonEventHandler(Padure_MouseLeftButtonDown);
            Padure.Cursor = Cursors.Hand;
            PathFigure PathFigurepadure = new PathFigure() { StartPoint = new Point(0, 2) };
            LineSegment l = new LineSegment() { Point = new Point(2, 333) };
            PathFigurepadure.Segments.Add(l);
            BezierSegment bs = new BezierSegment() { Point1 = new Point(14, 333), Point2 = new Point(30, 310), Point3 = new Point(30, 270) };
            PathFigurepadure.Segments.Add(bs);
            bs = new BezierSegment() { Point1 = new Point(30, 270), Point2 = new Point(30, 250), Point3 = new Point(50, 245) };
            PathFigurepadure.Segments.Add(bs);
            //bs = new BezierSegment() { Point1 = new Point(40, 250), Point2 = new Point(40, 254), Point3 = new Point(85, 235) };
            //PathFigurepadure.Segments.Add(bs);
            l = new LineSegment() { Point = new Point(400, 115) };
            PathFigurepadure.Segments.Add(l);
            bs = new BezierSegment() { Point1 = new Point(400, 115), Point2 = new Point(529, 65), Point3 = new Point(445, 2) };
            PathFigurepadure.Segments.Add(bs);
            l = new LineSegment() { Point = new Point(0, 2) };
            PathFigurepadure.Segments.Add(l);
           
            PathGeometry geometry = new PathGeometry();

            geometry.Figures.Add(PathFigurepadure);
            Padure.Data = geometry;

            Padure.Fill = new SolidColorBrush(Colors.Transparent);
            //  Padure.Stroke = new SolidColorBrush(Color.FromArgb(0xFF,0x00,0x00,0x00));
            Padure.MouseEnter += new MouseEventHandler(Padure_MouseEnter);
            Padure.MouseLeave += new MouseEventHandler(Padure_MouseLeave);

            can.Children.Add(Padure);
            #endregion
            canv = can;
            #region Raul miscator
            #region Sus
             el = new Path();
            BezierSegment b;
            PathFigure pf;
            PathGeometry j;
            el.Fill = new SolidColorBrush(Color.FromArgb(0x55, 0x0a, 0x76, 0xd1));
            //el.Fill = new SolidColorBrush(Color.FromArgb(0xFF, 0x00, 0x00, 0x00));
            el.Effect = hh;
            pf = new PathFigure() { StartPoint = new Point(500, 2) };
            b = new BezierSegment() { Point1 = new Point(500, 2), Point2 = new Point(600, 70), Point3 = new Point(430, 140) };

            pf.Segments.Add(b);
            LineSegment ls = new LineSegment() { Point = new Point(420, 130) };
            pf.Segments.Add(ls);
            b = new BezierSegment() { Point1 = new Point(420, 130), Point2 = new Point(550, 70), Point3 = new Point(480, 2) };
            pf.Segments.Add(b);
            j = new PathGeometry();
            j.Figures.Add(pf);
            el.Data = j;
            canv.Children.Add(el);
            #endregion
             mijloc = new Path();

            // mijloc.Fill = new SolidColorBrush(Color.FromArgb(0x55, 0x0a, 0x76, 0xd1));

            mijloc.StrokeThickness = 3;
            mijloc.Stroke = new SolidColorBrush(Color.FromArgb(0xFF, 0x00, 0x00, 0x00));
            //     mijloc.Fill = new SolidColorBrush(Color.FromArgb(0x99, 0x0d, 0x74, 0xd1));
            //        mijloc.Effect = hh;
            pf = new PathFigure() { StartPoint = new Point(370, 150) };
            b = new BezierSegment() { Point1 = new Point(370, 150), Point2 = new Point(400, 190), Point3 = new Point(330, 185) };

            pf.Segments.Add(b);
            ls = new LineSegment() { Point = new Point(320, 175) };
            pf.Segments.Add(ls);
            b = new BezierSegment() { Point1 = new Point(320, 175), Point2 = new Point(260, 170), Point3 = new Point(380, 150) };
            pf.Segments.Add(b);
            j = new PathGeometry();
            j.Figures.Add(pf);
            mijloc.Data = j;
            canv.Children.Add(mijloc);
            #endregion

            AdaugCampie();
        }