//public void StartRunLoading()
        //{

        //    grdAccountInfo.IsVisible = false;
        //    grdChangePassword.IsVisible = false;
        //    grdLogOut.IsVisible = false;
        //    scrUserProfile.IsEnabled = false;
        //    frmLoading.IsEnabled = true;
        //    frmLoading.IsPlaying = true;
        //    frmLoading.IsVisible = true;
        //    NavigationPage.SetHasNavigationBar(this, false);

        //}

        //public void StopRunLoading()
        //{

        //    grdAccountInfo.IsVisible = true;
        //    grdChangePassword.IsVisible = true;
        //    grdLogOut.IsVisible = true;
        //    scrUserProfile.IsEnabled = true;
        //    frmLoading.IsEnabled = false;
        //    frmLoading.IsPlaying = false;
        //    frmLoading.IsVisible = false;
        //    NavigationPage.SetHasNavigationBar(this, true);
        //}

        private async void btnSaveChangePassword_Clicked(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(UserNameChange) && !string.IsNullOrEmpty(CurrentPass) && !string.IsNullOrEmpty(NewPassConfirm) && tblErrNewPassConfirm.TextColor == Color.FromHex("#00FF00") && !string.IsNullOrEmpty(NewPass) && tblErrNewPass.IsVisible == false)
            {
                tblUserNameChange.IsVisible = false;
                tblCurrentPass.IsVisible    = false;
                tblNewPass.IsVisible        = false;
                tblNewPassConfirm.IsVisible = false;

                UserChangePassModel _UserChangePass = new UserChangePassModel();
                _UserChangePass.UserName        = UserNameChange.Trim();
                _UserChangePass.CurrentPassword = CurrentPass.Trim();
                _UserChangePass.NewPassword     = NewPass.Trim();



                string url = "http://" + Global.Intance.SerIpAdress + ":" + Global.Intance.SerPortAPI + "/api/ChangePassword";


                try
                {
                    var documents = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
                    var fileName  = Path.Combine(documents, "cookie.txt");
                    var cookie    = File.ReadAllText(fileName);

                    HttpClient    client   = new HttpClient();
                    string        jsonData = JsonConvert.SerializeObject(_UserChangePass);
                    StringContent content  = new StringContent(jsonData, Encoding.UTF8, "application/json");
                    content.Headers.Add("Cookie", cookie);
                    HttpResponseMessage response = await client.PostAsync(url, content);

                    string result = await response.Content.ReadAsStringAsync();

                    var responseData = JsonConvert.DeserializeObject <RespondModel>(result);

                    var message = responseData.Content;
                    if (responseData.Result == true)
                    {
                        await Navigation.PushAsync(new EditUserProfilePage(userProfileModel));

                        DependencyService.Get <IMessage>().ShortTime(message[0].ToString());
                    }
                    else
                    {
                        //DependencyService.Get<IMessage>().Longtime(message[0].ToString());
                        await DisplayAlert("Thông báo", message[0].ToString(), "OK");
                    }
                }
                catch (Exception ex)
                {
                    var Err = "Không nết nối được máy chủ";
                    DependencyService.Get <IMessage>().LongTime(Err);
                }
            }
            else
            {
                await DisplayAlert("Thông báo", "Vui lòng nhập thông tin hợp lệ!", "OK");
            }
        }
Пример #2
0
 public void Draw(Matrix view, Matrix projection)
 {
     effect.World      = worldMatrix;
     effect.View       = view;
     effect.Projection = projection;
     device.SetVertexBuffer(vertexBuffer);
     foreach (EffectPass CurrentPass in effect.CurrentTechnique.Passes)
     {
         CurrentPass.Apply();
         device.DrawPrimitives(PrimitiveType.TriangleStrip, 0, 2);
     }
 }
        //Draws the terrain
        public override void Draw(GameTime gameTime)
        {
            Game1 myGame = (Game1)Game;

            effect.World          = Matrix.Identity; //No transformation of the terrain
            effect.View           = myGame.camera.view;
            effect.Projection     = myGame.camera.projection;
            effect.Texture        = texture;
            effect.TextureEnabled = true;

            GraphicsDevice.SetVertexBuffer(vb); //Set vertices
            GraphicsDevice.Indices = ib;        //Set indices

            foreach (EffectPass CurrentPass in effect.CurrentTechnique.Passes)
            {
                CurrentPass.Apply();
                GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, numVertices, 0, numTriangles); //Draw all triangles that make up the mesh
            }

            base.Draw(gameTime);
        }
