示例#1
0
        public override async void ViewDidLoad()
        {
            base.ViewDidLoad();
            System.Text.Encoding.GetEncoding(1252);
            ScrollViewAbout.ContentSize = new CGSize(0, View.Frame.Height + 1000);
            UIButtonPactiaCom.AddTarget(ButtonEventHandler, UIControlEvent.TouchUpInside);
            UIButtonContactSend.AddTarget(ButtonEventHandler, UIControlEvent.TouchUpInside);
            UIButtonAccepConditions.AddTarget(ButtonEventHandler, UIControlEvent.TouchUpInside);
            UIButtonCallUs.AddTarget(ButtonEventHandler, UIControlEvent.TouchUpInside);

            #region Gestures
            UITapGestureRecognizer UIViewBusiness0Tap = new UITapGestureRecognizer(() =>
            {
                VideoViewController viewController = this.Storyboard.InstantiateViewController("VideoViewControllerId") as VideoViewController;
                this.NavigationController.PushViewController(viewController, true);
            });
            UIImageViewPactiaVideo.UserInteractionEnabled = true;
            UIImageViewPactiaVideo.AddGestureRecognizer(UIViewBusiness0Tap);

            UITapGestureRecognizer UIViewFacebookTap = new UITapGestureRecognizer(() =>
            {
                iOSFunctions.OpenUrl(@"https://www.facebook.com/pactiaoficial/");
            });
            UIImageViewFacebook.UserInteractionEnabled = true;
            UIImageViewFacebook.AddGestureRecognizer(UIViewFacebookTap);

            UITapGestureRecognizer UIViewInstagramTap = new UITapGestureRecognizer(() =>
            {
                iOSFunctions.OpenUrl(@"https://www.instagram.com/pactiaoficial/");
            });
            UIImageViewInstagram.UserInteractionEnabled = true;
            UIImageViewInstagram.AddGestureRecognizer(UIViewInstagramTap);

            UITapGestureRecognizer UIViewLinkedlnTap = new UITapGestureRecognizer(() =>
            {
                iOSFunctions.OpenUrl(@"https://www.linkedin.com/company/pactia");
            });
            UIImageViewLinkedln.UserInteractionEnabled = true;
            UIImageViewLinkedln.AddGestureRecognizer(UIViewLinkedlnTap);

            UITapGestureRecognizer UIViewYoutubeTap = new UITapGestureRecognizer(() =>
            {
                iOSFunctions.OpenUrl(@"https://www.youtube.com/channel/UCFH_l8cOLR-1FiS021ena2Q");
            });
            UIImageViewYoutube.UserInteractionEnabled = true;
            UIImageViewYoutube.AddGestureRecognizer(UIViewYoutubeTap);

            UITapGestureRecognizer UIViewBusiness2Tap = new UITapGestureRecognizer(() =>
            {
                iOSFunctions.OpenUrl(@"https://pactia.com/linea-negocio/comercio/");
            });
            UIViewBusiness2.UserInteractionEnabled = true;
            UIViewBusiness2.AddGestureRecognizer(UIViewBusiness2Tap);

            UITapGestureRecognizer UIViewBusiness3Tap = new UITapGestureRecognizer(() =>
            {
                iOSFunctions.OpenUrl(@"https://pactia.com/linea-negocio/oficinas/");
            });
            UIViewBusiness3.UserInteractionEnabled = true;
            UIViewBusiness3.AddGestureRecognizer(UIViewBusiness3Tap);
            UITapGestureRecognizer UIViewBusiness4Tap = new UITapGestureRecognizer(() =>
            {
                iOSFunctions.OpenUrl(@"https://pactia.com/linea-negocio/autoalmacenamiento/");
            });
            UIViewBusiness4.UserInteractionEnabled = true;
            UIViewBusiness4.AddGestureRecognizer(UIViewBusiness4Tap);
            UITapGestureRecognizer UIViewBusiness5Tap = new UITapGestureRecognizer(() =>
            {
                iOSFunctions.OpenUrl(@"https://pactia.com/linea-negocio/hoteles/");
            });
            UIViewBusiness5.UserInteractionEnabled = true;
            UIViewBusiness5.AddGestureRecognizer(UIViewBusiness5Tap);
            UITapGestureRecognizer UIViewBusiness6Tap = new UITapGestureRecognizer(() =>
            {
                iOSFunctions.OpenUrl(@"https://pactia.com/linea-negocio/multifamily/");
            });
            UIViewBusiness6.UserInteractionEnabled = true;
            UIViewBusiness6.AddGestureRecognizer(UIViewBusiness6Tap);

            UITapGestureRecognizer UIViewBusiness7Tap = new UITapGestureRecognizer(() =>
            {
                BusinessLineContectViewController viewController = this.Storyboard.InstantiateViewController("BusinessLineContectViewControllerId") as BusinessLineContectViewController;
                viewController.BusinessName = "Logistica";
                viewController.Latitude     = "4.760737";
                viewController.Longitude    = "-74.165095";
                this.NavigationController.PushViewController(viewController, true);
            });
            UIViewBusiness1.UserInteractionEnabled = true;
            UIViewBusiness1.AddGestureRecognizer(UIViewBusiness7Tap);



            this.View.AddGestureRecognizer(new UITapGestureRecognizer(tap =>
            {
                View.EndEditing(true);
            })
            {
                NumberOfTapsRequired = 1
            });
            #endregion

            IsInternetConnectionAvailable = SharedFunctions.CheckInternetConnection();
            if (IsInternetConnectionAvailable == true)
            {
                try
                {
                    var bounds = UIScreen.MainScreen.Bounds;
                    loadingIndicator = new LoadingIndicator(bounds, "Cargando contenido...");
                    View.Add(loadingIndicator);
                    await Task.Delay(10);

                    LoadUILabelText(UILabelPactiaTitle, "CONÓCENOS");
                    UIImageViewPactiaVideo.Image = UIImage.FromFile("videobackground.jpg");

                    Galeria galeria = service.HttpGet <Galeria>(constants.Url, constants.GaleriaController, constants.GaleriaMethod, "code=01");
                    ImageService.Instance.LoadUrl(galeria.Url).Into(UIImageViewBusiness1);
                    Lineas lineas = service.HttpGet <Lineas>(constants.Url, constants.LineaController, constants.LineaMethod, "code=01");
                    LoadUILabelText(UILabelBusiness1Title, lineas.Nombre);
                    LoadUILabelText(UILabelBusiness1Description, lineas.Texto2);
                    UIImageViewBusiness1Logo.Image = UIImage.FromFile("logikalogo.png");

                    galeria = service.HttpGet <Galeria>(constants.Url, constants.GaleriaController, constants.GaleriaMethod, "code=02");
                    ImageService.Instance.LoadUrl(galeria.Url).Into(UIImageViewBusiness2);
                    lineas = service.HttpGet <Lineas>(constants.Url, constants.LineaController, constants.LineaMethod, "code=02");
                    LoadUILabelText(UILabelBusiness2Title, lineas.Nombre);
                    LoadUILabelText(UILabelBusiness2Description, lineas.Texto2);
                    UIImageViewBusiness2Logo.Image = UIImage.FromFile("logogranplaza.png");

                    galeria = service.HttpGet <Galeria>(constants.Url, constants.GaleriaController, constants.GaleriaMethod, "code=03");
                    ImageService.Instance.LoadUrl(galeria.Url).Into(UIImageViewBusiness3);
                    lineas = service.HttpGet <Lineas>(constants.Url, constants.LineaController, constants.LineaMethod, "code=03");
                    LoadUILabelText(UILabelBusiness3Title, lineas.Nombre);
                    LoadUILabelText(UILabelBusiness3Description, lineas.Texto2);
                    UIImageViewBusiness3Logo.Image = UIImage.FromFile("burologo.png");

                    galeria = service.HttpGet <Galeria>(constants.Url, constants.GaleriaController, constants.GaleriaMethod, "code=77");
                    ImageService.Instance.LoadUrl(galeria.Url).Into(UIImageViewBusiness4);
                    lineas = service.HttpGet <Lineas>(constants.Url, constants.LineaController, constants.LineaMethod, "code=05");
                    LoadUILabelText(UILabelBusiness4Title, lineas.Nombre);
                    LoadUILabelText(UILabelBusiness4Description, lineas.Texto2);
                    UIImageViewBusiness4Logo.Image = UIImage.FromFile("ustoragelogo.png");

                    galeria = service.HttpGet <Galeria>(constants.Url, constants.GaleriaController, constants.GaleriaMethod, "code=04");
                    ImageService.Instance.LoadUrl(galeria.Url).Into(UIImageViewBusiness5);
                    lineas = service.HttpGet <Lineas>(constants.Url, constants.LineaController, constants.LineaMethod, "code=04");
                    LoadUILabelText(UILabelBusiness5Title, lineas.Nombre);
                    LoadUILabelText(UILabelBusiness5Description, lineas.Texto2);

                    galeria = service.HttpGet <Galeria>(constants.Url, constants.GaleriaController, constants.GaleriaMethod, "code=78");
                    ImageService.Instance.LoadUrl(galeria.Url).Into(UIImageViewBusiness6);
                    lineas = service.HttpGet <Lineas>(constants.Url, constants.LineaController, constants.LineaMethod, "code=07");
                    LoadUILabelText(UILabelBusiness6Title, lineas.Nombre);
                    LoadUILabelText(UILabelBusiness6Description, lineas.Texto2);
                    UIButtonPactiaCom.Hidden = false;

                    var Panama      = new MKPointAnnotation();
                    var PanamaCoord = new CLLocationCoordinate2D(9.131443, -79.681025);
                    Panama.Title      = "Panamá";
                    Panama.Coordinate = PanamaCoord;

                    var Colombia      = new MKPointAnnotation();
                    var ColombiaCoord = new CLLocationCoordinate2D(5.156853, -74.039258);
                    Colombia.Title      = "Colombia";
                    Colombia.Coordinate = ColombiaCoord;

                    var Usa      = new MKPointAnnotation();
                    var UsaCoord = new CLLocationCoordinate2D(40.343302, -102.066399);
                    Usa.Title      = "Estados Unidos";
                    Usa.Coordinate = UsaCoord;

                    MKPointAnnotation[] CoordArray = new MKPointAnnotation[3];
                    CoordArray[0] = Panama;
                    CoordArray[1] = Colombia;
                    CoordArray[2] = Usa;
                    MKMapViewAbout.AddAnnotations(CoordArray);

                    var locationCoordinate = new CLLocationCoordinate2D(25.688297, -100.324346);
                    var coordinateSpan     = new MKCoordinateSpan(50, 80);
                    var coordinateRegion   = new MKCoordinateRegion(locationCoordinate, coordinateSpan);
                    MKMapViewAbout.SetRegion(coordinateRegion, true);
                    loadingIndicator.Hide();
                }
                catch (Exception ex)
                {
                    ExceptionAlert("Alerta", ex.Message);
                }
            }
            else
            {
                var okCancelAlertController = UIAlertController.Create("Alerta", "Por favor verifique su conexión a internet e intenta nuevamente", UIAlertControllerStyle.Alert);
                okCancelAlertController.AddAction(UIAlertAction.Create("Ok", UIAlertActionStyle.Cancel, alert => Environment.Exit(0)));
                PresentViewController(okCancelAlertController, true, null);
            }
            float scrollViewHeight = 0.0f;
            float scrollViewWidth  = 0.0f;
            foreach (UIView view in ScrollViewAbout.Subviews)
            {
                scrollViewWidth  += (float)view.Frame.Size.Width;
                scrollViewHeight += (float)view.Frame.Size.Height;
            }
            ScrollViewAbout.ContentSize = new CGSize(0, scrollViewHeight + View.Frame.Height + 1500);
        }
