Ejemplo n.º 1
0
        public void TextPageUtilGetText()
        {
            tlog.Debug(tag, $"TextPageUtilGetText START");

            TextPageUtil testingTarget = new TextPageUtil();

            Assert.IsNotNull(testingTarget, "Can't create success object TextPageUtil");
            Assert.IsInstanceOf <TextPageUtil>(testingTarget, "Should be an instance of TextPageUtil type.");

            using (TextLabel label = new TextLabel())
            {
                label.EnableMarkup = true;
                label.Text         = "PublicPageUtilTest";
                var result = testingTarget.SetText(label, "MyPageUtil");
                Assert.IsNotNull(result);

                /** if param is 0 will return */
                try
                {
                    testingTarget.GetText(0);
                }
                catch (Exception e)
                {
                    tlog.Debug(tag, e.Message.ToString());
                    Assert.Fail("Caught Exception: Failed!");
                }

                try
                {
                    testingTarget.GetText(1);
                }
                catch (Exception e)
                {
                    tlog.Debug(tag, e.Message.ToString());
                    Assert.Fail("Caught Exception: Failed!");
                }
            }

            testingTarget.Dispose();
            tlog.Debug(tag, $"TextPageUtilGetText END (OK)");
        }
Ejemplo n.º 2
0
        public void Activate()
        {
            Window window = NUIApplication.GetDefaultWindow();

            label           = new TextLabel();
            label.Size      = new Size(300, 700);
            label.PointSize = 11.0f;
            label.MultiLine = true;

            TextPageUtil util      = new TextPageUtil();
            int          pageCount = util.SetText(label, LoadTerms());

            Tizen.Log.Error("NUI", $"pageCount: {pageCount}\n");
            label.Text = util.GetText(1);
            window.Add(label);
        }