• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ElementNode类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ElementNode的典型用法代码示例。如果您正苦于以下问题:C# ElementNode类的具体用法?C# ElementNode怎么用?C# ElementNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ElementNode类属于命名空间,在下文中一共展示了ElementNode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: _SearchBranchForFilters

        private void _SearchBranchForFilters(ElementNode node, IEnumerable<ISequenceFilterNode> filters,
            Stack<IEnumerable<ISequenceFilterNode>> filtersFound, SequenceFilterLookup lookup)
        {
            // Must push a single value for each level we enter.
            ISequenceFilterNode[] sequenceFilterNodes = _GetFiltersForNode(node, filters);
            if (sequenceFilterNodes.Length > 0) {
                filtersFound.Push(sequenceFilterNodes);
            }
            else {
                filtersFound.Push(null);
            }

            if (node.IsLeaf) {
                ISequenceFilterNode[] elementFilters = filtersFound.Where(x => x != null).Reverse().SelectMany(x => x).ToArray();
                if (elementFilters.Length > 0) {
                    lookup.AddElementFilters(node.Element, elementFilters);
                }
            }
            else {
                foreach (ElementNode childNode in node.Children) {
                    _SearchBranchForFilters(childNode, filters, filtersFound, lookup);
                }
            }

            // Pop a single value for every level we exit.
            filtersFound.Pop();
        }
开发者ID:stewmc,项目名称:vixen,代码行数:27,代码来源:SequenceFilterService.cs


示例2: IsEnabled

        private static bool IsEnabled(ElementNode element)
        {
            if (element.Name != "img")
                return false;

            return element.GetAttribute("src", true) != null;
        }
开发者ID:Nangal,项目名称:WebEssentials2013,代码行数:7,代码来源:OptimizeImageSmartTag.cs


示例3: PopulateGeneralNodeInfo

		private void PopulateGeneralNodeInfo(ElementNode node)
		{
			if (node == null) {
				labelParents.Text = string.Empty;
				_tooltip.SetToolTip(labelParents, null);
				textBoxName.Text = string.Empty;
			}
			else {
				// update the label with parent info about the node. Any good suggestions or improvements for this?
				int parentCount = GetNodeParentGroupCount(node);
				List<string> parents = GetNodeParentGroupNames(node);
				string labelString = string.Empty, tooltipString = string.Empty;
				labelString = string.Format("This element is in {0} group{1}{2}", parentCount, ((parentCount != 1) ? "s" : string.Empty),
				                            ((parentCount == 0) ? "." : ": "));
				tooltipString = labelString + "\r\n\r\n";
				foreach (string p in parents) {
					labelString = string.Format("{0}{1}, ", labelString, p);
					tooltipString = string.Format("{0}{1}\r\n", tooltipString, p);
				}
				labelParents.Text = labelString.TrimEnd(new char[] {' ', ','});
				tooltipString = tooltipString.TrimEnd(new char[] {'\r', '\n'});
				if (labelString.Length > 100) {
					_tooltip.SetToolTip(labelParents, tooltipString);
				}
				else {
					_tooltip.SetToolTip(labelParents, null);
				}

				textBoxName.Text = node.Name;
			}
		}
开发者ID:stewmc,项目名称:vixen,代码行数:31,代码来源:ConfigElements.cs


