public static void writeXML(string XMLfile, string XElementName, ObservableCollection <Dictionary <string, string> > XMLRows) { try { var doc = new XmlDocument(); XElement element = new XElement(XElementName); using (var writer = new System.IO.StreamWriter(XMLfile)) { foreach (Dictionary <string, string> RowElements in XMLRows) { var newelement = new XElement(RowElements.First().Key, RowElements["value"]); foreach (var DictItem in RowElements) { if (DictItem.Key != RowElements.First().Key) { newelement.SetAttributeValue(DictItem.Key, DictItem.Value); } } } element.Save(writer); } } catch (System.Exception ex) { string excep = ex.ToString(); } }
/// <summary> /// Returns the element cell. /// </summary> /// <param name="row"></param> /// <param name="col"></param> /// <returns></returns> public virtual IWebElement GetCell(int row, int col) { return(RowElements .ElementAt(row) .FindElements(cellsSelector) .ElementAt(col)); }
public void Test_CrearFilaDeElementos() { ColorElement e1 = new ColorElement(ColorElement.eColor.BLACK); ColorElement e2 = new ColorElement(ColorElement.eColor.GREEN); ColorElement e3 = new ColorElement(ColorElement.eColor.ORANGE); ColorElement e4 = new ColorElement(ColorElement.eColor.YELLOW); RowElements row = new RowElements(); row.AddElement(e1); row.AddElement(e2); row.AddElement(e3); row.AddElement(e4); Assert.AreEqual(4, row.GetElements().Count); }
public Controls(VisualElement rootElement) { root = rootElement; Row = new RowElements(root); }
/// <summary> /// Gets the row. /// </summary> /// <param name="row">The row.</param> /// <returns></returns> public virtual IWebElement GetRow(int row) { return(RowElements.ElementAt(row)); }