Exemplo n.º 1
0
        public DataField(XPathNavigator field, IXmlNamespaceResolver nm) :
            this()
        {
            this._name = field.GetAttribute("name", String.Empty);
            this._type = field.GetAttribute("type", String.Empty);
            string l = field.GetAttribute("length", String.Empty);

            if (!(String.IsNullOrEmpty(l)))
            {
                _len = Convert.ToInt32(l);
            }
            this._label        = field.GetAttribute("label", String.Empty);
            this._isPrimaryKey = (field.GetAttribute("isPrimaryKey", String.Empty) == "true");
            this._readOnly     = (field.GetAttribute("readOnly", String.Empty) == "true");
            this._onDemand     = (field.GetAttribute("onDemand", String.Empty) == "true");
            this._defaultValue = field.GetAttribute("default", String.Empty);
            this._allowNulls   = !((field.GetAttribute("allowNulls", String.Empty) == "false"));
            this._hidden       = (field.GetAttribute("hidden", String.Empty) == "true");
            this._allowQBE     = !((field.GetAttribute("allowQBE", String.Empty) == "false"));
            this._allowSorting = !((field.GetAttribute("allowSorting", String.Empty) == "false"));
            this._sourceFields = field.GetAttribute("sourceFields", String.Empty);
            string onDemandStyle = field.GetAttribute("onDemandStyle", String.Empty);

            if (onDemandStyle == "Link")
            {
                this._onDemandStyle = OnDemandDisplayStyle.Link;
            }
            else
            if (onDemandStyle == "Signature")
            {
                this._onDemandStyle = OnDemandDisplayStyle.Signature;
            }
            this._onDemandHandler  = field.GetAttribute("onDemandHandler", String.Empty);
            this._contextFields    = field.GetAttribute("contextFields", String.Empty);
            this._selectExpression = field.GetAttribute("select", String.Empty);
            bool computed = (field.GetAttribute("computed", String.Empty) == "true");

            if (computed)
            {
                _formula = ((string)(field.Evaluate("string(self::c:field/c:formula)", nm)));
                if (String.IsNullOrEmpty(_formula))
                {
                    _formula = "null";
                }
            }
            this._showInSummary    = (field.GetAttribute("showInSummary", String.Empty) == "true");
            this._htmlEncode       = !((field.GetAttribute("htmlEncode", String.Empty) == "false"));
            this._calculated       = (field.GetAttribute("calculated", String.Empty) == "true");
            this._causesCalculate  = (field.GetAttribute("causesCalculate", String.Empty) == "true");
            this._configuration    = ((string)(field.Evaluate("string(self::c:field/c:configuration)", nm)));
            this._dataFormatString = field.GetAttribute("dataFormatString", String.Empty);
            _formatOnClient        = !((field.GetAttribute("formatOnClient", String.Empty) == "false"));
            string editor = field.GetAttribute("editor", String.Empty);

            if (!(String.IsNullOrEmpty(editor)))
            {
                _editor = editor;
            }
        }
