本文整理汇总了C#中IElement类的典型用法代码示例。如果您正苦于以下问题:C# IElement类的具体用法?C# IElement怎么用?C# IElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IElement类属于命名空间,在下文中一共展示了IElement类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GenerationMenuWidget
public GenerationMenuWidget(Window parent, IElement referer, Bus bus, string busName)
{
if (referer.Data != null) {
MenuItem path = new MenuItem("Call " + referer.Name + "...");
ObjectPath p = new ObjectPath(referer.Parent.Parent.Path);
if (!referer.Data.IsProperty) {
path.Activated += delegate {
MethodInvokeDialog diag = new MethodInvokeDialog (parent, bus, busName, p, referer);
while (diag.Run () == (int)ResponseType.None);
diag.Destroy();
};
} else {
path.Activated += delegate {
PropertyInvokeDialog diag = new PropertyInvokeDialog (parent, bus, busName, p, referer);
while (diag.Run () == (int)ResponseType.None);
diag.Destroy();
};
}
this.Append(path);
path.ShowAll();
}
}
开发者ID:garuma,项目名称:dbus-explorer,代码行数:26,代码来源:GenerationMenuWidget.cs
示例2: ElementInstancesAddedEventArgs
public ElementInstancesAddedEventArgs(IElement[] elements)
{
if(elements==null)
_Elements = new IElement[0];
else
_Elements = elements;
}
开发者ID:BgRva,项目名称:Blob1,代码行数:7,代码来源:ElementInstancesAddedEventArgs.cs
示例3: FindFirst
public IElement FindFirst(IElement context, LocatorStrategy strategy, string locator)
{
AutomationProperty property = this.ToAutomationProperty(strategy);
AutomationElement element = null;
switch (strategy)
{
case LocatorStrategy.Id:
case LocatorStrategy.Name:
case LocatorStrategy.ClassName:
element = context.AutomationElement.FindFirst(
TreeScope.Descendants,
new PropertyCondition(property, locator));
break;
case LocatorStrategy.TagName:
ControlType type = this.uiAutomation.FromTagName(locator);
element = context.AutomationElement.FindFirst(
TreeScope.Descendants,
new PropertyCondition(property, type));
break;
case LocatorStrategy.XPath:
element = this.uiAutomation.FindFirstByXPath(context.AutomationElement, locator);
break;
default:
throw new FailedCommandException(
string.Format("Usupported locator startegy: {0}", strategy.ToString()),
32); // InvalidSelector (32)
}
return element == null ? null : this.elementFactory.GetElement(element);
}
开发者ID:shaunstanislaus,项目名称:winappdriver,代码行数:33,代码来源:ElementSearcher.cs
示例4: RangeFromChild
public ITextPatternRange RangeFromChild (IElement childElement)
{
Element child = childElement as Element;
if (child == null || child.Parent != this)
throw new InvalidOperationException ();
return new TextRangePattern (accessible);
}
开发者ID:mono,项目名称:uia2atk,代码行数:7,代码来源:TextSource.cs
示例5: GetSharedCodeFullFileName
public static string GetSharedCodeFullFileName(IElement container, string baseProjectDirectory)
{
string fileName = GetEventFileNameForElement(container);
return baseProjectDirectory + fileName;
}
开发者ID:vchelaru,项目名称:FlatRedBall,代码行数:7,代码来源:EventResponseSave.cs
示例6: CheckElement
protected override bool CheckElement(IElement element)
{
if (!NHProjectFileLanguageService.IsNHFile(element.GetProjectFile()))
return false;
return base.CheckElement(element);
}
开发者ID:willrawls,项目名称:arp,代码行数:7,代码来源:NHReferencesProcessor.cs
示例7: return
String IMarkupFormatter.CloseTag(IElement element, Boolean selfClosing)
{
var prefix = element.Prefix;
var name = element.LocalName;
var tag = !String.IsNullOrEmpty(prefix) ? prefix + ":" + name : name;
return (selfClosing || !element.HasChildNodes) ? String.Empty : String.Concat("</", tag, ">");
}
开发者ID:Wojdav,项目名称:AngleSharp,代码行数:7,代码来源:XhtmlMarkupFormatter.cs
示例8: GenerateAdditionalMethods
public override ICodeBlock GenerateAdditionalMethods(ICodeBlock codeBlock, IElement element)
{
EntitySave entitySave = element as EntitySave;
if (entitySave == null || (!entitySave.ImplementsIClickable && !entitySave.ImplementsIWindow))
{
return codeBlock;
}
if (entitySave.ImplementsIWindow)
{
bool inheritsFromIWindow = entitySave.GetInheritsFromIWindow();
// Add all the code that never changes if this is the base IWindow (doesn't have a parent IWindow)
if (!inheritsFromIWindow)
{
GenerateEnabledVariable(codeBlock, element);
}
}
IWindowCodeGenerator.WriteCodeForHasCursorOver(
entitySave, codeBlock, entitySave.GetInheritsFromIWindowOrIClickable());
var isVirtual = string.IsNullOrEmpty(entitySave.BaseEntity) || entitySave.GetInheritsFromIWindowOrIClickable() == false;
codeBlock
.Function("WasClickedThisFrame", "FlatRedBall.Gui.Cursor cursor", Public: true, Virtual: isVirtual, Override: !isVirtual, Type: "bool")
.Line("return cursor.PrimaryClick && HasCursorOver(cursor);")
.End();
return codeBlock;
}
开发者ID:vchelaru,项目名称:FlatRedBall,代码行数:33,代码来源:IWindowCodeGenerator.cs
示例9: DummyInputNetworkPort
/// <summary>
/// Initializes a new instance of the DummyInputNetworkPort class, This class maintains the dataObj
/// as a member, does NOT use the backingStore of the pipe.
/// </summary>
/// <param name="parent"></param>
/// <param name="inPipe"></param>
/// <param name="dataObj"></param>
/// <param name="isValid"></param>
public DummyInputNetworkPort(IElement parent, INetworkPipe inPipe, INetwork dataObj, bool isValid)
{
_parent = parent;
_inPipe = inPipe;
_netObj = dataObj;
_IsValid = isValid;
}
开发者ID:BgRva,项目名称:Blob1,代码行数:15,代码来源:DummyInputNetworkPort.cs
示例10: GenerateInitializeLevel
private void GenerateInitializeLevel(ICodeBlock codeBlock, IElement element)
{
#region /////////////////////////////////Early out////////////////////////////////
bool shouldGenerate = GetIfShouldGenerate(element);
if (!shouldGenerate)
{
return;
}
///////////////////////////////End early out/////////////////////////////
#endregion
codeBlock.Line("FlatRedBall.TileGraphics.LayeredTileMap CurrentTileMap;");
var function = codeBlock.Function("void", "InitializeLevel", "string levelName");
GenerateInitializeLevelObjects(function);
GenerateInitializeCamera(function);
GenerateAddCollisionAndEntities(function);
GenerateInitializeAnimations(function);
}
开发者ID:GorillaOne,项目名称:FlatRedBall,代码行数:25,代码来源:LevelCodeGenerator.cs
示例11: OutputNeutralPort
public OutputNeutralPort(Guid id, IElement parent)
{
Id = id;
_pipes = new List<INeutralPipe>();
ParentElement = parent;
Index = -1;
}
开发者ID:BgRva,项目名称:Blob1,代码行数:7,代码来源:OutputNeutralPort.cs
示例12: TryToRemoveInvalidState
private static void TryToRemoveInvalidState(this GlueProjectSave glueProjectSave, bool showPopupsOnFixedErrors, IElement containingElement, NamedObjectSave nos)
{
if (nos.SourceType == SourceType.Entity && !string.IsNullOrEmpty(nos.SourceClassType) && !string.IsNullOrEmpty(nos.CurrentState))
{
EntitySave foundEntitySave = glueProjectSave.GetEntitySave(nos.SourceClassType);
if (foundEntitySave != null)
{
bool hasFoundState = false;
hasFoundState = foundEntitySave.GetStateRecursively(nos.CurrentState) != null;
if (!hasFoundState)
{
if (showPopupsOnFixedErrors)
{
MessageBox.Show("The Object " + nos.InstanceName + " in " + containingElement.Name + " uses the invalid state " + nos.CurrentState +
"\nRemoving this current State");
}
nos.CurrentState = null;
}
}
}
}
开发者ID:vchelaru,项目名称:FlatRedBall,代码行数:26,代码来源:GlueProjectSaveExtensionMethods.cs
示例13: Apply
public override bool Apply(IElement element)
{
if (element == null)
return false;
return element.ElementType == LanguageElementType.For
|| element.ElementType == LanguageElementType.ForEach;
}
开发者ID:kevinmiles,项目名称:dxcorecommunityplugins,代码行数:7,代码来源:PlugIn1.cs
示例14: Execute
/// <summary>Executes the specified solution.</summary>
/// <param name="element">The element.</param>
protected override void Execute(IElement element)
{
var node = element.ToTreeNode();
if (node == null)
{
return;
}
IInvocationExpression invocationExpression = null;
while (node != null)
{
invocationExpression = node as IInvocationExpression;
if (invocationExpression != null)
{
break;
}
node = node.Parent;
}
if (invocationExpression == null)
{
return;
}
Execute(invocationExpression);
}
开发者ID:jamiebriant,项目名称:agentjohnson,代码行数:31,代码来源:DocumentUncaughtExceptionsContextAction.cs
示例15: addNewTab
public void addNewTab(String name, IElement element)
{
Label tablabel = new Label(name);
this.AppendPage((Widget)element,tablabel);
this.ShowAll();
TabCount++;
}
开发者ID:sanmadjack,项目名称:LAUNCH,代码行数:7,代码来源:Tabs.cs
示例16: ComputeDeclarations
/// <summary>
/// Computes the declarations for the given element in the context of
/// the specified styling rules.
/// </summary>
/// <param name="rules">The styles to use.</param>
/// <param name="element">The element that is questioned.</param>
/// <param name="pseudoSelector">The optional pseudo selector to use.</param>
/// <returns>The style declaration containing all the declarations.</returns>
public static CssStyleDeclaration ComputeDeclarations(this StyleCollection rules, IElement element, String pseudoSelector = null)
{
var computedStyle = new CssStyleDeclaration();
var pseudoElement = PseudoElement.Create(element, pseudoSelector);
if (pseudoElement != null)
{
element = pseudoElement;
}
computedStyle.SetDeclarations(rules.ComputeCascadedStyle(element).Declarations);
var htmlElement = element as IHtmlElement;
if (htmlElement != null)
{
var declarations = htmlElement.Style.OfType<CssProperty>();
computedStyle.SetDeclarations(declarations);
}
var nodes = element.GetAncestors().OfType<IElement>();
foreach (var node in nodes)
{
var style = rules.ComputeCascadedStyle(node);
computedStyle.UpdateDeclarations(style.Declarations);
}
return computedStyle;
}
开发者ID:Wojdav,项目名称:AngleSharp,代码行数:37,代码来源:StyleExtensions.cs
示例17: ReactToChange
public void ReactToChange(string changedMember, object oldValue, EventResponseSave ers, IElement container)
{
if (changedMember == "EventName")
{
ReactToEventRename(oldValue, ers, container);
}
}
开发者ID:vchelaru,项目名称:FlatRedBall,代码行数:7,代码来源:EventResponseSaveSetVariableLogic.cs
示例18: GetOrCreateAutomationElements
// TODO: Rename to GetAutomationElements
internal static AutomationElement [] GetOrCreateAutomationElements (IElement [] sourceElements)
{
AutomationElement [] ret = new AutomationElement [sourceElements.Length];
for (int i = 0; i < sourceElements.Length; i++)
ret [i] = GetOrCreateAutomationElement (sourceElements [i]);
return ret;
}
开发者ID:mono,项目名称:uia2atk,代码行数:8,代码来源:SourceManager.cs
示例19: CheckResolve
protected override bool CheckResolve(IReference reference, IElement element)
{
if (reference is TableReference && !DatabaseManager.GetInstance(element.GetManager().Solution).Enabled)
return false;
return base.CheckResolve(reference, element);
}
开发者ID:willrawls,项目名称:arp,代码行数:7,代码来源:NHReferencesProcessor.cs
示例20: Match
public override Boolean Match(IElement element)
{
var parent = element.ParentElement;
if (parent != null)
{
var n = Math.Sign(_step);
var k = 0;
for (var i = parent.ChildNodes.Length - 1; i >= 0; i--)
{
var child = parent.ChildNodes[i] as IElement;
if (child != null && child.NodeName.Is(element.NodeName))
{
k += 1;
if (child == element)
{
var diff = k - _offset;
return diff == 0 || (Math.Sign(diff) == n && diff % _step == 0);
}
}
}
}
return false;
}
开发者ID:fjwuyongzhi,项目名称:AngleSharp,代码行数:28,代码来源:LastTypeSelector.cs
注:本文中的IElement类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论