本文整理匯總了C#中SharpKit.Html.HtmlElement類的典型用法代碼示例。如果您正苦於以下問題:C# HtmlElement類的具體用法?C# HtmlElement怎麽用?C# HtmlElement使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
HtmlElement類屬於SharpKit.Html命名空間,在下文中一共展示了HtmlElement類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: getExtensionsForFragment
public HashMap<StyleExtensionMapEntry> getExtensionsForFragment(HtmlElement element)
{
var hashmap = new HashMap<StyleExtensionMapEntry>();
//We need to loop over all of the relevant entries in the map that define some behavior
var allEntries = map.getAllRandoriSelectorEntries();
for ( var i=0; i<allEntries.length; i++) {
JsArray<HtmlElement> implementingNodes = findChildNodesForCompoundSelector(element, allEntries[i]);
//For each of those entries, we need to see if we have any elements in this DOM fragment that implement any of those classes
for ( var j=0; j<implementingNodes.length; j++) {
var implementingElement = implementingNodes[ j ];
var value = hashmap.get( implementingElement );
if ( value == null ) {
//Get the needed entry
var extensionEntry = map.getExtensionEntry(allEntries[i]);
//give us a copy so we can screw with it at will
hashmap.put(implementingElement, extensionEntry.clone());
} else {
//We already have data for this node, so we need to merge the new data into the existing one
var extensionEntry = map.getExtensionEntry(allEntries[i]);
extensionEntry.mergeTo( (StyleExtensionMapEntry)value );
}
}
}
//return the hashmap which can be queried and applied to the Dom
return hashmap;
}
示例2: AddClass
public void AddClass(HtmlElement elem, string className)
{
string thisClass = elem.className;
if (!thisClass.Contains(className))
{
thisClass += " " + className;
}
elem.className = thisClass;
}
示例3: buildChildClassBuilder
public InjectionClassBuilder buildChildClassBuilder(InjectionClassBuilder classBuilder, HtmlElement element, JsString contextClassName)
{
var module = (GuiceModule)classBuilder.buildClass(contextClassName);
var injector = (ChildInjector)classBuilder.buildClass("guice.ChildInjector");
var guiceJs = new GuiceJs();
guiceJs.configureInjector(injector, module);
//Setup a new InjectionClassBuilder
return (InjectionClassBuilder)injector.getInstance(typeof(InjectionClassBuilder));
}
示例4: CreateScoreRenderer
protected override IScoreRenderer CreateScoreRenderer(Settings settings, object rawSettings, HtmlElement canvasElement)
{
var renderer = new WorkerScoreRenderer(this, rawSettings);
renderer.PostRenderFinished += () =>
{
Element.className = Element.className.replace(" loading", "")
.replace(" rendering", "");
};
return renderer;
}
示例5: resolveContent
public void resolveContent(HtmlElement element)
{
var content = element.getAttribute("data-content");
//Clean up any of our properties embedded in the DOM
element.removeAttribute("data-content");
if (content == null) {
//content = map.getExtensionValue("content");
}
//load the content
}
示例6: investigateDomElement
private void investigateDomElement(HtmlElement element, AbstractBehavior parentBehavior)
{
var currentBehavior = parentBehavior;
var domWalker = this;
var id = element.getAttribute("id");
if (id != null) {
//we have a reference to the element now, so remove the id so we dont have to deal with conflicts and clashes
element.removeAttribute("id");
}
var elementDescriptor = elementDescriptorFactory.describeElement(element, extensionsToBeApplied);
if (elementDescriptor.context != null) {
//change the class builder for everything under this point in the DOM
classBuilder = domExtensionFactory.buildChildClassBuilder(classBuilder, element, elementDescriptor.context);
//change the domWalker for everything under this point in the DOM
domWalker = (DomWalker)classBuilder.buildClass("randori.dom.DomWalker");
}
if (elementDescriptor.behavior != null) {
//build a context for this behavior IF it turns out that this particular element defines one
currentBehavior = domExtensionFactory.buildBehavior( classBuilder, element, elementDescriptor.behavior );
//we have a new behavior, this effectively causes us to use a new context for the nodes below it
//Make sure we add ourselves to our parent though
if (parentBehavior != null) {
parentBehavior.injectPotentialNode(id, currentBehavior);
}
} else {
if (id != null && currentBehavior != null) {
currentBehavior.injectPotentialNode(id, jQueryContext.J(element));
}
}
if (elementDescriptor.fragment != null) {
//build a context for this behavior IF it turns out that this particular element defines one
domExtensionFactory.buildNewContent(element, elementDescriptor.fragment);
//change the domWalker for everything under this point in the DOM
domWalker = (DomWalker)classBuilder.buildClass("randori.dom.DomWalker");
}
domWalker.walkChildren(element, currentBehavior);
//Now that we have figured out all of the items under this dom element, setup the behavior
if (currentBehavior != null && currentBehavior != parentBehavior) {
currentBehavior.verifyAndRegister();
}
}
示例7: buildBehavior
public AbstractBehavior buildBehavior(InjectionClassBuilder classBuilder, HtmlElement element, JsString behaviorClassName )
{
AbstractBehavior behavior = null;
var resolution = classResolver.resolveClassName(behaviorClassName);
if ( resolution.builtIn ) {
/** If we have a type which was not created via Randori, we send it out to get created. In this way
* we dont worry about injection data and we allow for any crazy creation mechanism the client can
* consider **/
behavior = externalBehaviorFactory.createExternalBehavior(element, behaviorClassName, resolution.type);
} else {
behavior = (AbstractBehavior)classBuilder.buildClass(behaviorClassName);
behavior.provideDecoratedElement(element);
}
return behavior;
}
示例8: Open
public void Open()
{
_id = Id + NextId;
_swfId = _id + "swf";
Lookup[_id] = this;
NextId++;
_swfContainer = document.createElement("div").As<HtmlElement>();
_swfContainer.className = Id;
_swfContainer.setAttribute("id", _id);
document.body.appendChild(_swfContainer);
var swf = JsCode("swfobject");
var embedSwf = swf.Member("embedSWF").As<Action<string, string, string, string, string, string, object, object, object>>();
embedSwf(
_asRoot + "AlphaSynth.FlashOutput.swf",
_id, "1px", "1px", "9.0.0",
_swfObjectRoot + "expressInstall.swf",
new { id = _id, sampleRate = PreferredSampleRate }, new { allowScriptAccess = "always" }, new { id = _swfId }
);
}
示例9: describeElement
public ElementDescriptor describeElement(HtmlElement element )
{
//This is purely an efficiency gain. By making a merged map for this one element, we stop everyone from cycling through
//every class on an element to pull out their own piece of data
var entry = styleExtensionManager.getMergedEntryForElement(element);
var descriptor = new ElementDescriptor {
context = element.getAttribute("data-context"),
behavior = element.hasAttribute("data-mediator") ? element.getAttribute("data-mediator") : element.getAttribute("data-behavior"),
fragment = element.getAttribute("data-fragment"),
formatter = element.getAttribute( "data-formatter" ),
validator = element.getAttribute( "data-validator" )
};
if ( entry != null ) {
if (descriptor.context == null) {
descriptor.context = entry.getExtensionClass("module");
}
if (descriptor.behavior == null) {
//mediator and behavior are really the same thing and hence mutually exclusive
descriptor.behavior = entry.hasExtensionType("mediator")?entry.getExtensionClass("mediator"):entry.getExtensionClass("behavior");
}
if (descriptor.fragment == null) {
descriptor.fragment = entry.getExtensionClass("fragment");
}
if (descriptor.formatter == null) {
descriptor.formatter = entry.getExtensionClass("formatter");
}
if (descriptor.validator == null) {
descriptor.validator = entry.getExtensionClass("validator");
}
}
return descriptor;
}
示例10: tree
public void tree(HtmlElement element) { }
示例11: findElements
/// <summary>
/// Internal function, which may be overridden through the options parameter on creation
/// </summary>
/// <param name="element"></param>
/// <param name="dropon"></param>
/// <param name="overlap"></param>
public void findElements(HtmlElement element, object dropon, object overlap) { }
示例12: destroy
public void destroy(HtmlElement element) { }
示例13: SwitchOff
public SwitchOff(HtmlElement el, EffectOptions options)
: base(el, options)
{
}
示例14: Squish
public Squish(HtmlElement el, EffectOptions options)
: base(el, options)
{
}
示例15: SlideUp
public SlideUp(HtmlElement el, BlindOptions options)
: base(el, options)
{
}