Exemplo n.º 2
0
        public DataField(XPathNavigator field, IXmlNamespaceResolver nm) :
            this()
        {
            this._name         = ((string)(field.Evaluate("string(@name)")));
            this._type         = ((string)(field.Evaluate("string(@type)")));
            this._label        = ((string)(field.Evaluate("string(@label)")));
            this._isPrimaryKey = ((bool)(field.Evaluate("@isPrimaryKey=\'true\'")));
            this._readOnly     = ((bool)(field.Evaluate("@readOnly=\'true\'")));
            this._onDemand     = ((bool)(field.Evaluate("@onDemand=\'true\'")));
            this._defaultValue = ((string)(field.Evaluate("string(@default)")));
            this._allowNulls   = ((bool)(field.Evaluate("not(@allowNulls=\'false\')")));
            this._hidden       = ((bool)(field.Evaluate("@hidden=\'true\'")));
            this._allowQBE     = ((bool)(field.Evaluate("not(@allowQBE=\'false\')")));
            this._allowLEV     = (field.GetAttribute("allowLEV", String.Empty) == "true");
            this._allowSorting = ((bool)(field.Evaluate("not(@allowSorting=\'false\')")));
            this._sourceFields = field.GetAttribute("sourceFields", String.Empty);
            if (field.GetAttribute("onDemandStyle", String.Empty) == "Link")
            {
                this._onDemandStyle = OnDemandDisplayStyle.Link;
            }
            this._onDemandHandler  = field.GetAttribute("onDemandHandler", String.Empty);
            this._contextFields    = field.GetAttribute("contextFields", String.Empty);
            this._selectExpression = field.GetAttribute("select", String.Empty);
            bool computed = (field.GetAttribute("computed", String.Empty) == "true");

            if (computed)
            {
                _formula = ((string)(field.Evaluate("string(self::c:field/c:formula)", nm)));
                if (String.IsNullOrEmpty(_formula))
                {
                    _formula = "null";
                }
            }
            this._showInSummary    = (field.GetAttribute("showInSummary", String.Empty) == "true");
            this._htmlEncode       = !((field.GetAttribute("htmlEncode", String.Empty) == "false"));
            _calculated            = (field.GetAttribute("calculated", String.Empty) == "true");
            this._configuration    = ((string)(field.Evaluate("string(self::c:field/c:configuration)", nm)));
            this._dataFormatString = field.GetAttribute("dataFormatString", String.Empty);
            _formatOnClient        = !((field.GetAttribute("formatOnClient", String.Empty) == "false"));
        }
Exemplo n.º 3
0
        public DataField(XPathNavigator field, IXmlNamespaceResolver nm) :
            this()
        {
            this._name = field.GetAttribute("name", string.Empty);
            this._type = field.GetAttribute("type", string.Empty);
            var l = field.GetAttribute("length", string.Empty);

            if (!(string.IsNullOrEmpty(l)))
            {
                _len = Convert.ToInt32(l);
            }
            this._label        = field.GetAttribute("label", string.Empty);
            this._isPrimaryKey = (field.GetAttribute("isPrimaryKey", string.Empty) == "true");
            this._readOnly     = (field.GetAttribute("readOnly", string.Empty) == "true");
            this._onDemand     = (field.GetAttribute("onDemand", string.Empty) == "true");
            this._defaultValue = field.GetAttribute("default", string.Empty);
            this._allowNulls   = !((field.GetAttribute("allowNulls", string.Empty) == "false"));
            this._hidden       = (field.GetAttribute("hidden", string.Empty) == "true");
            this._allowQBE     = !((field.GetAttribute("allowQBE", string.Empty) == "false"));
            this._allowLEV     = (field.GetAttribute("allowLEV", string.Empty) == "true");
            this._allowSorting = !((field.GetAttribute("allowSorting", string.Empty) == "false"));
            this._sourceFields = field.GetAttribute("sourceFields", string.Empty);
            var onDemandStyle = field.GetAttribute("onDemandStyle", string.Empty);

            if (onDemandStyle == "Link")
            {
                this._onDemandStyle = OnDemandDisplayStyle.Link;
            }
            else
            if (onDemandStyle == "Signature")
            {
                this._onDemandStyle = OnDemandDisplayStyle.Signature;
            }
            this._onDemandHandler  = field.GetAttribute("onDemandHandler", string.Empty);
            this._contextFields    = field.GetAttribute("contextFields", string.Empty);
            this._selectExpression = field.GetAttribute("select", string.Empty);
            var computed = (field.GetAttribute("computed", string.Empty) == "true");

            if (computed)
            {
                _formula = ((string)(field.Evaluate("string(self::c:field/c:formula)", nm)));
                if (string.IsNullOrEmpty(_formula))
                {
                    _formula = "null";
                }
            }
            this._showInSummary    = (field.GetAttribute("showInSummary", string.Empty) == "true");
            this._htmlEncode       = !((field.GetAttribute("htmlEncode", string.Empty) == "false"));
            this._calculated       = (field.GetAttribute("calculated", string.Empty) == "true");
            this._causesCalculate  = (field.GetAttribute("causesCalculate", string.Empty) == "true");
            this._isVirtual        = (field.GetAttribute("isVirtual", string.Empty) == "true");
            this._configuration    = ((string)(field.Evaluate("string(self::c:field/c:configuration)", nm)));
            this._dataFormatString = field.GetAttribute("dataFormatString", string.Empty);
            _formatOnClient        = !((field.GetAttribute("formatOnClient", string.Empty) == "false"));
            var editor = field.GetAttribute("editor", string.Empty);

            if (!(string.IsNullOrEmpty(editor)))
            {
                _editor = editor;
            }
            var itemsNav = field.SelectSingleNode("c:items", nm);

            if (itemsNav != null)
            {
                this.ItemsDataController   = itemsNav.GetAttribute("dataController", string.Empty);
                this.ItemsTargetController = itemsNav.GetAttribute("targetController", string.Empty);
            }
            var dataViewNav = field.SelectSingleNode("c:dataView", nm);

            if (dataViewNav != null)
            {
                this.DataViewController   = dataViewNav.GetAttribute("controller", string.Empty);
                this.DataViewId           = dataViewNav.GetAttribute("view", string.Empty);
                this.DataViewFilterSource = dataViewNav.GetAttribute("filterSource", string.Empty);
                this.DataViewFilterFields = dataViewNav.GetAttribute("filterFields", string.Empty);
                _allowQBE     = true;
                _allowSorting = true;
                _len          = 0;
                _columns      = 0;
                _htmlEncode   = true;
            }
        }
