Ejemplo n.º 1
0
        private void AddFieldToClassDef(IClassDef classDef, IUIFormField uiFormField)
        {
            IUIDef        def    = classDef.UIDefCol["default"];
            IUIForm       form   = def.UIForm;
            IUIFormTab    tab    = form[0];
            IUIFormColumn column = tab[0];

            column.Add(uiFormField);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Loads form column data from the reader
        /// </summary>
        protected override void LoadFromReader()
        {
            _column = _defClassFactory.CreateUIFormColumn();
            //_column = new UIFormColumn();

            //_reader.Read();
            //string className = _reader.GetAttribute("class");
            //string assemblyName = _reader.GetAttribute("assembly");
            //_collection.Class = TypeLoader.LoadType(assemblyName, className);
            //_collection.Name = new UIPropertyCollectionName(_collection.Class, _reader.GetAttribute("name"));

            _reader.Read();
            try
            {
                _column.Width = Convert.ToInt32(_reader.GetAttribute("width"));
            }
            catch (Exception ex)
            {
                throw new InvalidXmlDefinitionException("In a 'columnLayout' " +
                                                        "element, the 'width' attribute has been given " +
                                                        "an invalid integer pixel value.", ex);
            }

            _reader.Read();
            while (_reader.Name == "field")
            {
                XmlUIFormFieldLoader propLoader = new XmlUIFormFieldLoader(DtdLoader, _defClassFactory);
                _column.Add(propLoader.LoadUIProperty(_reader.ReadOuterXml()));
            }

            if (_column.Count == 0)
            {
                throw new InvalidXmlDefinitionException("No 'field' " +
                                                        "elements were specified in a 'columnLayout' element.  Ensure " +
                                                        "that the element " +
                                                        "contains one or more 'field' elements, which " +
                                                        "specify the property editing controls to appear in the " +
                                                        "editing form column.");
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Loads form column data from the reader
        /// </summary>
        protected override void LoadFromReader()
        {
			_column = _defClassFactory.CreateUIFormColumn();
			//_column = new UIFormColumn();

            //_reader.Read();
            //string className = _reader.GetAttribute("class");
            //string assemblyName = _reader.GetAttribute("assembly");
            //_collection.Class = TypeLoader.LoadType(assemblyName, className);
            //_collection.Name = new UIPropertyCollectionName(_collection.Class, _reader.GetAttribute("name"));

            _reader.Read();
            try
            {
                _column.Width = Convert.ToInt32(_reader.GetAttribute("width"));
            }
            catch (Exception ex)
            {
                throw new InvalidXmlDefinitionException("In a 'columnLayout' " + 
                    "element, the 'width' attribute has been given " +
                    "an invalid integer pixel value.", ex);
            }

            _reader.Read();
            while (_reader.Name == "field")
            {
                XmlUIFormFieldLoader propLoader = new XmlUIFormFieldLoader(DtdLoader, _defClassFactory);
                _column.Add(propLoader.LoadUIProperty(_reader.ReadOuterXml()));
            }

            if (_column.Count == 0)
            {
                throw new InvalidXmlDefinitionException("No 'field' " +
                    "elements were specified in a 'columnLayout' element.  Ensure " +
                    "that the element " +
                    "contains one or more 'field' elements, which " +
                    "specify the property editing controls to appear in the " +
                    "editing form column.");
            }
        }