當前位置: 首頁>>代碼示例>>C#>>正文


C# Node.As方法代碼示例

本文整理匯總了C#中SharpKit.Html.Node.As方法的典型用法代碼示例。如果您正苦於以下問題:C# Node.As方法的具體用法?C# Node.As怎麽用?C# Node.As使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SharpKit.Html.Node的用法示例。


在下文中一共展示了Node.As方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: walkChildren

        private void walkChildren(Node parentNode, AbstractBehavior parentBehavior = null)
        {
            var node = parentNode.firstChild;

            if (extensionsToBeApplied == null && (parentNode.nodeType == Node.ELEMENT_NODE)) {
                //We build our extension cache from the first element we find
                entryElement = parentNode.As<HtmlElement>();
                extensionsToBeApplied = styleExtensionManager.getExtensionsForFragment(entryElement);
            }

            while (node != null) {
                investigateNode(node, parentBehavior);
                node = node.nextSibling;
            }
        }
開發者ID:RandoriCSharp,項目名稱:randori-framework,代碼行數:15,代碼來源:DomWalker.cs

示例2: investigateNode

        private void investigateNode(Node node, InjectionClassBuilder classBuilder, AbstractBehavior parentBehavior)
        {
            if (node.nodeType == Node.ELEMENT_NODE) {

                //Just an optimization, need to create constants for all of these things
                if (node.nodeName == "SCRIPT" || node.nodeName == "META") {
                    return;
                }

                if ( node.nodeName == "LINK" ) {
                    investigateLinkElement(node.As<HtmlLinkElement>());
                } else {
                    investigateDomElement(node.As<HtmlElement>(), classBuilder, parentBehavior);
                }

            } else if (node.nodeType == Node.TEXT_NODE) {
                //This is a text node, check to see if it needs internationalization
                localizationProvider.investigateTextNode(node);
            } else {
                walkChildren(node, classBuilder, parentBehavior);
            }
        }
開發者ID:labriola,項目名稱:Randori,代碼行數:22,代碼來源:DomWalker.cs

示例3: investigateNode

        private void investigateNode(Node node, AbstractBehavior parentBehavior)
        {
            if (node.nodeType == Node.ELEMENT_NODE) {

                if (extensionsToBeApplied == null) {
                    //We build our extension cache from the first element we find
                    entryElement = node.As<HtmlElement>();
                    extensionsToBeApplied = styleExtensionManager.getExtensionsForFragment(entryElement);
                }

                //Just an optimization, need to create constants for all of these things.... removed as kendo uses script nodes for templates node.nodeName == "SCRIPT" ||
                if (node.nodeName == "META") {
                    return;
                }

                if ( node.nodeName == "LINK" ) {
                    investigateLinkElement(node.As<HtmlLinkElement>());
                } else {
                    investigateDomElement(node.As<HtmlElement>(), parentBehavior);
                }

            } else if (node.nodeType == Node.TEXT_NODE) {
                //This is a text node, check to see if it needs internationalization
                localizationProvider.investigateTextNode(node);
            } else {
                walkChildren(node, parentBehavior);
            }
        }
開發者ID:RandoriCSharp,項目名稱:randori-framework,代碼行數:28,代碼來源:DomWalker.cs


注:本文中的SharpKit.Html.Node.As方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。