public OnlineClient(Utilizator_Trip context, string[] Messages)
        {
            this.context = context;

            Nume         = Messages[2];
            Prenume      = Messages[3];
            TipCont      = Messages[4];
            NumarTelefon = Messages[5];
            Position     = Messages[7];

            TcpClient     Client = new TcpClient(_Details.ServerIP, _Details.LargeFilesPort);
            NetworkStream ns     = Client.GetStream();

            using (MemoryStream ms = new MemoryStream())
            {
                _TcpDataExchange.WriteStreamString(ns, CryptDecryptData.CryptData(new string[] { _Details.GetProfilePic, NumarTelefon }));

                int    ReadedBytes;
                byte[] Buffer = new byte[1000];

                while ((ReadedBytes = ns.Read(Buffer, 0, Buffer.Length)) > 0)
                {
                    ms.Write(Buffer, 0, ReadedBytes);
                }

                Client.Close();
                ns.Dispose();

                Drawable PhotoDrawable = DrawableConverter.ByteArrayToDrawable(ms.ToArray(), context);
                Bitmap   PhotoBitmap   = ((BitmapDrawable)PhotoDrawable).Bitmap;

                Photo = new BitmapDrawable(context.Resources, RoundedBitmap.MakeRound(PhotoBitmap, PhotoBitmap.Width));
            }
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            RequestWindowFeature(WindowFeatures.NoTitle);
            Window.SetFlags(WindowManagerFlags.Fullscreen, WindowManagerFlags.Fullscreen);

            Bundle Extras = Intent.Extras;

            byte[] BackgroundByteArray = Extras.GetByteArray("BackgroundUtilizatorMainByteArray");

            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.Organizator_Main);

            CreareExcursieBtn   = FindViewById <Button> (Resource.Id.button1);
            CreareExcursieTView = FindViewById <TextView> (Resource.Id.textView2);
            LeftDrawer          = FindViewById <ListView> (Resource.Id.left_drawer_listview);
            UserProfilePic      = FindViewById <ImageView> (Resource.Id.imageView1);
            UserNume            = FindViewById <TextView> (Resource.Id.textView1);
            Background          = FindViewById <RelativeLayout> (Resource.Id.relativeLayout1);

            Background.Background = DrawableConverter.ByteArrayToDrawable(BackgroundByteArray, this);

            Drawable RoundedUserProfile = DrawableConverter.GetDrawableFromAssets("LoadingBackgrounds/img1.jpg", this);

            RoundedUserProfile = new BitmapDrawable(Resources, RoundedBitmap.MakeRound(((BitmapDrawable)RoundedUserProfile).Bitmap, ((BitmapDrawable)RoundedUserProfile).Bitmap.Width));
            UserProfilePic.SetImageDrawable(RoundedUserProfile);
            UserNume.Text = "Dragos Mihaitza";

            SetTypeface.Normal.SetTypeFace(this, UserNume);
            Drawable d = Resources.GetDrawable(Resource.Drawable.SettingsIcon);

            LeftDrawer.Adapter = new Organizator_Main_LeftDrawerAdapter(this, new string[] { "test 1", "test 2", "test 3", }, new Drawable[] { d, d, d });

            SetTypeface.Normal.SetTypeFace(this, CreareExcursieTView);
            SetTypeface.Normal.SetTypeFace(this, CreareExcursieBtn);

            CreareExcursieBtn.Click += (object sender, EventArgs e) => {
                Intent StartCreareExcursie = new Intent(this, typeof(Organizator_CreareExcursie));

                StartCreareExcursie.PutExtra("BackgroundUtilizatorMainByteArray", DrawableConverter.DrawableToByteArray(Background.Background));
                StartActivity(StartCreareExcursie);
            };
        }
        protected override void OnResume()
        {
            TcpClient     Client = new TcpClient(_Details.ServerIP, _Details.LargeFilesPort);
            NetworkStream ns     = Client.GetStream();

            _TcpDataExchange.WriteStreamString(ns, CryptDecryptData.CryptData(new string[] { _Details.GetProfilePic, new SaveUsingSharedPreferences(this).LoadString(SaveUsingSharedPreferences.Tags.Login.Username) }));

            int ReadedBytes;

            byte[]       Buffer = new byte[1000];
            MemoryStream ms     = new MemoryStream();

            while ((ReadedBytes = ns.Read(Buffer, 0, Buffer.Length)) > 0)
            {
                ms.Write(Buffer, 0, ReadedBytes);
            }

            Client.Close();
            ns.Dispose();

            Bitmap bitMap = ((BitmapDrawable)DrawableConverter.ByteArrayToDrawable(ms.ToArray(), this)).Bitmap;

            UserProfilePic.SetImageDrawable(new BitmapDrawable(Resources, RoundedBitmap.MakeRound(bitMap, bitMap.Height / 2)));

            TcpClient     client = new TcpClient(_Details.ServerIP, _Details.LargeFilesPort);
            NetworkStream Ns     = client.GetStream();

            _TcpDataExchange.WriteStreamString(Ns, CryptDecryptData.CryptData(new string[] { _Details.GetUserName, new SaveUsingSharedPreferences(this).LoadString(SaveUsingSharedPreferences.Tags.Login.Username) }));
            string NumeUtilizator = CryptDecryptData.DecryptData(_TcpDataExchange.ReadStreamString(Ns))[0];

            UserNume.Text = NumeUtilizator;

            client.Close();
            Ns.Dispose();

            base.OnResume();
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            RequestWindowFeature(WindowFeatures.NoTitle);
            Window.SetFlags(WindowManagerFlags.Fullscreen, WindowManagerFlags.Fullscreen);

            Bundle Extras = Intent.Extras;

            byte[] BackgroundByteArray = Extras.GetByteArray("BackgroundByteArray");

            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.Utilizator_Trip_ModifyAccount);

            ListView       RestulDatelor       = FindViewById <ListView>(Resource.Id.listView1);
            RelativeLayout Background          = FindViewById <RelativeLayout>(Resource.Id.relativeLayout1);
            ImageView      ProfilePic          = FindViewById <ImageView>(Resource.Id.imageView1);
            ImageView      ChangeProfilePic    = FindViewById <ImageView>(Resource.Id.imageView2);
            TextView       ChangeProfilePic_TV = FindViewById <TextView>(Resource.Id.textView2);

            Background.Background = DrawableConverter.ByteArrayToDrawable(BackgroundByteArray, this);
            SetTypeface.Bold.SetTypeFace(this, ChangeProfilePic_TV);

            ChangeProfilePic.Click += (object sender, EventArgs e) =>
            {
                string       Path = Android.OS.Environment.GetExternalStoragePublicDirectory(Android.OS.Environment.DirectoryPictures) + "/temp";
                Java.IO.File file = new Java.IO.File(Path, string.Format("temp.jpg", Guid.NewGuid()));

                Intent i = new Intent(MediaStore.ActionImageCapture);
                i.PutExtra(MediaStore.ExtraOutput, Android.Net.Uri.FromFile(file));
                StartActivityForResult(i, 1);
                //Recreate();
            };

            Utilizator_Trip.test.ClientGetMessage += (object sender, ClientGetMessageEventArgs e) =>
            {
                if (e.Messages[0].Equals(_Details.GetUserDataByPhone))
                {
                    TcpClient     Client = new TcpClient(_Details.ServerIP, _Details.LargeFilesPort);
                    NetworkStream ns     = Client.GetStream();

                    _TcpDataExchange.WriteStreamString(ns, CryptDecryptData.CryptData(new string[] { _Details.GetProfilePic, Me.NumarTelefon }));

                    int          ReadedBytes;
                    byte[]       Buffer = new byte[1000];
                    MemoryStream ms     = new MemoryStream();

                    while ((ReadedBytes = ns.Read(Buffer, 0, Buffer.Length)) > 0)
                    {
                        ms.Write(Buffer, 0, ReadedBytes);
                    }

                    Client.Close();
                    ns.Dispose();

                    if (!e.Messages[2].Equals(string.Empty))
                    {
                        Nume    = e.Messages[1];
                        Prenume = e.Messages[2];
                        Varsta  = e.Messages[3];
                        Sex     = e.Messages[4];
                        Email   = e.Messages[5];

                        RunOnUiThread(() =>
                        {
                            RestulDatelor.Adapter = new Utilizator_Trip_ModifyAccount_Adapter(this, new string[] { "Nume:" + Nume, "Prenume:" + Prenume, "Varsta:" + Varsta, "Sex:" + Sex, "E-mail:" + Email });

                            Bitmap bitMap = ((BitmapDrawable)DrawableConverter.ByteArrayToDrawable(ms.ToArray(), this)).Bitmap;
                            ProfilePic.SetImageDrawable(new BitmapDrawable(Resources, RoundedBitmap.MakeRound(bitMap, bitMap.Height / 2)));
                        });
                    }
                }
                else if (e.Messages[0].Equals(_Details.EditUserInfo))
                {
                    switch (e.Messages[1])
                    {
                    case "1":
                    {
                        RunOnUiThread(() => Toast.MakeText(this, "Succes", ToastLength.Short).Show());
                        RunOnUiThread(() => Recreate());
                    } break;

                    case "0":
                    {
                        RunOnUiThread(() => Toast.MakeText(this, "Fail", ToastLength.Short).Show());
                    } break;
                    }
                }
            };

            Me = Utilizator_Trip.Me;
            Me.OUTPUT_SEND(new string[] { _Details.GetUserDataByPhone, Me.NumarTelefon });
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            RequestWindowFeature(WindowFeatures.NoTitle);
            Window.SetFlags(WindowManagerFlags.Fullscreen, WindowManagerFlags.Fullscreen);

            Bundle Extras = Intent.Extras;
            int    BackgroundByteArray = Extras.GetInt("BackgroundUtilizatorMainByteArray");

            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.Utilizator_Main);

            Background       = FindViewById <RelativeLayout> (Resource.Id.relativeLayout1);
            LeftDrawer       = FindViewById <ListView> (Resource.Id.left_drawer_listview);
            Next             = FindViewById <Button> (Resource.Id.button1);
            Container        = FindViewById <RelativeLayout> (Resource.Id.relativeLayout3);
            Cod              = FindViewById <EditText> (Resource.Id.editText1);
            IntroducetiCodul = FindViewById <TextView> (Resource.Id.textView2);
            UserProfilePic   = FindViewById <ImageView> (Resource.Id.imageView1);
            UserNume         = FindViewById <TextView> (Resource.Id.textView1);

            List <Drawable> DrawableList = new List <Drawable>();

            for (int i = 1; i < 5; i++)
            {
                DrawableList.Add(DrawableConverter.GetDrawableFromAssets("LB/img" + i.ToString() + ".jpg", this));
            }
            for (int i = 1; i < 8; i++)
            {
                DrawableList.Add(DrawableConverter.GetDrawableFromAssets("LoadingBackgrounds/img" + i.ToString() + ".jpg", this));
            }
            Background.Background = DrawableList[BackgroundByteArray];

            Cod.Text = new SaveUsingSharedPreferences(this).LoadString(SaveUsingSharedPreferences.Tags.Trip.TipId);
            //Cod.Text = "c41z1zb6xc";

            SetTypeface.Normal.SetTypeFace(this, IntroducetiCodul);
            SetTypeface.Normal.SetTypeFace(this, Next);
            SetTypeface.Normal.SetTypeFace(this, Cod);

            TcpClient     Client = new TcpClient(_Details.ServerIP, _Details.LargeFilesPort);
            NetworkStream ns     = Client.GetStream();

            _TcpDataExchange.WriteStreamString(ns, CryptDecryptData.CryptData(new string[] { _Details.GetProfilePic, new SaveUsingSharedPreferences(this).LoadString(SaveUsingSharedPreferences.Tags.Login.Username) }));

            int ReadedBytes;

            byte[]       Buffer = new byte[1000];
            MemoryStream ms     = new MemoryStream();

            while ((ReadedBytes = ns.Read(Buffer, 0, Buffer.Length)) > 0)
            {
                ms.Write(Buffer, 0, ReadedBytes);
            }

            Client.Close();
            ns.Dispose();

            Bitmap bitMap = ((BitmapDrawable)DrawableConverter.ByteArrayToDrawable(ms.ToArray(), this)).Bitmap;

            UserProfilePic.SetImageDrawable(new BitmapDrawable(Resources, RoundedBitmap.MakeRound(bitMap, bitMap.Height / 2)));

            TcpClient     client = new TcpClient(_Details.ServerIP, _Details.LargeFilesPort);
            NetworkStream Ns     = client.GetStream();

            _TcpDataExchange.WriteStreamString(Ns, CryptDecryptData.CryptData(new string[] { _Details.GetUserName, new SaveUsingSharedPreferences(this).LoadString(SaveUsingSharedPreferences.Tags.Login.Username) }));
            string NumeUtilizator = CryptDecryptData.DecryptData(_TcpDataExchange.ReadStreamString(Ns))[0];

            UserNume.Text = NumeUtilizator;

            client.Close();
            Ns.Dispose();

            SetTypeface.Normal.SetTypeFace(this, UserNume);
            LeftDrawer.Adapter = new Utilizator_Main_LeftDrawerAdapter(this, new string[] { "Logout" }, Background.Background);

            Next.Click += (object sender, EventArgs e) => {
                TcpClient     OUTPUT_Client = new TcpClient(_Details.ServerIP, _Details.TripPort_INPUT);
                NetworkStream OUTPUT_ns     = OUTPUT_Client.GetStream();
                OUTPUT = new Client(OUTPUT_Client, OUTPUT_ns);

                string NumePrenume  = "nume Prenume";
                string NumarTelefon = new SaveUsingSharedPreferences(this).LoadString(SaveUsingSharedPreferences.Tags.Login.Username);
                string TripId       = Cod.Text;

                _TcpDataExchange.WriteStreamString(OUTPUT_ns, CryptDecryptData.CryptData(new String [] { "TRIPENTER", NumePrenume, NumarTelefon, TripId }));

                List <string> Messages = new List <string>();
                Messages.AddRange(CryptDecryptData.DecryptData(_TcpDataExchange.ReadStreamString(OUTPUT_ns)));
                Messages.Add(TripId);

                TcpClient     INPUT_Client = new TcpClient(_Details.ServerIP, _Details.TripPort_OUTPUT);
                NetworkStream INPUT_ns     = INPUT_Client.GetStream();
                INPUT = new Client(INPUT_Client, INPUT_ns);

                _TcpDataExchange.WriteStreamString(INPUT_ns, CryptDecryptData.CryptData(new String [] { NumePrenume, NumarTelefon, TripId }));

                new SaveUsingSharedPreferences(this).Save(SaveUsingSharedPreferences.Tags.Trip.TipId, TripId);
                Intent StartUtilizatorTrip = new Intent(this, typeof(Utilizator_Trip));
                StartUtilizatorTrip.PutExtra("BackgroundByteArray", DrawableConverter.DrawableToByteArray(Background.Background));
                StartUtilizatorTrip.PutStringArrayListExtra("TripData", Messages);
                StartActivity(StartUtilizatorTrip);
            };
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View v = inflater.Inflate(Resource.Layout.Login_SignUpUsingFacebook_DialogAdapter, null, false);

            Dialog.Window.RequestFeature(WindowFeatures.NoTitle);

            FrameLayout    Container      = v.FindViewById <FrameLayout>(Resource.Id.frameLayout1);
            RelativeLayout Frame          = v.FindViewById <RelativeLayout>(Resource.Id.relativeLayout2);
            TextView       NumeUtilizator = v.FindViewById <TextView>(Resource.Id.textView1);
            ImageView      PozaUtilizator = v.FindViewById <ImageView>(Resource.Id.imageView1);
            ImageView      LeftArrow      = v.FindViewById <ImageView>(Resource.Id.imageView2);
            ImageView      RightArrow     = v.FindViewById <ImageView>(Resource.Id.imageView3);

            ActualFragment = v.FindViewById <TextView>(Resource.Id.textView2);

            SetTypeface.Normal.SetTypeFace(Activity, ActualFragment);
            SetTypeface.Normal.SetTypeFace(Activity, NumeUtilizator);

            HttpWebRequest  request  = (HttpWebRequest)WebRequest.Create(DateUtilizatorNou[5]);
            HttpWebResponse response = (HttpWebResponse)request.GetResponse();

            ProfilePic          = BitmapFactory.DecodeStream(response.GetResponseStream());
            NumeUtilizator.Text = DateUtilizatorNou[0] + " " + DateUtilizatorNou[1];
            PozaUtilizator.SetImageDrawable(new BitmapDrawable(Activity.Resources, RoundedBitmap.MakeRound(ProfilePic, ProfilePic.Height / 2)));

            Login_SignUpUsingFacebook_NumarTelefon NumarTelefon_Fragment = new Login_SignUpUsingFacebook_NumarTelefon();
            Login_SignUpUsingFacebook_TipCont      TipCont_Fragment      = new Login_SignUpUsingFacebook_TipCont();
            Login_SignUpUsingFacebook_Parola       Parola_Fragment       = new Login_SignUpUsingFacebook_Parola();

            Frags = new Fragment[] {
                NumarTelefon_Fragment,
                TipCont_Fragment,
                Parola_Fragment
            };

            var trans = ChildFragmentManager.BeginTransaction();

            trans.Add(Container.Id, Parola_Fragment, "Parola");
            trans.Add(Container.Id, TipCont_Fragment, "TipCont");
            trans.Add(Container.Id, NumarTelefon_Fragment, "NumarTelefon");
            trans.Hide(Parola_Fragment);
            trans.Hide(TipCont_Fragment);
            trans.Commit();

            WindowManagerLayoutParams lp = new WindowManagerLayoutParams();

            lp.CopyFrom(Dialog.Window.Attributes);
            lp.Height = Frame.LayoutParameters.Height;
            lp.Width  = Frame.LayoutParameters.Width;
            lp.Alpha  = 0.8f;

            Dialog.SetCanceledOnTouchOutside(true);
            Dialog.Show();

            Dialog.Window.Attributes = lp;

            RightArrow.Click += RightArrow_Click;
            LeftArrow.Click  += LeftArrow_Click;

            return(v);
        }