示例4: ElementNode

 internal ElementNode(string name, string prefix, string xmlns, ElementNode parent)
 {
     this.name = name;
     this.prefix = prefix;
     this.xmlns = xmlns;
     this.parent = parent;
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:7,代码来源:TraceXPathNavigator.cs


示例5: PreviewIcicle

        //const int InitialStringLength = 20;

		public PreviewIcicle(PreviewPoint point1, PreviewPoint point2, ElementNode selectedNode, double zoomLevel)
		{
            // If we are creating this fresh, we need to know so we can add strings, etc. as drawn.
            creating = true;
            initialNode = selectedNode;

			ZoomLevel = zoomLevel;
			AddPoint(PointToZoomPoint(point1));
			AddPoint(PointToZoomPoint(point2));

			if (selectedNode != null) {
				if (selectedNode.Children.Count() > 0 && PreviewTools.GetLeafNodes(selectedNode).Count == 0) 
				{
					StringType = StringTypes.Pixel;
                    _strings = new List<PreviewBaseShape>();
                    foreach (ElementNode child in selectedNode.Children)
                    {
                        int pixelCount = child.Children.Count();
                        PreviewLine line = new PreviewLine(new PreviewPoint(10, 10), new PreviewPoint(10, 10), pixelCount, child, ZoomLevel);
                        line.Parent = this;
                        _strings.Add(line);
                    }
                    _stringCount = _strings.Count;
                    creating = false;
				} else
                {
					StringType = StringTypes.Standard;
				}
			}
			Layout();
		}
开发者ID:stewmc,项目名称:vixen,代码行数:33,代码来源:PreviewIcicle.cs


示例6: RenderNode

        // renders the given node to the internal ElementData dictionary. If the given node is
        // not a element, will recursively descend until we render its elements.
        public static EffectIntents RenderNode(ElementNode node, Curve levelCurve, ColorGradient colorGradient, TimeSpan duration, bool isDiscrete, bool allowZeroIntensity = false)
        {
            //Collect all the points first.
            double[] allPointsTimeOrdered = _GetAllSignificantDataPoints(levelCurve, colorGradient).ToArray();
            var elementData = new EffectIntents();
            foreach (ElementNode elementNode in node.GetLeafEnumerator())
            {
                // this is probably always going to be a single element for the given node, as
                // we have iterated down to leaf nodes in RenderNode() above. May as well do
                // it this way, though, in case something changes in future.
                if (elementNode == null || elementNode.Element == null)
                    continue;

                //ElementColorType colorType = ColorModule.getColorTypeForElementNode(elementNode);

                if (isDiscrete && IsElementDiscrete(node))
                {
                    IEnumerable<Color> colors = ColorModule.getValidColorsForElementNode(elementNode, false)
                         .Intersect(colorGradient.GetColorsInGradient());
                    foreach (Color color in colors)
                    {
                        AddIntentsToElement(elementNode.Element, allPointsTimeOrdered, levelCurve, colorGradient, duration, elementData, allowZeroIntensity, color);
                    }
                }
                else
                {
                    AddIntentsToElement(elementNode.Element, allPointsTimeOrdered, levelCurve, colorGradient, duration, elementData, allowZeroIntensity);
                }
            }

            return elementData;
        }
开发者ID:jaredb7,项目名称:vixen,代码行数:34,代码来源:PulseRenderer.cs


示例7: RenderNode

        // renders the given node to the internal ElementData dictionary. If the given node is
        // not a element, will recursively descend until we render its elements.
        private void RenderNode(ElementNode node)
        {
            foreach(Element element in node) {
                // this is probably always going to be a single element for the given node, as
                // we have iterated down to leaf nodes in RenderNode() above. May as well do
                // it this way, though, in case something changes in future.
                if (element == null)
                    continue;

                double[] allPointsTimeOrdered = _GetAllSignificantDataPoints().ToArray();
                Debug.Assert(allPointsTimeOrdered.Length > 1);

                double lastPosition = allPointsTimeOrdered[0];
                for(int i=1; i<allPointsTimeOrdered.Length; i++) {
                    double position = allPointsTimeOrdered[i];

                    LightingValue startValue = new LightingValue(ColorGradient.GetColorAt(lastPosition), (float)LevelCurve.GetValue(lastPosition * 100) / 100);
                    LightingValue endValue = new LightingValue(ColorGradient.GetColorAt(position), (float)LevelCurve.GetValue(position * 100) / 100);

                    TimeSpan startTime = TimeSpan.FromMilliseconds(TimeSpan.TotalMilliseconds * lastPosition);
                    TimeSpan timeSpan = TimeSpan.FromMilliseconds(TimeSpan.TotalMilliseconds * (position - lastPosition));

                    IIntent intent = new LightingIntent(startValue, endValue, timeSpan);

                    _elementData.AddIntentForElement(element.Id, intent, startTime);

                    lastPosition = position;
                }
            }
        }
开发者ID:alphageek-gb,项目名称:vixen-modules,代码行数:32,代码来源:Pulse.cs


示例8: Transform

 protected void Transform(ElementNode elementNode, IList<Node> body)
 {
     foreach (IReplacement replacement in replacements)
     {
         replacement.DoReplace(elementNode, body);
     }
 }
开发者ID:RobertTheGrey,项目名称:OpenRasta.Codecs.Spark,代码行数:7,代码来源:SparkExtension.cs


示例9: IsEnabled

        private static bool IsEnabled(ElementNode element)
        {
            if (element.Name != "img")
                return false;

            return element.HasAttribute("src");
        }
开发者ID:Gordon-Beeming,项目名称:WebEssentials2013,代码行数:7,代码来源:OptimizeImageSmartTag.cs


示例10: RenderNode

        // renders the given node to the internal ElementData dictionary. If the given node is
        // not a element, will recursively descend until we render its elements.
        protected override void RenderNode(ElementNode node)
        {
            if (!AudioUtilities.AudioLoaded)
                return;

            foreach (ElementNode elementNode in node.GetLeafEnumerator()) {
                // this is probably always going to be a single element for the given node, as
                // we have iterated down to leaf nodes in RenderNode() above. May as well do
                // it this way, though, in case something changes in future.
                if (elementNode == null || elementNode.Element == null)
                    continue;
                bool discreteColors = ColorModule.isElementNodeDiscreteColored(elementNode);

                for(int i = 0;i<(int)((TimeSpan.TotalMilliseconds/Spacing)-1);i++)
                {

                    double gradientPosition1 = (AudioUtilities.VolumeAtTime(i * Spacing) + Data.Range)/Data.Range ;
                    double gradientPosition2 = (AudioUtilities.VolumeAtTime((i+1) * Spacing) + Data.Range)/Data.Range;
                    if (gradientPosition1 <= 0)
                        gradientPosition1 = 0;
                    if (gradientPosition1 >= 1)
                        gradientPosition1 = 1;

                    //Some odd corner cases
                    if (gradientPosition2 <= 0)
                        gradientPosition2 = 0;
                    if (gradientPosition2 >= 1)
                        gradientPosition2 = 1;
                    TimeSpan startTime = TimeSpan.FromMilliseconds(i * Spacing);
                    ElementData.Add(GenerateEffectIntents(elementNode, WorkingGradient, MeterIntensityCurve, gradientPosition1, gradientPosition2, TimeSpan.FromMilliseconds(Spacing), startTime, discreteColors));

                }

            }
        }
开发者ID:jaredb7,项目名称:vixen,代码行数:37,代码来源:VUMeter.cs


示例11: AddAttribute

 protected static void AddAttribute(ElementNode elementNode, string attributeName, Node childNode)
 {
     elementNode.RemoveAttributesByName(attributeName);
     elementNode.Attributes.Add(
         new AttributeNode(
             attributeName,
             new List<Node> { childNode }));
 }
开发者ID:RobertTheGrey,项目名称:OpenRasta.Codecs.Spark,代码行数:8,代码来源:SpecifiedReplacement.cs


示例12: PreviewMultiString

 public PreviewMultiString(PreviewPoint point1, PreviewPoint point2, ElementNode selectedNode, double zoomLevel)
 {
     ZoomLevel = zoomLevel;
     AddPoint(PointToZoomPoint(point1));
     _strings = new List<PreviewBaseShape>();
     Creating = true;
     inputElements = selectedNode;
 }
开发者ID:forkineye,项目名称:vixen,代码行数:8,代码来源:PreviewMultiString.cs


示例13: TryCreateSmartTag

        public IHtmlSmartTag TryCreateSmartTag(ITextView textView, ITextBuffer textBuffer, ElementNode element, AttributeNode attribute, int caretPosition, HtmlPositionType positionType)
        {
            if (element.GetAttribute("class") == null)
            {
                return new $safeitemname$SmartTag(textView, textBuffer, element);
            }

            return null;
        }
开发者ID:GProulx,项目名称:side-waffle,代码行数:9,代码来源:AddClassSmartTag.cs


示例14: GetApplicableReplacements

 private static IEnumerable<IReplacement> GetApplicableReplacements(ElementNode node)
 {
     var result = new List<IReplacement>();
     
     result.AddRange(UriReplacementSpecifications.GetMatching(node));
     result.AddRange(FormReplacementSpecifications.GetMatching(node));
     
     return result;
 }
开发者ID:RobertTheGrey,项目名称:OpenRasta.Codecs.Spark,代码行数:9,代码来源:OpenRastaSparkExtensionsFactory.cs


示例15: TryCreateSmartTag

        public IHtmlSmartTag TryCreateSmartTag(ITextView textView, ITextBuffer textBuffer, ElementNode element, AttributeNode attribute, int caretPosition, HtmlPositionType positionType)
        {
            if (element.Children.Count > 0)
            {
                return new HtmlRemoveParentSmartTag(textView, textBuffer, element);
            }

            return null;
        }
开发者ID:NickCraver,项目名称:WebEssentials2013,代码行数:9,代码来源:HtmlRemoveParentSmartTag.cs


示例16: ImportTemplateOnce

        public ElementNode ImportTemplateOnce(string templateFileName, ElementNode parentNode)
        {
            ElementNodeTemplate elementNodeTemplate = FileService.Instance.LoadElementNodeTemplateFile(templateFileName);
            if (elementNodeTemplate == null) return null;

            VixenSystem.Nodes.AddChildToParent(elementNodeTemplate.ElementNode, parentNode);

            return elementNodeTemplate.ElementNode;
        }
开发者ID:stewmc,项目名称:vixen,代码行数:9,代码来源:ElementNodeService.cs


示例17: ChildNode

        private ElementNode ChildNode(ElementNode deepChild, ElementNode parent)
        {
            if (deepChild.Parent != null && deepChild.Parent != parent)
            {
                return ChildNode(deepChild.Parent, parent);
            }

            return deepChild;
        }
开发者ID:ncl-dmoreira,项目名称:WebEssentials2013,代码行数:9,代码来源:ContractSelectionTarget.cs


示例18: CreateIntent

        protected IIntent CreateIntent(ElementNode node, Color startColor, Color endColor, double startIntensity, double endIntensity, TimeSpan duration)
        {
            if (HasDiscreteColors && IsElementDiscrete(node))
            {
                return CreateDiscreteIntent(startColor, startIntensity, endIntensity, duration);
            }

            return CreateIntent(startColor, endColor, startIntensity, endIntensity, duration);
        }
开发者ID:jaredb7,项目名称:vixen,代码行数:9,代码来源:BaseEffect.cs


示例19: GetMiscReplacements

 private static IEnumerable<IReplacement> GetMiscReplacements(ElementNode node)
 {
     IEnumerable<IReplacement> result =
         TextAreaSpecs.Where(x => x.IsMatch(node)).Select(x => new TextAreaValueReplacement(x)).Cast<IReplacement>();
     result =
         result.Union(
             SelectSpecs.Where(x => x.IsMatch(node)).Select(x => new SelectSelectedValueReplacement(x)).Cast<IReplacement>());
     return result;
 }
开发者ID:RobertTheGrey,项目名称:OpenRasta.Codecs.Spark,代码行数:9,代码来源:FormReplacementSpecifications.cs


示例20: TryCreateSmartTag

        public IHtmlSmartTag TryCreateSmartTag(ITextView textView, ITextBuffer textBuffer, ElementNode element, AttributeNode attribute, int caretPosition, HtmlPositionType positionType)
        {
            if ((element.IsStyleBlock() || element.IsJavaScriptBlock()) && element.InnerRange.Length > 5)
            {
                return new ExtractToFileSmartTag(textView, textBuffer, element);
            }

            return null;
        }
开发者ID:hanskishore,项目名称:WebEssentials2013,代码行数:9,代码来源:ExtractToFileSmartTag.cs



注:本文中的ElementNode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ElementRequest类代码示例发布时间:2022-05-24
下一篇:
C# ElementInfo类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap