本文整理汇总了C#中ElementCollection类的典型用法代码示例。如果您正苦于以下问题:C# ElementCollection类的具体用法?C# ElementCollection怎么用?C# ElementCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ElementCollection类属于命名空间,在下文中一共展示了ElementCollection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Tag
public Tag(int line, int col, string name)
: base(line, col)
{
this.name = name;
this.attribs = new TagAttributeCollection();
this.innerElements = new ElementCollection();
}
示例2: ReadMesh
/// <summary>
/// Reads in Mesh information from a stream. Does not look back in the stream
/// </summary>
/// <param name="StreamWithMeshInfo"></param>
private void ReadMesh()
{
elements = new ElementCollection();
connections = new List<Connection>();
using (StreamReader StreamWithMeshInfo = new StreamReader(FileName))
{
while (!StreamWithMeshInfo.EndOfStream)
{
string word = StreamWithMeshInfo.ReadLine().Trim().ToUpper();
if (word.StartsWith("ELEME"))
{
word = StreamWithMeshInfo.ReadLine().Trim();
while (word != string.Empty)
{
Elements.Add(new Element(word));
word = StreamWithMeshInfo.ReadLine().Trim();
}
}
else if (word.StartsWith("CONNE"))
{
word = StreamWithMeshInfo.ReadLine().Trim();
while (word != string.Empty & word != "+++")
{
Connection C = new Connection(word, Elements);
Connections.Add(C);
word = StreamWithMeshInfo.ReadLine().Trim();
}
}
}
}
}
示例3: testCount
public void testCount()
{
driver.Navigate().GoToUrl("http://www.google.com");
var elements = new ElementCollection(driver.FindElements(By.Name("q")));
driver.Navigate().GoToUrl("http://www.google.com");
Assert.Count(1, elements.Where(x => x.IsStale()));
}
示例4: CreateHierarchy
public ElementCollection CreateHierarchy()
{
ElementCollection result = new ElementCollection();
for (int index = 0; index < elements.Count; index++)
{
Element element = elements[index];
if (element is Entity.Text)
result.Add(element);
else if (element is Expression)
result.Add(element);
else if (element is Tag)
{
result.Add(CollectForTag((Tag) element, ref index));
}
else if (element is TagClose)
{
throw new ParseException("Close tag for " + ((TagClose) element).Name + " doesn't have matching start tag.", element.Line, element.Col);
}
else
throw new ParseException("Invalid element: " + element.GetType().ToString(), element.Line, element.Col);
}
return result;
}
示例5: Element
/// <summary>
/// Initializes an instance of a browser element.
/// </summary>
/// <param name="element">The browser element this is for.</param>
/// <param name="browser">The browser this element is associated with.</param>
/// <param name="collection">The collection this element is associated with.</param>
public Element(JToken element, Browser browser, ElementCollection collection)
{
_element = element;
_browser = browser;
_collection = collection;
_orginalColor = GetStyleAttributeValue("backgroundColor") ?? "";
_highlightColor = "yellow";
}
示例6: TemplateEntity
public TemplateEntity(string name, ElementCollection elements, TemplateEntity parent)
{
this.name = name;
this.elements = elements;
this.parent = parent;
InitTemplates();
}
示例7: TestBy
public void TestBy()
{
var elements = new ElementCollection(By.Name("q"));
driver.Navigate().GoToUrl("http://www.google.com");
elements.ForEach(x => x.Click());
driver.Navigate().GoToUrl("http://www.google.com");
elements.ForEach(x => x.SendKeys("test"));
}
示例8: Browser
/// <summary>
/// Initializes a new instance of the Browser class.
/// </summary>
protected Browser(Application application)
{
Application = application;
AutoClose = false;
AutoRefresh = true;
Elements = new ElementCollection();
JavascriptLibraries = new JavaScriptLibrary[0];
Timeout = TimeSpan.FromSeconds(10);
}
示例9: Connection
public Connection(string FromString, ElementCollection ElemeCollection)
{
First = ElemeCollection[FromString.Substring(0, 5)];
Second = ElemeCollection[FromString.Substring(5, 5)];
PermeabilityDirection = int.Parse(FromString.Substring(29, 1));
Distance1 = double.Parse(FromString.Substring(30, 10));
Distance2 = double.Parse(FromString.Substring(40, 10));
Area = double.Parse(FromString.Substring(50, 10));
if (FromString.Length > 60)
{
string temp = FromString.Substring(60, FromString.Length -60).Trim();
if (temp != string.Empty)
CosineAngle = double.Parse(temp);
}
}
示例10: OnClick
protected override void OnClick()
{
IMap map = ArcMap.Document.ActiveView as IMap;
IGeoFeatureLayer geoFeatureLayer = map.get_Layer(0) as IGeoFeatureLayer;
IAnnotateLayerPropertiesCollection annotateLayerPropertiesCollection = geoFeatureLayer.AnnotationProperties;
LabelEngineLayerProperties labelEngineLayerProperties = new LabelEngineLayerProperties();
IAnnotateLayerProperties annotateLayerProperties = labelEngineLayerProperties as IAnnotateLayerProperties;
IElementCollection placedElements = new ElementCollection();
IElementCollection unplacedElements = new ElementCollection();
annotateLayerPropertiesCollection.QueryItem(1, out annotateLayerProperties, out placedElements, out unplacedElements); // 0 = default, 1 = 1st Class
string className = annotateLayerProperties.Class;
System.Diagnostics.Debug.WriteLine("Class Name: " + className);
ArcMap.Application.CurrentTool = null;
}
示例11: RaisesCollectionChangedEvent
public void RaisesCollectionChangedEvent()
{
var collection = new ElementCollection<Axis>(new PlotModel());
ElementCollectionChangedEventArgs<Axis> eventArgs = null;
var raisedCount = 0;
collection.CollectionChanged += (sender, e) =>
{
eventArgs = e;
raisedCount++;
};
var axis = new LinearAxis();
collection.Add(axis);
Assert.AreEqual(1, raisedCount);
Assert.AreEqual(1, eventArgs.AddedItems.Count);
Assert.IsTrue(ReferenceEquals(axis, eventArgs.AddedItems[0]));
}
示例12: EliminateUselessGroupNesting
private static void EliminateUselessGroupNesting(ElementCollection elements)
{
for (var i = 0; i < elements.Count; i++)
{
var group = elements[i] as Group;
if (group == null)
{
continue;
}
EliminateUselessGroupNesting(group.Children);
if (IsUselessGroup(group))
{
elements.RemoveAt(i);
var count = group.Children.Count;
while (group.Children.Count > 0)
{
elements.MoveTo(i, group.Children[group.Children.Count - 1]);
}
i += count - 1;
}
}
}
示例13: Abbreviation
/// <summary>
/// Initializes an instance of a browser element.
/// </summary>
/// <param name="element"> The browser element this is for. </param>
/// <param name="browser"> The browser this element is associated with. </param>
/// <param name="collection"> The collection this element is associated with. </param>
public Abbreviation(JToken element, Browser browser, ElementCollection collection)
: base(element, browser, collection)
{
}
示例14: StrikeThrough
/// <summary>
/// Initializes an instance of a browser element.
/// </summary>
/// <param name="element"> The browser element this is for. </param>
/// <param name="browser"> The browser this element is associated with. </param>
/// <param name="collection"> The collection this element is associated with. </param>
public StrikeThrough(JToken element, Browser browser, ElementCollection collection)
: base(element, browser, collection)
{
}
示例15: Legend
/// <summary>
/// Initializes an instance of a browser element.
/// </summary>
/// <param name="element"> The browser element this is for. </param>
/// <param name="browser"> The browser this element is associated with. </param>
/// <param name="collection"> The collection this element is associated with. </param>
public Legend(JToken element, Browser browser, ElementCollection collection)
: base(element, browser, collection)
{
}