Exemplo n.º 4
0
 public DataField(XPathNavigator field, IXmlNamespaceResolver nm)
     : this()
 {
     this._name = field.GetAttribute("name", String.Empty);
     this._type = field.GetAttribute("type", String.Empty);
     string l = field.GetAttribute("length", String.Empty);
     if (!(String.IsNullOrEmpty(l)))
         _len = Convert.ToInt32(l);
     this._label = field.GetAttribute("label", String.Empty);
     this._isPrimaryKey = (field.GetAttribute("isPrimaryKey", String.Empty) == "true");
     this._readOnly = (field.GetAttribute("readOnly", String.Empty) == "true");
     this._onDemand = (field.GetAttribute("onDemand", String.Empty) == "true");
     this._defaultValue = field.GetAttribute("default", String.Empty);
     this._allowNulls = !((field.GetAttribute("allowNulls", String.Empty) == "false"));
     this._hidden = (field.GetAttribute("hidden", String.Empty) == "true");
     this._allowQBE = !((field.GetAttribute("allowQBE", String.Empty) == "false"));
     this._allowLEV = (field.GetAttribute("allowLEV", String.Empty) == "true");
     this._allowSorting = !((field.GetAttribute("allowSorting", String.Empty) == "false"));
     this._sourceFields = field.GetAttribute("sourceFields", String.Empty);
     string onDemandStyle = field.GetAttribute("onDemandStyle", String.Empty);
     if (onDemandStyle == "Link")
         this._onDemandStyle = OnDemandDisplayStyle.Link;
     else
         if (onDemandStyle == "Signature")
             this._onDemandStyle = OnDemandDisplayStyle.Signature;
     this._onDemandHandler = field.GetAttribute("onDemandHandler", String.Empty);
     this._contextFields = field.GetAttribute("contextFields", String.Empty);
     this._selectExpression = field.GetAttribute("select", String.Empty);
     bool computed = (field.GetAttribute("computed", String.Empty) == "true");
     if (computed)
     {
         _formula = ((string)(field.Evaluate("string(self::c:field/c:formula)", nm)));
         if (String.IsNullOrEmpty(_formula))
             _formula = "null";
     }
     this._showInSummary = (field.GetAttribute("showInSummary", String.Empty) == "true");
     this._htmlEncode = !((field.GetAttribute("htmlEncode", String.Empty) == "false"));
     this._calculated = (field.GetAttribute("calculated", String.Empty) == "true");
     this._causesCalculate = (field.GetAttribute("causesCalculate", String.Empty) == "true");
     this._configuration = ((string)(field.Evaluate("string(self::c:field/c:configuration)", nm)));
     this._dataFormatString = field.GetAttribute("dataFormatString", String.Empty);
     _formatOnClient = !((field.GetAttribute("formatOnClient", String.Empty) == "false"));
     string editor = field.GetAttribute("editor", String.Empty);
     if (!(String.IsNullOrEmpty(editor)))
         _editor = editor;
 }