Пример #4
0
 public override void Draw(GameTime gameTime)
 {
     //BasicEffect effect = new BasicEffect(GraphicsDevice, null);
     effect.World          = Matrix.Identity; //No transformation of the terrain
     effect.View           = Game1.camera.view;
     effect.Projection     = Game1.camera.project;
     effect.Texture        = texture;
     effect.TextureEnabled = true;
     GraphicsDevice.Vertices[0].SetSource(vb, 0, VertexPositionTexture.SizeInBytes);                                 //Set vertices
     GraphicsDevice.Indices           = ib;                                                                          //Set indices
     GraphicsDevice.VertexDeclaration = new VertexDeclaration(GraphicsDevice, VertexPositionTexture.VertexElements); //Decalre type of vertices
     effect.Begin();                                                                                                 //Begin effect
     foreach (EffectPass CurrentPass in effect.CurrentTechnique.Passes)
     {
         CurrentPass.Begin();
         GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, numVertices, 0, numTriangles); //Draw all triangles that make up the mesh
         CurrentPass.End();
     }
     effect.End();
     base.Draw(gameTime);
 }
Пример #5
0
        public IEnumerable <string> GetEquations()
        {
            int totalEquationsRan = 0;

            for (int pass = 0; pass < 3; pass++)
            {
                CurrentPass?.Invoke(this, pass);
                foreach (var digitCombination in GetDigitCombinations(Digits))
                {
                    //for (MathOperation mathOperation = MathOperation.Addition; mathOperation < MathOperation.All; mathOperation++)
                    {
                        //Let's get all grouping combinations
                        foreach (var grouping in GetGroupingCombinations(digitCombination.Length))
                        {
                            int totalEquationsForGrouping = 0;
                            var items = GetDigitsInGroups(digitCombination, grouping);

                            if (!ProceedWithGroupings(items))
                            {
                                continue;
                            }

                            CurrentGroupCombination?.Invoke(this, items);

                            //var temp = ConstructEquations( Operations, items, pass ).ToList();

                            foreach (var equation in ConstructEquations(Operations, items, pass))
                            {
                                totalEquationsForGrouping++;
                                totalEquationsRan++;
                                yield return(equation);
                            }
                        }
                    }
                }
            }
        }
Пример #6
0
 bool IsLogInAvailable()
 {
     return(CurrentPass.Trim().Length > 0 && CurrentPass.Trim().Length > 0);
 }
Пример #7
0
        public void Draw(GameTime gameTime, Camera camera)
        {
            float elapsedTime = (float)gameTime.ElapsedGameTime.TotalSeconds;



            effect.Parameters["view"].SetValue(camera.View);
            effect.Parameters["projection"].SetValue(camera.Projection);
            effect.Parameters["viewportHeight"].SetValue(device.Viewport.Height);
            effect.Parameters["modelTexture"].SetValue(texture);

            spriteArray_Count = -1;
            for (int i = 0; i < particle.Length; i++)
            {
                if (particle[i].isActive)
                {
                    spriteArray[++spriteArray_Count] = new VertexPointSprite(particle[i].position,
                                                                             particle[i].Scale * PointSize,
                                                                             particle[i].ParColor);
                }
            }

            if (spriteArray_Count <= 0)
            {
                return;
            }

            //  頂點格式宣告
            device.VertexDeclaration = pointSpriteVertexDeclaration;
            SetParticleRenderStates(device.RenderState);

            /*
             * device.RenderState.AlphaBlendEnable = true;
             * device.RenderState.SourceBlend = Blend.SourceAlpha;
             * device.RenderState.DestinationBlend = Blend.InverseSourceAlpha;
             * device.RenderState.AlphaTestEnable = true;
             * device.RenderState.AlphaFunction = CompareFunction.Greater;
             * device.RenderState.PointSize = 1000.0f;
             * device.RenderState.PointSizeMax = 10000.0f;
             * device.RenderState.PointSizeMin = 100.0f;
             * device.RenderState.DepthBufferEnable = true ;
             */
            effect.CurrentTechnique = effect.Techniques["PointSprites"];

            effect.Begin();
            foreach (EffectPass CurrentPass in effect.CurrentTechnique.Passes)
            {
                CurrentPass.Begin();

                device.DrawUserPrimitives(PrimitiveType.PointList,
                                          spriteArray,
                                          0,
                                          spriteArray_Count);
                CurrentPass.End();
            }
            effect.End();
            device.RenderState.DepthBufferEnable = true;
            device.RenderState.AlphaBlendEnable  = false;
            device.RenderState.AlphaTestEnable   = false;

            device.RenderState.PointSpriteEnable      = false;
            device.RenderState.DepthBufferWriteEnable = true;
        }