Пример #1
0
        public PaginaUser(BusyIndicator bIndic,List<ServiceReference1.LoginFunction_Result> lista,MapLayers mymap,Map map,Canvas canvas2)
        {
            InitializeComponent();
            this.canvas2 = canvas2;
            this.mymap = mymap;
            this.map = map;
            this.bInidic = bIndic;
            #region Adresa + Nume animal
            ControlCuColturiRotunde adresscur = new ControlCuColturiRotunde(LayoutRoot, 230, 100, 0, 7, true, 1);
            adresscur.Colturi(13, 13, new Rect(0, 0, 230, 100));
            adresscur.Colors("#FFF0F8FF", "#FFF0F8FF", new Point(0.5, 1), new Point(0.5, 0), 0.3);
            //    ControlCuColturiRotunde dd = new ControlCuColturiRotunde(can, 200, 100, 200, 100, false, 1);
            Canvas wrap = new Canvas() { Margin = new Thickness(12, 12, 12, 12), Width = 210, Height = 70 };
            tb1 = new TextBlock() { Text = "You are here: ", Margin = new Thickness(0, 1, 0, 0), FontFamily = new FontFamily("Tahoma"), FontSize = 12, Foreground = new SolidColorBrush(Color.FromArgb(255, 0, 42, 116)) };
            tb2 = new TextBlock() { Text = "Regiunea Curenta", Margin = new Thickness(tb1.ActualWidth + 1, 1, 0, 0), FontFamily = new FontFamily("Tahoma"), FontSize = 12, Foreground = new SolidColorBrush(Colors.Black), Cursor = Cursors.Hand };
            tb3 = new TextBlock() { Text = " >> ", Margin = new Thickness(tb1.ActualWidth + tb2.ActualWidth + 2, 1, 0, 0), FontFamily = new FontFamily("Comic Sans MS"), FontWeight = FontWeights.SemiBold, FontSize = 8, Foreground = new SolidColorBrush(Color.FromArgb(255, 0, 42, 116)) };
            tb4 = new TextBlock() { Text = "Subregiunea", Margin = new Thickness(tb1.ActualWidth + tb2.ActualWidth + tb3.ActualWidth + 3, 1, 0, 0), FontFamily = new FontFamily("Tahoma"), FontSize = 12, Foreground = new SolidColorBrush(Colors.Black), Cursor = Cursors.Hand };
            if (tb4.Margin.Left + tb4.ActualWidth > 210)//trecere urm rand
                tb4.Margin = new Thickness(15, 18, 0, 0);
            tb5 = new TextBlock() { Text = " >> ", Margin = new Thickness(tb4.Margin.Left != 0 ? tb4.ActualWidth + 16 : 15, 18, 0, 0), FontFamily = new FontFamily("Comic Sans MS"), FontWeight = FontWeights.SemiBold, FontSize = 8, Foreground = new SolidColorBrush(Color.FromArgb(255, 0, 42, 116)) };
            if (tb4.Margin.Left != 15)
                tb5.Margin = new Thickness(15, 18, 0, 0);
            tb6 = new TextBlock() { Text = "Zona Campie/Padure", Margin = new Thickness(tb5.Margin.Left + tb5.ActualWidth + 1, 18, 0, 0), FontFamily = new FontFamily("Tahoma"), FontSize = 12, Foreground = new SolidColorBrush(Colors.Black), Cursor = Cursors.Hand };
            //TextBlock tb7 = new TextBlock() { Text = " >> ", Margin = new Thickness(tb6.Margin.Left + tb6.ActualWidth + 1, 18, 0, 0), FontFamily = new FontFamily("Comic Sans MS"), FontWeight = FontWeights.SemiBold, FontSize = 8, Foreground = new SolidColorBrush(Color.FromArgb(255, 0, 42, 116)) };
            //TextBlock tb8 = new TextBlock() { Text = "Animals", Margin = new Thickness(tb7.Margin.Left + tb7.ActualWidth + 1, 18, 0, 0), FontFamily = new FontFamily("Tahoma"), FontSize = 12, Foreground = new SolidColorBrush(Colors.Black), Cursor = Cursors.Hand };
            wrap.Children.Add(tb1); wrap.Children.Add(tb2); wrap.Children.Add(tb3); wrap.Children.Add(tb4); wrap.Children.Add(tb5); wrap.Children.Add(tb6); //wrap.Children.Add(tb7); wrap.Children.Add(tb8);
            LayoutRoot.Children.Add(wrap);

            TextBlock tb9 = new TextBlock() { Text = "Welcome,", Margin = new Thickness(12, 48, 12, 12), FontFamily = new FontFamily("Tahoma"), FontSize = 12, Foreground = new SolidColorBrush(Colors.Black) };
            TextBlock tb10 = new TextBlock() { Text = lista[0].Nume, Margin = new Thickness(12, 58, 12, 12), FontFamily = new FontFamily("Tahoma"), FontSize = 23, Foreground = new SolidColorBrush(Colors.Black) };
            LayoutRoot.Children.Add(tb9);
            LayoutRoot.Children.Add(tb10);
            #endregion
            ImageSourceConverter c = new ImageSourceConverter();
            image1.Source = (ImageSource)c.ConvertFromString("Game/deer.jpg");
            Donatii.Text = lista[0].NrDonatii.ToString() + " Donations";
            Banidonati.Text = lista[0].BaniDonati.ToString() + " RON donated";
            Rank.Text = "Rank: "+lista[0].Rank.ToString();
            Scor.Text = "Scor: " + lista[0].Scor;
            mymap.lol();
            
            bIndic.IsBusy = false;

            // Alex
            // Evenimente
            tb2.MouseLeftButtonUp += new MouseButtonEventHandler(tb2_MouseLeftButtonUp);

            // Update region
            updateCurrentRegion();

            // Store the current instance
            instance = this;
        }
