LoadUIProperty() public method

Loads a grid property definition from the xml element provided
public LoadUIProperty ( XmlElement uiPropElement ) : IUIGridColumn
uiPropElement System.Xml.XmlElement The xml element
return IUIGridColumn
示例#1
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.");
            }
        }
示例#2
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.");
            }
        }
示例#3
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());
 }