void ReleaseDesignerOutlets()
        {
            if (AircraftLabel != null)
            {
                AircraftLabel.Dispose();
                AircraftLabel = null;
            }

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

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

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

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

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

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

            if (SpecTableView != null)
            {
                SpecTableView.Dispose();
                SpecTableView = null;
            }
        }
Пример #2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            string imageURL = string.Empty;

            if (string.IsNullOrEmpty(Spec.ImagePath))
            {
                SpecImage.Image = UIImage.FromBundle("ad_placeholder.jpg");
            }
            else
            {
                //imageURL = System.Net.WebUtility.UrlEncode("http://images.globalair.com" + Spec.ImagePath);
                string imagePath = Spec.ImagePath;
                imageURL = imagePath.Replace(" ", "%20");
                try
                {
                    SpecImage.SetImage(
                        url: new NSUrl(imageURL),
                        placeholder: UIImage.FromBundle("ad_placeholder.jpg")
                        );
                }
                catch (Exception)
                {
                    SpecImage.Image = UIImage.FromBundle("ad_placeholder.jpg");
                }
            }

            var device = UIDevice.CurrentDevice;

            if (device.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone)
            {
                var font = UIFont.SystemFontOfSize(17);
                AircraftLabel.Font       = UIFont.BoldSystemFontOfSize(17);
                ClassificationLabel.Font = font;
                CategoryLabel.Font       = font;
            }
            AircraftLabel.Text = Spec.Aircraft;

            var labelAttribute = new UIStringAttributes
            {
                Font = UIFont.BoldSystemFontOfSize(device.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone ? 17 : 22)
            };

            string simpleCategoryText = "Category: " + Spec.Category;
            var    categoryString     = new NSMutableAttributedString(simpleCategoryText);

            categoryString.SetAttributes(labelAttribute.Dictionary, new NSRange(0, 10));

            CategoryLabel.AttributedText = categoryString;

            string simpleClassificationText = "Classification: " + Spec.Classification;
            var    classificationString     = new NSMutableAttributedString(simpleClassificationText);

            classificationString.SetAttributes(labelAttribute.Dictionary, new NSRange(0, 15));

            ClassificationLabel.AttributedText = classificationString;
            if (!(Spec.IsConklin == "True"))
            {
                ConklinImageView.Alpha = 0f;
            }

            //SpecDescriptionLabel.Text = Spec.SpecDescription;

            //ResizeHeigthWithText(SpecDescriptionLabel);

            //if (device.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)
            //{
            //	SpecDescriptionLabel.Text = Spec.SpecDescription;
            //}
            //else
            //{
            //	SpecDescriptionLabel.Text = "";
            //}



            //SpecTableView.RowHeight = UITableView.AutomaticDimension;
            //SpecTableView.EstimatedRowHeight = 70f;
            SpecTableView.Source = new SpecTableViewSource1(Spec, this);
        }