Пример #2
0
        public Baragan(Map m, Canvas c, Canvas md, MapLayers mapl, List<bing.ServiceReference1.ProceduraRealJudet_Result> lista, bool login)
        {
            i = login;
            this.md = md;
            this.m = m;
            this.mapl = mapl;
            this.lista = lista;
            for (int j = 0; j < lista.Count; j++)
            {
                if (lista[j].ID == 10)
                {
                    reg1lista = j;
                }
                if (lista[j].ID == 11)
                {
                    reg2lista = j;
                }
                if (lista[j].ID == 12)
                {
                    reg3lista = j;
                }
                if (lista[j].ID == 13)
                {
                    reg4lista = j;
                }
            }
            dt = new DispatcherTimer();
            MPBaraganRegiune1 = new MapPolygon();
            MPBaraganRegiune2 = new MapPolygon();
            MPBaraganRegiune3 = new MapPolygon();
            MPBaraganRegiune4 = new MapPolygon();
            MPBaraganRegiune1.MouseEnter += new MouseEventHandler(MPBaraganRegiune1_MouseEnter);
            MPBaraganRegiune1.MouseLeave += new MouseEventHandler(MPBaraganRegiune1_MouseLeave);
            MPBaraganRegiune1.MouseLeftButtonDown += new MouseButtonEventHandler(MPBaraganRegiune1_MouseLeftButtonDown);
            MPBaraganRegiune2.MouseEnter += new MouseEventHandler(MPBaraganRegiune2_MouseEnter);
            MPBaraganRegiune2.MouseLeave += new MouseEventHandler(MPBaraganRegiune2_MouseLeave);
            MPBaraganRegiune2.MouseLeftButtonDown += new MouseButtonEventHandler(MPBaraganRegiune2_MouseLeftButtonDown);
            MPBaraganRegiune3.MouseEnter += new MouseEventHandler(MPBaraganRegiune3_MouseEnter);
            MPBaraganRegiune3.MouseLeave += new MouseEventHandler(MPBaraganRegiune3_MouseLeave);
            MPBaraganRegiune3.MouseLeftButtonDown += new MouseButtonEventHandler(MPBaraganRegiune3_MouseLeftButtonDown);
            MPBaraganRegiune4.MouseEnter += new MouseEventHandler(MPBaraganRegiune4_MouseEnter);
            MPBaraganRegiune4.MouseLeave += new MouseEventHandler(MPBaraganRegiune4_MouseLeave);
            MPBaraganRegiune4.MouseLeftButtonDown += new MouseButtonEventHandler(MPBaraganRegiune4_MouseLeftButtonDown);

            map = m;
            can = c;
            dt = new DispatcherTimer();
            dt.Interval = new TimeSpan(0, 0, 0, 0, 10);
            dt.Tick += new EventHandler(dt_Tick);
        }
