예제 #1
0
        public Register(Canvas can, string regiune)
        {
            CanPrincipal = can;
            AtributeGlobale.UserIsRegistering = true;
            //---
            regiune_global = regiune;
            RegisterMeniu = new Canvas() { Background = new SolidColorBrush(Colors.Transparent), Margin = new Thickness(436, 10, 0, 0), Width = 357, Height = 500, Opacity = 1, Visibility = Visibility.Collapsed };
            can.Children.Add(RegisterMeniu);
            TextBlock tb1 = new TextBlock() { Text = "Welcome to "+regiune, FontFamily = new FontFamily("Tahoma"), FontSize = 22, FontWeight=FontWeights.SemiBold, Foreground = new SolidColorBrush(Colors.White) };
            tb1.Margin = new Thickness((RegisterMeniu.ActualWidth - tb1.ActualWidth) / 2, 25, 10, 10);
            RegisterMeniu.Children.Add(tb1);

            double left = (RegisterMeniu.ActualWidth - 206) / 2;
            double left2 = (RegisterMeniu.ActualWidth - 250) / 2;
            #region First name
            b1 = new ControlCuColturiRotunde(RegisterMeniu, 206, 39, left, 90, true, 0.43);
            ControlCuColturiRotunde t1 = new ControlCuColturiRotunde(RegisterMeniu, 90, 39, left, 90, true, 1) { Background = new SolidColorBrush(Colors.Transparent)};
            b1.Opacity = 0.43;
            firstname  = new TextBox();
            b1.Colors("#FF9bc7d1", "#FFd5e4e7", new Point(0.5, 1), new Point(0.5, 0), null);
            b1.Border(new CornerRadius(10, 9, 9, 9), "#FF88B4BB", new Thickness(1), 208, 40);
            b1.Colturi(10, 10, new Rect(0, 0, 206, 38));
            t1.AddTextBlock(new TextBlock(), "First name:", 15, 5, 10, null);
            b1.AddTextBox(firstname, "", 100, 30, 0, 14, "#FF992929", "#FF9F1C1C", "#FF581818", "#FFBE4141", null, true, 95, 5);
            #endregion
            #region Last name
            b2 = new ControlCuColturiRotunde(RegisterMeniu, 206, 39, left, 135, true, 0.43);
            ControlCuColturiRotunde t2 = new ControlCuColturiRotunde(RegisterMeniu, 90, 39, left, 135, true, 1) { Background = new SolidColorBrush(Colors.Transparent) };
            b2.Opacity = 0.43;
            lastname = new TextBox();
            b2.Colors("#FF9bc7d1", "#FFd5e4e7", new Point(0.5, 1), new Point(0.5, 0), null);
            b2.Border(new CornerRadius(10, 9, 9, 9), "#FF88B4BB", new Thickness(1), 208, 40);
            b2.Colturi(10, 10, new Rect(0, 0, 206, 38));
            t2.AddTextBlock(new TextBlock(), "Last name:", 15, 5, 10, null);
            b2.AddTextBox(lastname, "", 100, 30, 0, 14, "#FF992929", "#FF9F1C1C", "#FF581818", "#FFBE4141", null, true, 95, 5);
            #endregion
            #region Username
            b3 = new ControlCuColturiRotunde(RegisterMeniu, 206, 39, left, 180, true, 0.43);
            ControlCuColturiRotunde t3 = new ControlCuColturiRotunde(RegisterMeniu, 90, 39, left, 180, true, 1) { Background = new SolidColorBrush(Colors.Transparent) };
            b3.Opacity = 0.43;
            username = new TextBox();
            b3.Colors("#FF9bc7d1", "#FFd5e4e7", new Point(0.5, 1), new Point(0.5, 0), null);
            b3.Border(new CornerRadius(10, 9, 9, 9), "#FF88B4BB", new Thickness(1), 208, 40);
            b3.Colturi(10, 10, new Rect(0, 0, 206, 38));
            t3.AddTextBlock(new TextBlock(), "Username:"******"", 100, 30, 0, 14, "#FF992929", "#FF9F1C1C", "#FF581818", "#FFBE4141", null, true, 95, 5);
            #endregion
            #region Password
            b4 = new ControlCuColturiRotunde(RegisterMeniu, 206, 39, left, 225, true, 0.43);
            ControlCuColturiRotunde t4 = new ControlCuColturiRotunde(RegisterMeniu, 90, 39, left, 225, true, 1) { Background = new SolidColorBrush(Colors.Transparent) };
            b4.Opacity = 0.43;
            pass = new PasswordBox();
            b4.Colors("#FF9bc7d1", "#FFd5e4e7", new Point(0.5, 1), new Point(0.5, 0), null);
            b4.Border(new CornerRadius(10, 9, 9, 9), "#FF88B4BB", new Thickness(1), 208, 40);
            b4.Colturi(10, 10, new Rect(0, 0, 206, 38));
            t4.AddTextBlock(new TextBlock(), "Password:"******"", 100, 30, 0, 14, "#FF992929", "#FF9F1C1C", "#FF581818", "#FFBE4141", "#FFBE4141", true, 95, 5);
            #endregion
            #region PasswordRetype
            b5 = new ControlCuColturiRotunde(RegisterMeniu, 206, 39, left, 270, true, 0.43);
            ControlCuColturiRotunde t5 = new ControlCuColturiRotunde(RegisterMeniu, 90, 39, left, 270, true, 1) { Background = new SolidColorBrush(Colors.Transparent) };
            b5.Opacity = 0.43;
            passre = new PasswordBox();
            b5.Colors("#FF9bc7d1", "#FFd5e4e7", new Point(0.5, 1), new Point(0.5, 0), null);
            b5.Border(new CornerRadius(10, 9, 9, 9), "#FF88B4BB", new Thickness(1), 208, 40);
            b5.Colturi(10, 10, new Rect(0, 0, 206, 38));
            t5.AddTextBlock(new TextBlock(), "Retype:", 15, 5, 10, null);
            b5.AddPasswordTextBox(passre, "", 100, 30, 0, 14, "#FF992929", "#FF9F1C1C", "#FF581818", "#FFBE4141", "#FFBE4141", true, 95, 5);
            #endregion
            #region Mail
            b6 = new ControlCuColturiRotunde(RegisterMeniu, 206, 39, left, 315, true, 0.43);
            ControlCuColturiRotunde t6 = new ControlCuColturiRotunde(RegisterMeniu, 90, 39, left, 315, true, 1) { Background = new SolidColorBrush(Colors.Transparent) };
            b6.Opacity = 0.43;
            mail = new TextBox();
            b6.Colors("#FF9bc7d1", "#FFd5e4e7", new Point(0.5, 1), new Point(0.5, 0), null);
            b6.Border(new CornerRadius(10, 9, 9, 9), "#FF88B4BB", new Thickness(1), 208, 40);
            b6.Colturi(10, 10, new Rect(0, 0, 206, 38));
            t6.AddTextBlock(new TextBlock(), "E-mail:", 15, 5, 10, null);
            b6.AddTextBox(mail, "", 100, 30, 0, 14, "#FF992929", "#FF9F1C1C", "#FF581818", "#FFBE4141", null, true, 95, 5);
            #endregion
            #region Registerbutton

            canvasforbutton = new ControlCuColturiRotunde(RegisterMeniu, 206, 39, left, 360, 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(), "Register", 17, 68, 5, "#ffe0e1c0");
            Canvas butonlogin = canvasforbutton.intoarce();
            butonlogin.Cursor = Cursors.Hand;
            butonlogin.MouseEnter += new MouseEventHandler(butonlogin_MouseEnter);
            butonlogin.MouseLeave += new MouseEventHandler(butonlogin_MouseLeave);
            butonlogin.MouseLeftButtonDown += new MouseButtonEventHandler(butonlogin_MouseLeftButtonDown);
            #endregion
            #region Error
            err = new Canvas()
            {
                Background = new SolidColorBrush(Color.FromArgb(0xFF, 0xcc, 0xdf, 0xf5)),
                Opacity = .43,
                Width = 250,
                Height = 70,
                Clip = new RectangleGeometry()
                {
                    RadiusX = 10,
                    RadiusY = 10,
                    Rect = new Rect(0, 0, 250, 70)
                },
                Margin = new Thickness(left2, 420, 3, 10),
                Visibility = Visibility.Collapsed
            };
            errtrans = new Canvas() { Background = new SolidColorBrush(Colors.Transparent), Width = 250, Height = 70, Margin = new Thickness(left2, 420, 3, 10),Visibility = Visibility.Collapsed };
            Image img2 = new Image() { Source = new BitmapImage(new Uri("DesignImages/triunghi.png", UriKind.Relative)), Width = 26, Height = 26, Opacity = 1, OpacityMask = new SolidColorBrush(Colors.Black), Margin = new Thickness(10, 4, 0, 0) };
            TextBlock errtext = new TextBlock() { Text = "Error", FontFamily = new FontFamily("tahoma"), FontSize = 18, FontWeight = FontWeights.Bold, Margin = new Thickness(43, 6, 0, 0) };
            errrortext = new TextBlock() { Text = "", FontFamily = new FontFamily("tahoma"), FontSize = 12, Margin = new Thickness(20, 34, 0, 0) };
            errtrans.Children.Add(img2); errtrans.Children.Add(errtext); errtrans.Children.Add(errrortext);
            RegisterMeniu.Children.Add(err);
            RegisterMeniu.Children.Add(errtrans);
            #endregion
            #region Avionas catre alta zona
            /*ret = new Canvas()
            {
                Background = new SolidColorBrush(Color.FromArgb(0xFF, 0xcc, 0xdf, 0xf5)),
                Opacity = .47,
                Width = 200,
                Height = 50,
                Clip = new RectangleGeometry()
                {
                    RadiusX = 10,
                    RadiusY = 10,
                    Rect = new Rect(0, 0, 250, 40)
                },
                Margin=new Thickness(555,5,3,10),
                Cursor=Cursors.Hand
            };
            ret.MouseLeftButtonDown += new MouseButtonEventHandler(ret_MouseLeftButtonDown);
            Image img = new Image() { Source = new BitmapImage(new Uri("DesignImages/avion.png", UriKind.Relative)), Width = 50, Height = 26, Opacity=1, OpacityMask=new SolidColorBrush(Colors.Black) };
            ret.Children.Add(img);
            Canvas.SetLeft(img, 5);
            Canvas.SetTop(img, 7);
            RegisterMeniu.Children.Add(ret);
            TextBlock text = new TextBlock() { Text = "Another Region", FontSize = 20, Margin = new Thickness(56, 7, 0, 0), FontFamily = new FontFamily("Tahoma") };
            ret.Children.Add(text);*/
            #endregion
            timmer = new DispatcherTimer() { Interval = new TimeSpan(0, 0, 0, 0, 200) };
            timmer.Tick += new EventHandler(timmer_Tick);

            #region Choose your region
            tbinit = new TextBlock() { Text = "Choose your region", FontFamily = new FontFamily("Tahoma"), FontSize = 22, FontWeight = FontWeights.SemiBold, Foreground = new SolidColorBrush(Colors.White), Margin = new Thickness(508, 50, 0, 0) };
            CanPrincipal.Children.Add(tbinit);
            RegionChooserTimmer = new DispatcherTimer() { Interval = new TimeSpan(0, 0, 0, 0, 100) };
            RegionChooserTimmer.Tick += new EventHandler(RegionChooserTimmer_Tick);
            RegionChooserTimmer.Start();
            #endregion
        }
예제 #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;
        }