Example #1
0
       // List<ServiceReference1.Istoric_Animal_Deces> lista2;
       // void wcf_PreiaDecesCompleted(object sender, ServiceReference3.PreiaDecesCompletedEventArgs e)
       // {
       ////     lista2 = new List<ServiceReference3.Istoric_Animal_Deces>();
       //     foreach (var c in e.Result)
       //     lista2.Add(c);
       // }
      

  
        private void ArrangePage()
        {
            //rezolutia ecranului
            canvas.Width = double.Parse(HtmlPage.Window.Eval("screen.width").ToString());
            canvas.Height = double.Parse(HtmlPage.Window.Eval("screen.height").ToString());
            HtmlDocument d = HtmlPage.Document;
            string c = d.QueryString.Count.ToString() ;
            //canvasu de sus
            btn2.Width = canvas.Width;
            // aranjenz in pagina gridu
            Canvas.SetLeft(LayoutRoot, canvas.Width / 2 - 500);
            Canvas.SetTop(LayoutRoot, 75);
            LoginForm add = new LoginForm(MeniuDreapa,canvas2,maplayer,map);
            
            MeniuSus m = new MeniuSus(btn2, canvas.Width,canvas2);
           
       #region Tranzactii Sergiu

          //  Tranzactii
       //     map.Visibility = Visibility.Collapsed;
        //   canvas2.Children.Clear();
      //      canvas2.Background = new SolidColorBrush(Color.FromArgb(0xFF, 0x00, 0x00, 0x00));
           //// Forme.t = new Forme.Tranzactii(canvas2);
       //  Forme.MyTranzactii t = new Forme.MyTranzactii(canvas2);
     //    bing_maps.Forme.MyTranzactii t = new bing_maps.Forme.MyTranzactii(canvas2);
            #endregion
        #region History
         //  Thread.Sleep(new TimeSpan(0, 0, 0,5));
          //  stat s = new stat(canvas2);
          //  canvas2.Children.Add(s);
            //History cs = new History();
            //canvas2.Children.Add(s);
            #endregion
            #region Holban
            //BasicHttpBinding bind = new BasicHttpBinding();
            //EndpointAddress endpoint = new EndpointAddress("http://localhost:11201/Service1.svc");
            //bing.testService.Service1Client wcf = new bing.testService.Service1Client(bind, endpoint);
            //wcf.GetAnimalByIDCompleted += new EventHandler<bing.testService.GetAnimalByIDCompletedEventArgs>(wcf_GetAnimalByIDCompleted);
            //wcf.GetTop3IstoricAnimaleForUserXCompleted += new EventHandler<GetTop3IstoricAnimaleForUserXCompletedEventArgs>(wcf_GetTop3IstoricAnimaleForUserXCompleted);
            //try
            //{
            //    wcf.GetAnimalByIDAsync(15);
            //    wcf.GetTop3IstoricAnimaleForUserXAsync(2, 15);
            //}
            //catch (Exception ex)
            //{
            //    MessageBox.Show(ex.Message);
            //}

            #endregion
        }
Example #2
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;
        }