Пример #3
0
        public MainPage()
        {
            //ServiceReference3.ServiceDecesClient wcf = new ServiceReference3.ServiceDecesClient(bind, endpoint);

            //wcf.PreiaDecesAsync(1);
            //wcf.PreiaDecesCompleted += new EventHandler<ServiceReference3.PreiaDecesCompletedEventArgs>(wcf_PreiaDecesCompleted);
            //Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
            Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
            InitializeComponent();
        
            //trimit canvasul de deasupra hartii
            maplayer = new MapLayers(map, canvas2, MeniuDreapa);
            map.SetView(new Location(maplayer.latitudine, maplayer.longitudine), maplayer.zoom);
            map.Children.Add(maplayer.RomaniaMap());
            map.Children.Add(maplayer.PoligonMoldova());
            map.Children.Add(maplayer.PoligonTransilvania());
            map.Children.Add(maplayer.PoligonBaragan());
            map.Children.Add(maplayer.PoligonBanat());
            ArrangePage();

            // End of the constructor
            // Store the current instance
            instance = this;
        }
Пример #4
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();
        }
Пример #5
0
 public MapLayers(Map m,Canvas can,Canvas MeniuDreapta)
 {
    
     bing.ServiceReference1.TranzactiiClient tc = new bing.ServiceReference1.TranzactiiClient(bind, endpoint) ;
     tc.GetProceduraRealCompleted += new EventHandler<bing.ServiceReference1.GetProceduraRealCompletedEventArgs>(tc_GetProceduraRealCompleted);
     tc.GetProceduraRealAsync(1);
     md = MeniuDreapta;
     this.map = m;
     c = can;
     timer.Interval = new TimeSpan(0, 0, 0, 0, 50);
     timer.Tick += new EventHandler(t_Tick);
     Z = zoom;
     Long = longitudine;
     Lat = latitudine;
     mapLayers = this;
 }
