Loads UI grid property definitions from xml data
Inheritance: XmlLoader
コード例 #1
0
ファイル: XmlUIGridLoader.cs プロジェクト: SaberZA/habanero
        /// <summary>
        /// Loads grid definition data from the reader
        /// </summary>
        protected override void LoadFromReader()
        {
            _uiGrid = _defClassFactory.CreateUIGridDef();

            _reader.Read();
            _uiGrid.SortColumn = _reader.GetAttribute("sortColumn");

            _reader.Read();

            if (_reader.Name == "filter")
            {
                XmlFilterLoader filterLoader = new XmlFilterLoader(DtdLoader, _defClassFactory);
                _uiGrid.FilterDef = filterLoader.LoadFilterDef(_reader.ReadOuterXml());
            }

            while (_reader.Name == "column")
            {
                XmlUIGridColumnLoader propLoader = new XmlUIGridColumnLoader(DtdLoader, _defClassFactory);
                _uiGrid.Add(propLoader.LoadUIProperty(_reader.ReadOuterXml()));
            }

            if (_uiGrid.Count == 0)
            {
                throw new InvalidXmlDefinitionException("No 'column' " +
                                                        "elements were specified in a 'grid' element.  Ensure " +
                                                        "that the element " +
                                                        "contains one or more 'column' elements, which " +
                                                        "specify the columns to appear in the grid.");
            }
        }
コード例 #2
0
 protected void Initialise() {
     loader = new XmlUIGridColumnLoader(new DtdLoader(), GetDefClassFactory());
 }
コード例 #3
0
        /// <summary>
        /// Loads grid definition data from the reader
        /// </summary>
        protected override void LoadFromReader()
        {
			_uiGrid = _defClassFactory.CreateUIGridDef();

            _reader.Read();
            _uiGrid.SortColumn = _reader.GetAttribute("sortColumn");

            _reader.Read();

            if (_reader.Name == "filter")
            {
                XmlFilterLoader filterLoader = new XmlFilterLoader(DtdLoader, _defClassFactory);
                _uiGrid.FilterDef = filterLoader.LoadFilterDef(_reader.ReadOuterXml());
            }

            while (_reader.Name == "column")
            {
                XmlUIGridColumnLoader propLoader = new XmlUIGridColumnLoader(DtdLoader, _defClassFactory);
                _uiGrid.Add(propLoader.LoadUIProperty(_reader.ReadOuterXml()));
            }

            if (_uiGrid.Count == 0)
            {
                throw new InvalidXmlDefinitionException("No 'column' " +
                    "elements were specified in a 'grid' element.  Ensure " +
                    "that the element " +
                    "contains one or more 'column' elements, which " +
                    "specify the columns to appear in the grid.");
            }
        }
コード例 #4
0
 public void TestAutomaticHeadingCreation_UsingCamelCase()
 {
     XmlUIGridColumnLoader loader = new XmlUIGridColumnLoader(new DtdLoader(), new DefClassFactory());
     IUIGridColumn uiProp = loader.LoadUIProperty(@"<column property=""TestPropName"" />");
     Assert.AreEqual(null, uiProp.Heading);
     Assert.AreEqual("Test Prop Name", uiProp.GetHeading());
 }