コード例 #1
0
        void ReleaseDesignerOutlets()
        {
            if (ActionButton != null)
            {
                ActionButton.Dispose();
                ActionButton = null;
            }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if (ExpireInfoDetailTextView != null)
            {
                ExpireInfoDetailTextView.Dispose();
                ExpireInfoDetailTextView = null;
            }
        }
コード例 #2
0
        private void ShowPublicationCoverAndActionButton()
        {
            var pvInList = AppDisplayUtil.Instance.AppDelegateInstance.PublicationViewList.Find(item => item.P.BookId == curPublication.BookId);

            PublicationView pv = PublicationViewFactory.CreatePublicationView(curPublication, pvInList.StartDownload, pvInList.ShowDownloadAlert, 0.85f);

            pv.ZoomInOrOut(0.85f);
            PublicationCoverContainer.AddSubview(pv);

            PublicationNameLabel.Text = curPublication.Name;
            CGSize publicationNameLabelSize = TextDisplayUtil.GetStringBoundRect(curPublication.Name, UIFont.SystemFontOfSize(ViewConstant.INFO_NAME_LABEL_FONT_SIZE), new CGSize(ViewConstant.INFO_AUTHOR_LABEL_WIDTH, 600));
            nfloat expectedNameLabelHeight  = publicationNameLabelSize.Height > 26 ? publicationNameLabelSize.Height : 26;

            ChangeViewHeightConstraint(PublicationNameLabel, expectedNameLabelHeight);

            PublicationAuthorLabel.Text = curPublication.Author;
            CGSize publicationAuthorLabelSize = TextDisplayUtil.GetStringBoundRect(curPublication.Author, UIFont.SystemFontOfSize(ViewConstant.INFO_AUTHOR_LABEL_FONT_SIZE), new CGSize(ViewConstant.INFO_AUTHOR_LABEL_WIDTH, 600));
            nfloat expectedAuthorLabelHeight  = publicationAuthorLabelSize.Height < ViewConstant.INFO_AUTHOR_LABEL_MIN_HEIGHT ? ViewConstant.INFO_AUTHOR_LABEL_MIN_HEIGHT : publicationAuthorLabelSize.Height;

            ChangeViewHeightConstraint(PublicationAuthorLabel, expectedAuthorLabelHeight);

            ActionButton.Layer.BorderWidth  = 1.0f;
            ActionButton.Layer.CornerRadius = 5;

            if (curPublication.DaysRemaining < 0)
            {
                ActionButton.Layer.BorderColor = UIColor.Red.CGColor;
                ActionButton.SetTitleColor(UIColor.Red, UIControlState.Normal);
            }
            else
            {
                ActionButton.Layer.BorderColor = UIColor.FromRGB(22, 132, 250).CGColor;
                ActionButton.SetTitleColor(UIColor.FromRGB(22, 132, 250), UIControlState.Normal);
            }

            if (curPublication.IsLoan)
            {
                LoanTagLabel.Layer.CornerRadius  = 8;
                LoanTagLabel.Layer.MasksToBounds = true;

                ChangeViewWidthConstraint(LoanTagLabel, ViewConstant.INFO_LOAN_TAG_LABEL_WIDTH);
                ChangeViewWidthConstraint(TagSpaceLabel, 10);
            }
            else
            {
                ChangeViewWidthConstraint(LoanTagLabel, 0);
                ChangeViewWidthConstraint(TagSpaceLabel, 0);
            }

            if (curPublication.IsFTC)
            {
                PlusCaseTagLabel.Layer.CornerRadius  = 8;
                PlusCaseTagLabel.Layer.MasksToBounds = true;
                PlusCaseTagLabel.Hidden = false;
            }
            else
            {
                PlusCaseTagLabel.Hidden = true;
            }

            nfloat expectedTitleAuthorScrollViewContentHeight = expectedAuthorLabelHeight + expectedNameLabelHeight + 34;

            if (expectedTitleAuthorScrollViewContentHeight > ViewConstant.INFO_NAME_AUTHOR_SCROLL_VIEW_MAX_HEIGHT)
            {
                ChangeViewHeightConstraint(TitleAuthorScrollView, ViewConstant.INFO_NAME_AUTHOR_SCROLL_VIEW_MAX_HEIGHT);
                TitleAuthorScrollView.ScrollEnabled = true;
            }
            else
            {
                ChangeViewHeightConstraint(TitleAuthorScrollView, expectedTitleAuthorScrollViewContentHeight);
                TitleAuthorScrollView.ScrollEnabled = false;
            }
            TitleAuthorScrollView.ContentSize = new CGSize(ViewConstant.INFO_AUTHOR_LABEL_WIDTH, expectedTitleAuthorScrollViewContentHeight);
            TitleAuthorScrollView.SetContentOffset(new CGPoint(0, 0), false);
        }