Esempio n. 1
0
    public IEnumerator LayoutSampleView2_HiddenBreakView()
    {
        var     sample = @"
        <!DOCTYPE uuebview href='resources://Views/MyInfoView/UUebTags'>
        <body>
            <bg>
                <textbg>
                    <textbox>
                        <updatetext>koko ni nihongo ga iikanji ni hairu. good thing. long text will make large window. like this.</updatetext>
                        <updatetext hidden='true' listen='readmore'>omake!</updatetext>
                    </textbox>
                </textbg>
            </bg>
        </body>";
        TagTree tree   = null;

        yield return(CreateTagTree(sample, tagTreeSource => { tree = tagTreeSource; }));

        var textBox       = tree.GetChildren()[0].GetChildren()[0].GetChildren()[0].GetChildren()[0].GetChildren()[0].GetChildren()[0];
        var updatetextBox = textBox.GetChildren()[0];

        // Debug.LogError("updatetextBox:" + updatetextBox.viewHeight);
        True(textBox.viewHeight == 1950, "not match, textBox.viewHeight:" + textBox.viewHeight);
    }
Esempio n. 2
0
    public IEnumerator SampleView2()
    {
        var     sample = @"
        <!DOCTYPE uuebview href='resources://Views/MyInfoView/UUebTags'>
        <body>
            <bg>
                <titlebox>
                    <titletext>レモン一個ぶんのビタミンC</titletext>
                </titlebox>
                <newbadge></newbadge>
                <textbg>
                    <textbox>
                        <updatetext>1st line.</updatetext>
                    </textbox>
                    <textbox>
                        <updatetext>2nd line.</updatetext>
                    </textbox>
                </textbg>
            </bg>
        </body>";
        TagTree tree   = null;

        yield return(CreateTagTree(sample, tagTreeSource => { tree = tagTreeSource; }));
    }
Esempio n. 3
0
 private void MergeWith(IProcessData process)
 {
     TagTree.MergeWith(process.TagTree);
 }
Esempio n. 4
0
 private void AddTags()
 {
     _tagTreeRootNode = new TreeNode(Strings.tags.Text) {ImageKey = "tags.png"};
     _tagTreeRootNode.SelectedImageKey = _tagTreeRootNode.ImageKey;
     _tagTree = new TagTree(_tagTreeRootNode, UICommandsSource);
     AddTree(_tagTree);
     _searchResult = null;
 }
Esempio n. 5
0
    public IEnumerator RevertLayoutHTMLWithSmallImageAndSmallTextAndBr()
    {
        var sample = @"
        <body><img src='https://dummyimage.com/10.png/09f/fff'/>over 100px string should be multi lined text with good separation.
        <br>need some length.</body>";

        ParsedTree parsedRoot = null;
        {
            var cor = parser.ParseRoot(
                sample,
                parsed =>
            {
                parsedRoot = parsed;
            }
                );

            executor.Core.CoroutineExecutor(cor);

            yield return(WaitUntil(
                             () => parsedRoot != null, () => { throw new TimeoutException("too late."); }, 1
                             ));
        }

        {
            var done = false;

            LayoutMachine layoutMachine = null;

            layoutMachine = new LayoutMachine(
                loader,
                new TMProPlugin()
                );

            var cor = layoutMachine.Layout(
                parsedRoot,
                new Vector2(100, 100),
                layoutedTree =>
            {
                done = true;
                True(layoutedTree.viewHeight == 112, "not match. layoutedTree.viewHeight:" + layoutedTree.viewHeight);
            }
                );
            executor.Core.CoroutineExecutor(cor);


            yield return(WaitUntil(
                             () => done, () => { throw new TimeoutException("too late."); }, 5
                             ));

            TagTree.CorrectTrees(parsedRoot);

            /*
             *  revert-layout.
             */
            var done2 = false;

            var cor2 = layoutMachine.Layout(
                parsedRoot,
                new Vector2(100, 100),
                layoutedTree =>
            {
                done2 = true;
                True(layoutedTree.viewHeight == 112, "not match. actual:" + layoutedTree.viewHeight);
            }
                );

            executor.Core.CoroutineExecutor(cor2);


            yield return(WaitUntil(
                             () => done2, () => { throw new TimeoutException("too late."); }, 5
                             ));
        }
    }
Esempio n. 6
0
        public void Dispose()
        {
            try {

                if (null != dbConnector && dbConnector.IsConnected()) {
                    dbConnector.Disconnect();
                }
                //Common.StopAPI();
            }
            catch (Exception) {

            }
            _mInstance = null;
            tagTree = null;
            tagManager = null;
            dbConnector = null;
            rootNode = null;
            realSubscriber = null;
            //Common.StopAPI();
        }
Esempio n. 7
0
 /// <summary>
 /// 是否连接实时库
 /// </summary>
 /// <returns></returns>
 public Boolean Connection()
 {
     try {
         String serverName = ConfigurationManager.AppSettings["PIServer"];
         //格式:"UID=kkk;PWD="
         String userNameAndpassword = ConfigurationManager.AppSettings["PIConnectionString"];
         if (null == dbConnector) {
             dbConnector = new DbConnector();
         }
         dbConnector.ServerName = serverName;
         String userName = String.Empty;
         String password = String.Empty;
         GetUserIDAndPwd(userNameAndpassword, out userName, out password);
         dbConnector.UserName = userName;
         dbConnector.Password = password;
         dbConnector.TimeOut = 10;  //超时时间,单位为秒
         if (null != dbConnector && dbConnector.IsConnected()) {
             tagTree = TagTree.CreateInstance(dbConnector);
             tagManager = tagTree.GetMgr();
             rootNode = tagTree.GetTreeRoot();
             return true;
         }
         DbError error = dbConnector.Connect();
         if (error.HasErrors) {
             _ErrorInfo = "pSpaceApi类Connect函数出错:" + error.ErrorMessage + ",错误编码为: " + error.ErrorCode;
             return false;
         }
         tagTree = TagTree.CreateInstance(dbConnector);
         tagManager = tagTree.GetMgr();
         rootNode = tagTree.GetTreeRoot();
         return true;
     }
     catch (Exception e) {
         _ErrorInfo = "pSpaceApi类Connect函数异常:" + e.Message + " $$$ " + e.StackTrace;
         return false;
     }
 }