示例#2
0
        void ReleaseDesignerOutlets()
        {
            if (MKMapViewAbout != null)
            {
                MKMapViewAbout.Dispose();
                MKMapViewAbout = null;
            }

            if (ScrollViewAbout != null)
            {
                ScrollViewAbout.Dispose();
                ScrollViewAbout = null;
            }

            if (UIButtonAccepConditions != null)
            {
                UIButtonAccepConditions.Dispose();
                UIButtonAccepConditions = null;
            }

            if (UIButtonCallUs != null)
            {
                UIButtonCallUs.Dispose();
                UIButtonCallUs = null;
            }

            if (UIButtonContactSend != null)
            {
                UIButtonContactSend.Dispose();
                UIButtonContactSend = null;
            }

            if (UIButtonPactiaCom != null)
            {
                UIButtonPactiaCom.Dispose();
                UIButtonPactiaCom = null;
            }

            if (UIImageViewBusiness1 != null)
            {
                UIImageViewBusiness1.Dispose();
                UIImageViewBusiness1 = null;
            }

            if (UIImageViewBusiness1Logo != null)
            {
                UIImageViewBusiness1Logo.Dispose();
                UIImageViewBusiness1Logo = null;
            }

            if (UIImageViewBusiness2 != null)
            {
                UIImageViewBusiness2.Dispose();
                UIImageViewBusiness2 = null;
            }

            if (UIImageViewBusiness2Logo != null)
            {
                UIImageViewBusiness2Logo.Dispose();
                UIImageViewBusiness2Logo = null;
            }

            if (UIImageViewBusiness3 != null)
            {
                UIImageViewBusiness3.Dispose();
                UIImageViewBusiness3 = null;
            }

            if (UIImageViewBusiness3Logo != null)
            {
                UIImageViewBusiness3Logo.Dispose();
                UIImageViewBusiness3Logo = null;
            }

            if (UIImageViewBusiness4 != null)
            {
                UIImageViewBusiness4.Dispose();
                UIImageViewBusiness4 = null;
            }

            if (UIImageViewBusiness4Logo != null)
            {
                UIImageViewBusiness4Logo.Dispose();
                UIImageViewBusiness4Logo = null;
            }

            if (UIImageViewBusiness5 != null)
            {
                UIImageViewBusiness5.Dispose();
                UIImageViewBusiness5 = null;
            }

            if (UIImageViewBusiness5Logo != null)
            {
                UIImageViewBusiness5Logo.Dispose();
                UIImageViewBusiness5Logo = null;
            }

            if (UIImageViewBusiness6 != null)
            {
                UIImageViewBusiness6.Dispose();
                UIImageViewBusiness6 = null;
            }

            if (UIImageViewBusiness6Logo != null)
            {
                UIImageViewBusiness6Logo.Dispose();
                UIImageViewBusiness6Logo = null;
            }

            if (UIImageViewFacebook != null)
            {
                UIImageViewFacebook.Dispose();
                UIImageViewFacebook = null;
            }

            if (UIImageViewInstagram != null)
            {
                UIImageViewInstagram.Dispose();
                UIImageViewInstagram = null;
            }

            if (UIImageViewLinkedln != null)
            {
                UIImageViewLinkedln.Dispose();
                UIImageViewLinkedln = null;
            }

            if (UIImageViewPactiaVideo != null)
            {
                UIImageViewPactiaVideo.Dispose();
                UIImageViewPactiaVideo = null;
            }

            if (UIImageViewYoutube != null)
            {
                UIImageViewYoutube.Dispose();
                UIImageViewYoutube = null;
            }

            if (UILabelBusiness1Description != null)
            {
                UILabelBusiness1Description.Dispose();
                UILabelBusiness1Description = null;
            }

            if (UILabelBusiness1Title != null)
            {
                UILabelBusiness1Title.Dispose();
                UILabelBusiness1Title = null;
            }

            if (UILabelBusiness2Description != null)
            {
                UILabelBusiness2Description.Dispose();
                UILabelBusiness2Description = null;
            }

            if (UILabelBusiness2Title != null)
            {
                UILabelBusiness2Title.Dispose();
                UILabelBusiness2Title = null;
            }

            if (UILabelBusiness3Description != null)
            {
                UILabelBusiness3Description.Dispose();
                UILabelBusiness3Description = null;
            }

            if (UILabelBusiness3Title != null)
            {
                UILabelBusiness3Title.Dispose();
                UILabelBusiness3Title = null;
            }

            if (UILabelBusiness4Description != null)
            {
                UILabelBusiness4Description.Dispose();
                UILabelBusiness4Description = null;
            }

            if (UILabelBusiness4Title != null)
            {
                UILabelBusiness4Title.Dispose();
                UILabelBusiness4Title = null;
            }

            if (UILabelBusiness5Description != null)
            {
                UILabelBusiness5Description.Dispose();
                UILabelBusiness5Description = null;
            }

            if (UILabelBusiness5Title != null)
            {
                UILabelBusiness5Title.Dispose();
                UILabelBusiness5Title = null;
            }

            if (UILabelBusiness6Description != null)
            {
                UILabelBusiness6Description.Dispose();
                UILabelBusiness6Description = null;
            }

            if (UILabelBusiness6Title != null)
            {
                UILabelBusiness6Title.Dispose();
                UILabelBusiness6Title = null;
            }

            if (UILabelPactiaTitle != null)
            {
                UILabelPactiaTitle.Dispose();
                UILabelPactiaTitle = null;
            }

            if (UISwitchContactAcceptConditions != null)
            {
                UISwitchContactAcceptConditions.Dispose();
                UISwitchContactAcceptConditions = null;
            }

            if (UITextFieldContactUser != null)
            {
                UITextFieldContactUser.Dispose();
                UITextFieldContactUser = null;
            }

            if (UITextFileldContactBusinessName != null)
            {
                UITextFileldContactBusinessName.Dispose();
                UITextFileldContactBusinessName = null;
            }

            if (UITextFileldContactEmail != null)
            {
                UITextFileldContactEmail.Dispose();
                UITextFileldContactEmail = null;
            }

            if (UITextFileldContactMessage != null)
            {
                UITextFileldContactMessage.Dispose();
                UITextFileldContactMessage = null;
            }

            if (UITextFileldContactPhoneNumber != null)
            {
                UITextFileldContactPhoneNumber.Dispose();
                UITextFileldContactPhoneNumber = null;
            }

            if (UIViewBusiness1 != null)
            {
                UIViewBusiness1.Dispose();
                UIViewBusiness1 = null;
            }

            if (UIViewBusiness2 != null)
            {
                UIViewBusiness2.Dispose();
                UIViewBusiness2 = null;
            }

            if (UIViewBusiness3 != null)
            {
                UIViewBusiness3.Dispose();
                UIViewBusiness3 = null;
            }

            if (UIViewBusiness4 != null)
            {
                UIViewBusiness4.Dispose();
                UIViewBusiness4 = null;
            }

            if (UIViewBusiness5 != null)
            {
                UIViewBusiness5.Dispose();
                UIViewBusiness5 = null;
            }

            if (UIViewBusiness6 != null)
            {
                UIViewBusiness6.Dispose();
                UIViewBusiness6 = null;
            }

            if (UIViewSocial != null)
            {
                UIViewSocial.Dispose();
                UIViewSocial = null;
            }
        }