本文整理汇总了C#中IElement类的典型用法代码示例。如果您正苦于以下问题:C# IElement类的具体用法?C# IElement怎么用?C# IElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IElement类属于命名空间,在下文中一共展示了IElement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
}
示例2: ElementInstancesAddedEventArgs
public ElementInstancesAddedEventArgs(IElement[] elements)
{
if(elements==null)
_Elements = new IElement[0];
else
_Elements = elements;
}
示例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);
}
示例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);
}
示例5: GetSharedCodeFullFileName
public static string GetSharedCodeFullFileName(IElement container, string baseProjectDirectory)
{
string fileName = GetEventFileNameForElement(container);
return baseProjectDirectory + fileName;
}
示例6: CheckElement
protected override bool CheckElement(IElement element)
{
if (!NHProjectFileLanguageService.IsNHFile(element.GetProjectFile()))
return false;
return base.CheckElement(element);
}
示例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, ">");
}
示例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;
}
示例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;
}
示例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);
}
示例11: OutputNeutralPort
public OutputNeutralPort(Guid id, IElement parent)
{
Id = id;
_pipes = new List<INeutralPipe>();
ParentElement = parent;
Index = -1;
}
示例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;
}
}
}
}
示例13: Apply
public override bool Apply(IElement element)
{
if (element == null)
return false;
return element.ElementType == LanguageElementType.For
|| element.ElementType == LanguageElementType.ForEach;
}
示例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);
}
示例15: addNewTab
public void addNewTab(String name, IElement element)
{
Label tablabel = new Label(name);
this.AppendPage((Widget)element,tablabel);
this.ShowAll();
TabCount++;
}