コード例 #1
0
ファイル: XMLWriter.cs プロジェクト: 15831944/ZSharpHelpers
        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(); }
        }
コード例 #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));
 }
コード例 #3
0
ファイル: TestFixture.cs プロジェクト: dcedena/KataMasterMind
        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);
        }
コード例 #4
0
 public Controls(VisualElement rootElement)
 {
     root = rootElement;
     Row  = new RowElements(root);
 }
コード例 #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));
 }