Esempio n. 1
0
        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(); }
        }
Esempio n. 2
0
 /// <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));
 }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
 public Controls(VisualElement rootElement)
 {
     root = rootElement;
     Row  = new RowElements(root);
 }
Esempio n. 5
0
 /// <summary>
 /// Gets the row.
 /// </summary>
 /// <param name="row">The row.</param>
 /// <returns></returns>
 public virtual IWebElement GetRow(int row)
 {
     return(RowElements.ElementAt(row));
 }