当前位置: 首页>>代码示例>>C#>>正文


C# Markup.ElementNode类代码示例

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


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

示例1: CreateExtension

        public ISparkExtension CreateExtension(VisitorContext context, ElementNode node)
        {
            if(_serviceProvider==null)
            {
              return null;
            }
            var componentFactory = (IViewComponentFactory)_serviceProvider.GetService(typeof(IViewComponentFactory));
            if (componentFactory == null || componentFactory.Registry == null)
                return null;

            ViewComponentInfo viewComponentInfo;
            lock (_cachedViewComponent)
            {
                if (!_cachedViewComponent.TryGetValue(node.Name, out viewComponentInfo))
                {
                    if (componentFactory.Registry.HasViewComponent(node.Name))
                    {
                        viewComponentInfo = new ViewComponentInfo(componentFactory.Create(node.Name));
                        _cachedViewComponent.Add(node.Name, viewComponentInfo);
                    }
                    else
                    {
                        _cachedViewComponent.Add(node.Name, null);
                    }
                }
            }

            if (viewComponentInfo != null)
            {
                return new ViewComponentExtension(node, viewComponentInfo);
            }

            return null;
        }
开发者ID:Eilon,项目名称:spark,代码行数:34,代码来源:ViewComponentExtensionFactory.cs

示例2: 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:tanerst,项目名称:schedumail,代码行数:7,代码来源:OpenRastaSparkExtensionsFactory.cs

示例3: Transform

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

示例4: CreateExtension

        public ISparkExtension CreateExtension(VisitorContext context, ElementNode node)
        {
            if (node.Name == "unittest")
                return new TestExtension();

            return null;
        }
开发者ID:dtabuenc,项目名称:spark,代码行数:7,代码来源:SparkExtensionTester.cs

示例5: DoReplace

 public void DoReplace(ElementNode node, IList<Node> body)
 {
     string propertyExpression = node.GetAttributeValue("for");
     Node checkedSnippet = propertyExpression.GetCheckedSnippet();
     node.RemoveAttributesByName("checked");
     node.Attributes.Add(new AttributeNode("checked", new List<Node>(){checkedSnippet}));
 }
开发者ID:jennifersmith,项目名称:openrasta-sparkcodec,代码行数:7,代码来源:OpenRastaSparkExtensionsFactory.cs

示例6: 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:tanerst,项目名称:schedumail,代码行数:8,代码来源:SpecifiedReplacement.cs

示例7: NonVoidElementDoesNotSelfClose

 public void NonVoidElementDoesNotSelfClose()
 {
     var elt = new ElementNode("span", new AttributeNode[]{ }, true);
     var visitor = new ChunkBuilderVisitor(new VisitorContext());
     visitor.Accept(elt);
     Assert.AreEqual(1, visitor.Chunks.Count());
     Assert.AreEqual("<span></span>", ((SendLiteralChunk)visitor.Chunks[0]).Text);
 }
开发者ID:Eilon,项目名称:spark,代码行数:8,代码来源:ChunkBuilderVisitorTester.cs

示例8: RemoteAndEvalUriSnippet

		private Node RemoteAndEvalUriSnippet(ElementNode elementNode)
		{
			string attribValue = elementNode.GetAttributeValue(replacementSpecification.OriginalAttributeName);
			elementNode.RemoveAttributesByName(replacementSpecification.OriginalAttributeName);
			return
				attribValue.GetCreateUriSnippet(
					IsTypeReplacement());
		}
开发者ID:RobertTheGrey,项目名称:OpenRasta.Codecs.Spark,代码行数:8,代码来源:UriReplacementExtension.cs

示例9: ExtractFakeAttribute

        private AttributeNode ExtractFakeAttribute(ElementNode node, string name, string fakeName)
        {
            var attribute = node.Attributes.SingleOrDefault(x => AttrName(x) == name);
            if (attribute == null)
                return null;

            node.Attributes.Remove(attribute);
            return new AttributeNode(fakeName, '"', attribute.Nodes);
        }
开发者ID:Eilon,项目名称:spark,代码行数:9,代码来源:CacheAttributeVisitor.cs

示例10: 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:tanerst,项目名称:schedumail,代码行数:9,代码来源:FormReplacementSpecifications.cs

示例11: CreateExtension

		public ISparkExtension CreateExtension(VisitorContext context, ElementNode node)
		{
			IEnumerable<IReplacement> replacements = GetApplicableReplacements(node);
			if (replacements.Any())
			{
				return new SparkExtension(node, replacements);
			}
			return null;
		}
开发者ID:tanerst,项目名称:schedumail,代码行数:9,代码来源:OpenRastaSparkExtensionsFactory.cs

示例12: CreateElementTransformer

 public ISparkElementTransformer CreateElementTransformer(ElementNode elementNode)
 {
     var sparkElementWrapper = new SparkElementWrapper(elementNode);
     if(!_elementTransformerService.IsTransformable(sparkElementWrapper))
     {
         return new NullSparkElementTransformer();
     }
     return new SparkElementTransformer(_elementTransformerService.GetTransformerFor(sparkElementWrapper));
 }
开发者ID:drlongnecker,项目名称:openrasta-sparkcodec,代码行数:9,代码来源:ISparkElementTransformerService.cs

示例13: CreateElementTransformer

 public ISparkElementTransformer CreateElementTransformer(ElementNode elementNode)
 {
     var tag = new Tag(elementNode.Name, elementNode.Attributes.Select(x=>new TagAttribute(x.Name, x.Value)).ToArray());
     if(!_elementTransformerService.IsTransformable(tag))
     {
         return new NullSparkElementTransformer();
     }
     return new SparkElementTransformer(_elementTransformerService.GetTransformerFor(tag));
 }
开发者ID:jennifersmith,项目名称:openrasta-sparkcodec,代码行数:9,代码来源:ISparkElementTransformerService.cs

示例14: CreateExtension

 public ISparkExtension CreateExtension(VisitorContext context, ElementNode node)
 {
     ISparkElementTransformer elementTransformer = _sparkElementTransformerService.CreateElementTransformer(node);
     if(elementTransformer is NullSparkElementTransformer)
     {
         return null;
     }
     return new SparkOverrideExtension(node, elementTransformer);
 }
开发者ID:jennifersmith,项目名称:openrasta-sparkcodec,代码行数:9,代码来源:CodecSparkExtensionFactory.cs

示例15: DoReplace

		public void DoReplace(ElementNode node)
		{
			RemoveReplacedAttribute(node);
			Node uriSnippet = RemoteAndEvalUriSnippet(node);

			node.Attributes.Add(new AttributeNode(replacementSpecification.NewAttributeName, new List<Node>()
			                                                                                 	{
			                                                                                 		uriSnippet
			                                                                                 	}));
		}
开发者ID:RobertTheGrey,项目名称:OpenRasta.Codecs.Spark,代码行数:10,代码来源:UriReplacementExtension.cs


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