Beispiel #1
0
        void ExpiredViewShowAll(NSObject sender)
        {
            float fontSize = 13.0f;

            if (!isExpiredExpand)
            {
                var oldSize = ExpiredView.Frame.Size;
                var newSize = new CGSize(oldSize.Width, expiredViewMaxHeight);
                ExpiredView.SetFrameSize(newSize);
                var subViews             = ExpiredView.Subviews;
                var button               = (NSButton)subViews [subViews.Length - 1]; //对照xib 确定id
                NSAttributedString title = Utility.AttributeTitle("...less", Utility.ColorWithRGB(44, 117, 252, 1.0f), fontSize);
                button.Cell.AttributedTitle = title;

                isExpiredExpand = true;
            }
            else
            {
                var oldSize = ExpiredView.Frame.Size;
                var newSize = new CGSize(oldSize.Width, expiredViewMinHeight);
                ExpiredView.SetFrameSize(newSize);

                var subViews = ExpiredView.Subviews;
                var button   = (NSButton)subViews [subViews.Length - 1];

                NSAttributedString title = Utility.AttributeTitle("...more", Utility.ColorWithRGB(44, 117, 252, 1.0f), fontSize);
                button.Cell.AttributedTitle = title;

                isExpiredExpand = false;
            }

            LayoutSubViews();
        }
Beispiel #2
0
        void InitalizeExpiredView()
        {
            ContactEmailLabel.AttributedTitle = Utility.AttributeTitle("*****@*****.**",
                                                                       NSColor.Blue, 14);
            ContactEmailLabel.AttributedAlternateTitle = Utility.AttributeTitle("*****@*****.**",
                                                                                Utility.ColorWithRGB(77, 151, 250), 14);

            if (BookInfo == null)
            {
                return;
            }

            if (BookInfo.DaysRemaining >= 0)
            {
                ExpiredView.Hidden = true;
            }
            else
            {
                ExpiredView.Hidden = false;
            }

            float  fontSize    = 13.0f;
            string description = "We would like to thank you for choosing LexisNexis to support the great work you do on a daily basis, " +
                                 "and we hope to continue being your legal content provider of choice.\n" +
                                 "To re-subscribe to this content and continue receiving updates please contact your Relationship Manager, " +
                                 "or Customer service on 1800 772 772 or [email protected]. \n" +
                                 "you can tell your command.";

            ExpiredInfoTF.AttributedStringValue = Utility.AttributeLinkTitle(description,
                                                                             "*****@*****.**", Utility.ColorWithHexColorValue("#666666", 0.85f), fontSize);

            //ExpiredInfoTF.StringValue = description;

            nfloat orgHeight = ExpiredInfoTF.Frame.Size.Height;
            nfloat height    = HeightWrappedToWidth(ExpiredInfoTF, fontSize);
            nfloat offset    = height - orgHeight;

            var oldSize = ExpiredView.Frame.Size;

            expiredViewMinHeight = oldSize.Height;
            expiredViewMaxHeight = oldSize.Height + offset;

            if (height > TEXTVIEW_SIXLINE_HEIGHT)
            {
                NSButton moreButton = CreateMoreButton();
                ExpiredView.WantsLayer = true;
                moreButton.Action      = new Selector("ExpiredViewShowAll:");
                moreButton.Target      = this;
                ExpiredView.AddSubview(moreButton);

                isExpiredExpand = false;
            }
            else
            {
                var newSize = new CGSize(oldSize.Width, expiredViewMinHeight + offset);
                ExpiredView.SetFrameSize(newSize);
            }
        }
Beispiel #3
0
        //expire view
        void InitalizeExpiredView()
        {
            LoginUserDetails userDetail = GlobalAccess.Instance.CurrentUserInfo;
            string           email      = userDetail.Country.CustomerSupportEmail;
            string           telephone  = userDetail.Country.CustomerSupportTEL;

            string contactString = "Contact " + telephone + " or " + email;

            ContactPhoneLabel.AllowsEditingTextAttributes = true;
            ContactPhoneLabel.AttributedStringValue       = Utility.AttributeLinkTitle(contactString, email, "Expired", "Support",
                                                                                       Utility.ColorWithHexColorValue("#000000", 0.85f), 14);

//			ContactEmailLabel.AttributedTitle = Utility.AttributeTitle (email,
//				Utility.ColorWithHexColorValue ("#0080fc",0.85f), 14);
//			ContactEmailLabel.AttributedAlternateTitle = Utility.AttributeTitle (email,
//				Utility.ColorWithHexColorValue ("#0080fc",0.45f), 14);

            if (BookInfo == null)
            {
                return;
            }

            if (BookInfo.DaysRemaining >= 0)
            {
                ExpiredView.Hidden = true;
            }
            else
            {
                ExpiredView.Hidden = false;
            }

            DotButton.Cell.BezelStyle       = NSBezelStyle.Circular;
            DotButton.Cell.Bordered         = false;
            DotButton.WantsLayer            = true;
            DotButton.Layer.BackgroundColor = Utility.ColorWithHexColorValue("#ed1c24", 0.85f).CGColor;
            DotButton.Layer.CornerRadius    = 3.5f;

            float  fontSize    = 13.0f;
            string description = string.Format("Your subscription to this title has expired.\n" +
                                               "We want to thank you for choosing LexisNexis to support the great work you do on a daily basis, " +
                                               "and we hope to continue being your legal content provider of choice.\n" +
                                               "To re-subscribe to this content and continue receiving updates, " +
                                               "please contact your Relationship Manager, or " +
                                               "Customer Service on {0} or {1}\n" +
                                               "Should you choose not to resubscribe to this title, there are a few things we want to make sure you're aware of.\n" +
                                               "    ·   This content will no longer receive updates from LexisNexis, \n" +
                                               "        and will be out of date as of the next update.\n" +
                                               "    ·   Annotations made after the expiry of this title will no longer \n" +
                                               "        sync. And could be lost upon subscribing.\n" +
                                               "    ·   If you delete this book from, or lose your device, LexisNexis \n" +
                                               "        is unable to retrieve the content for you.\n" +
                                               "Should you choose to resubscribe to this content, full functionality will be restored, " +
                                               "and content automatically updated to the most recent version.\n" +
                                               "Please don't hesitate to contact your Relationship Manager should you have any questions or concerns regarding this, " +
                                               "or any of your other Red titles.", telephone, email);

            ExpiredInfoTF.AllowsEditingTextAttributes = true;
            ExpiredInfoTF.AttributedStringValue       = Utility.AttributeLinkTitle(description,
                                                                                   email, "Expired", "Support", Utility.ColorWithHexColorValue("#666666", 0.85f), fontSize);

            nfloat orgHeight = ExpiredInfoTF.Frame.Size.Height;
            nfloat height    = HeightWrappedToWidth(ExpiredInfoTF, fontSize);
            nfloat offset    = height - orgHeight;

            var oldSize = ExpiredView.Frame.Size;

            expiredViewMinHeight = oldSize.Height;
            expiredViewMaxHeight = oldSize.Height + offset;

            if (height > TEXTVIEW_SIXLINE_HEIGHT)
            {
                NSButton moreButton = CreateMoreButton();
                ExpiredView.WantsLayer = true;
                moreButton.Action      = new Selector("ExpiredViewShowAll:");
                moreButton.Target      = this;
                ExpiredView.AddSubview(moreButton);

                isExpiredExpand = false;
            }
            else
            {
                var newSize = new CGSize(oldSize.Width, expiredViewMinHeight + offset);
                ExpiredView.SetFrameSize(newSize);
            }
        }