Пример #6
0
        // End Alex

        public LoginForm(Canvas can,Canvas canvas2,MapLayers map,Map mapmare)
         {
            Uri httpAddress = new Uri("http://localhost:11201/Tranzactii.svc");
           // System.ServiceModel.ServiceHost
             mymap = map;
             this.mapMare = mapmare;
            bIndic.Width = 152;
            bIndic.Height = 56;
            this.canvas2=canvas2;
            canvas2.Children.Add(bIndic);
            bIndic.IsBusy=false;
            Canvas.SetLeft(bIndic, canvas2.Width / 2 -78);
            Canvas.SetTop(bIndic, canvas2.Height / 2);
                
            #region Info+Welcome user
            ControlCuColturiRotunde iws = new ControlCuColturiRotunde(can, 205, 200, 0, 10, true, 1);
            iws.AddTextBlockMultiple(new TextBlock()
                                      , 6
                                      , new string[] { " Want to do something for your country?", "GrowRomania is a new game where you", "can grow forest and rise animals in any ", "region. Wild animals ,domestic animals", "and everthing.Join now and play.", "See how to play ..." }
                                      , new string[] { "#FFFFFFFF" }
                                      , new int[] { 11 });
            howto = new ControlCuColturiRotunde(can, 100, 25, 120, 110, true, 1);
            howto.Colors("#FF03132d", "#FF03132d", new Point(0.5, 1), new Point(0.5, 0), 1);
            howto.Colturi(10, 10, new Rect(0, 0, 100, 25));
            howtobutton = howto.intoarce();
            howtobutton.MouseEnter += new MouseEventHandler(howtobutton_MouseEnter);
            howtobutton.MouseLeave += new MouseEventHandler(howtobutton_MouseLeave);
            howto.AddTextBlock(new TextBlock(), " + more info", 12, 5, 4, "#FF8b9205");
            howto.Cursor = Cursors.Hand;
            iws.AddTextBlock(new TextBlock(), "Welcome, Guest!", 20, 0, 190, "#FF8b9205");


            #endregion
            #region Username
            ControlCuColturiRotunde b = new ControlCuColturiRotunde(can, 206, 39, 0, 230, false, 1);
            username = new TextBox();
            b.Colors("#FF465d6a", "#FF5c7084", new Point(0.5, 1), new Point(0.5, 0), null);
            b.Border(new CornerRadius(10, 9, 9, 9), "#FF88B4BB", new Thickness(1), 208, 40);
            b.Colturi(10, 10, new Rect(0, 0, 206, 38));
            b.AddTextBlock(new TextBlock(), "Username:"******"", 100, 30, 0, 14, "#FF992929", "#FF9F1C1C", "#FF581818", "#FFBE4141", null, true, 95, 5);
            #endregion
            #region Passward
            //adaug canvas pt Password
            ControlCuColturiRotunde c = new ControlCuColturiRotunde(can, 206, 39, 0, 274, false, 1);
            Passordbox = new PasswordBox();
            Passordbox.PasswordChanged += new RoutedEventHandler(pb_PasswordChanged);


            c.Colors("#FF465d6a", "#FF5c7084", new Point(0.5, 1), new Point(0.5, 0), null);
            c.Border(new CornerRadius(9, 9, 9, 9), "#FF88B4BB", new Thickness(1), 208, 40);
            c.Colturi(10, 10, new Rect(0, 0, 206, 38));
            c.AddTextBlock(new TextBlock(), "Password:"******"", 100, 30, 0, 14, "#FF992929", "#FF9F1C1C", "#FF581818", "#FFBE4141", null, true, 95, 5);
            #endregion
            #region Loginbutton

            canvasforbutton = new ControlCuColturiRotunde(can, 206, 39, 0, 318, false, 1);
            canvasforbutton.Colors("#FF969a07", "#FF7a7d04", new Point(0.5, 1), new Point(0.5, 0), null);
            canvasforbutton.Border(new CornerRadius(10, 10, 10, 10), "#FF9fa13a", new Thickness(1), 208, 40);
            canvasforbutton.Colturi(10, 10, new Rect(0, 0, 206, 38));
            canvasforbutton.AddTextBlock(new TextBlock(), "Log in", 17, 80, 5, "#ffe0e1c0");
            canvasforbutton.Cursor = Cursors.Hand;
            butonlogin = canvasforbutton.intoarce();
            butonlogin.MouseEnter += new MouseEventHandler(butonlogin_MouseEnter);
            butonlogin.MouseLeave += new MouseEventHandler(butonlogin_MouseLeave);
            butonlogin.MouseLeftButtonDown += new MouseButtonEventHandler(butonlogin_MouseLeftButtonDown);
            #endregion
            #region Register ForgotPassward
            //register forgotpassward
            register = new TextBlock() { Cursor = Cursors.Hand };
            Recover = new TextBlock() { Cursor = Cursors.Hand };
            rf = new ControlCuColturi(can, 205, 40, 0, 365, true, 1);
            rf.AddTextBlock(register, "Register", 14, 0, 5, "#FF8b9205");
            rf.AddTextBlock(new TextBlock(), "|", 14, 62, 5, "#FF8b9205");
            rf.AddTextBlock(Recover, "Recover Password", 14, 74, 5, "#FF8b9205");
            Recover.MouseEnter += new MouseEventHandler(Recover_MouseEnter);
            Recover.MouseLeave += new MouseEventHandler(Recover_MouseLeave);
            register.MouseEnter += new MouseEventHandler(register_MouseEnter);
            register.MouseLeave += new MouseEventHandler(register_MouseLeave);
            register.MouseLeftButtonDown += new MouseButtonEventHandler(register_MouseLeftButtonDown);
            #endregion

            Line l = new Line() { X1 = 0, X2 = 205, Y1 = 400, Y2 = 400, Stroke = new SolidColorBrush(Colors.White), StrokeThickness = 1 };
            can.Children.Add(l);
            #region ConnectWithFacebook
            ConnectwithFacebook = new ControlCuColturi(can, 50, 50, 0, 405, true, 1);
            ConnectwithFacebook.AddImage(new Image(), 30, 30, "DesignImages/1.png", 0, 0);
            ConnectwithFacebook.AddTextBlock(new TextBlock(), "Connect with Facebook", 15, 30, 5, "#FF5a748d");
            Connect = ConnectwithFacebook.intoarce();
            Connect.Cursor = Cursors.Hand;
            Connect.MouseLeftButtonDown += new MouseButtonEventHandler(Connect_MouseLeftButtonDown);
            #endregion
            Line l1 = new Line() { X1 = 0, X2 = 205, Y1 = 440, Y2 = 440, Stroke = new SolidColorBrush(Colors.White), StrokeThickness = 1 };
            can.Children.Add(l1);
            Meniu = can;
            loggedIn = false;

            // Alex
            // Store the current instance for global use
            instance = this;
        }