本文整理汇总了C#中IHtmlNode类的典型用法代码示例。如果您正苦于以下问题:C# IHtmlNode类的具体用法?C# IHtmlNode怎么用?C# IHtmlNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IHtmlNode类属于命名空间,在下文中一共展示了IHtmlNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HtmlRange
public HtmlRange( IHtmlNode node1, IHtmlNode node2, bool inclusiveNode1, bool inclusiveNode2 )
{
if ( node1 == null )
throw new ArgumentNullException( "node1" );
if ( node2 == null )
throw new ArgumentNullException( "node2" );
container = node1.Container;
if ( container == null || !container.Equals( node2.Container ) || node1.Equals( node2 ) )
throw new InvalidOperationException();
if ( node1.NodesIndexOfSelf() <= node2.NodesIndexOfSelf() )
{
beginNode = node1;
endNode = node2;
inclusiveBegin = inclusiveNode1;
inclusiveEnd = inclusiveNode2;
}
else
{
beginNode = node2;
endNode = node1;
inclusiveBegin = inclusiveNode2;
inclusiveEnd = inclusiveNode1;
}
}
示例2: ApplyDecorators
private void ApplyDecorators(IHtmlNode table)
{
foreach (var decorator in Decorators)
{
decorator.Decorate(table);
}
}
示例3: GetData
protected object GetData( IHtmlNode node, bool asContainer )
{
if ( node == null )
return null;
lock ( _dataItems.SyncRoot )
{
if ( asContainer )
{
var _container = node as IHtmlContainer;
if ( _container != null && _dataItems.Contains( _container ) )
return _dataItems[_container];
}
var container = node.Container;
if ( _dataItems.Contains( container ) )
return _dataItems[container];
else
return GetData( container as IHtmlNode, false );
}
}
示例4: AppendPageInput
private void AppendPageInput(IHtmlNode container, GridPagerStyles style, GridPagerData section)
{
if ((style & GridPagerStyles.PageInput) != GridPagerStyles.PageInput)
return;
inputSectionBuilder.Create(section).AppendTo(container);
}
示例5: if
bool IHtmlRenderAdapter.Render( IHtmlNode node, IHtmlRenderContext context )
{
var element = node as IHtmlElement;
if ( element == null )
return false;
if ( element.Name.EqualsIgnoreCase( "content" ) )
{
GetContentBody( element ).RenderChilds( context.Writer, RenderAdapters );
return true;
}
else if ( element.Name.EqualsIgnoreCase( "head" ) )
{
View.ViewContext.HttpContext.Trace.Write( "ContentView", "Begin Merge Head" );
var head = MergeHead( element, Document.FindSingle( "head" ) );
View.ViewContext.HttpContext.Trace.Write( "ContentView", "End Merge Head" );
head.Render( context.Writer, RenderAdapters );
return true;
}
else
return false;
}
示例6: ApplyTo
public void ApplyTo(IHtmlNode target)
{
var hierarchyCell = new HtmlTag("th")
.AddClass(UIPrimitives.Header, UIPrimitives.Grid.HierarchyCell);
target.Children.Insert(0, hierarchyCell);
}
示例7: AsString
private static string AsString(IHtmlNode node)
{
var sb = new StringBuilder();
using (var writer = new HtmlTextWriter(new StringWriter(sb)))
node.Write(writer);
return sb.ToString();
}
示例8: ApplyTo
public void ApplyTo(IHtmlNode target)
{
var filtered = column.Grid.DataProcessor.FilterDescriptors.SelectRecursive(filter =>
{
CompositeFilterDescriptor compositeDescriptor = filter as CompositeFilterDescriptor;
if (compositeDescriptor != null)
{
return compositeDescriptor.FilterDescriptors;
}
return null;
})
.Where(filter => filter is FilterDescriptor)
.OfType<FilterDescriptor>()
.Any(filter => filter.Member.IsCaseInsensitiveEqual(column.Member));
var wrapper = new HtmlTag("div")
.AddClass("t-grid-filter", "t-state-default")
.ToggleClass("t-active-filter", filtered);
wrapper.AppendTo(target);
var icon = new HtmlTag("span").AddClass("t-icon", "t-filter");
icon.AppendTo(wrapper);
}
示例9: AppendPageSizeDropDown
private void AppendPageSizeDropDown(IHtmlNode container, GridPagerStyles style, GridPagerData section)
{
if ((style & GridPagerStyles.PageSizeDropDown) != GridPagerStyles.PageSizeDropDown)
return;
gridPagerPageSizeSection.Create(section).AppendTo(container);
}
示例10: AppendCellContent
protected override void AppendCellContent(IHtmlNode td, object dataItem)
{
foreach (var builder in builders)
{
builder(dataItem).AppendTo(td);
}
}
示例11: Decorate
protected void Decorate(IHtmlNode td)
{
foreach (var decorator in Decorators)
{
decorator.Decorate(td);
}
}
示例12: AppendNumericSection
private void AppendNumericSection(IHtmlNode container, GridPagerStyles style, IGridUrlBuilder urlBuilder, int currentPage, int pageCount)
{
if ((style & GridPagerStyles.Numeric) == GridPagerStyles.Numeric)
{
numericSectionBuilder.Create(urlBuilder, currentPage, pageCount).AppendTo(container);
}
}
示例13: AppendPageInput
private void AppendPageInput(IHtmlNode container, GridPagerData section)
{
if (section.Input)
{
inputSectionBuilder.Create(section).AppendTo(container);
}
}
示例14: AppendPrevButtonsLink
private void AppendPrevButtonsLink(int numericStart, IHtmlNode numericDiv, IGridUrlBuilder urlBuilder)
{
if (numericStart > 1)
{
buttonFactory.CreateButton(GridPagerButtonType.NumericLink, "...", true,
GetUrl(urlBuilder, numericStart - 1)).AppendTo(numericDiv);
}
}
示例15: Apply
public void Apply(IHtmlNode parent)
{
var span = new HtmlElement("span");
span.Attributes(button.ImageHtmlAttributes).AddClass(UIPrimitives.Icon, button.SpriteCssClass);
span.AppendTo(parent);
}