Пример #1
0
        public void LoadStorageNode(IBxStorageNode node)
        {
            if (node.HasElement(BxXmlConfigField.name))
            {
                Name = node.GetElementValue(BxXmlConfigField.name);
            }
            if (node.HasElement(BxXmlConfigField.flag))
            {
                if (_flag == null)
                {
                    InitFlag();
                }
                _flag.LoadFromString(node.GetElementValue(BxXmlConfigField.flag));
            }
            if (node.HasElement(BxXmlConfigField.controlType))
            {
                ControlType = Convert.ToInt32(node.GetElementValue(BxXmlConfigField.controlType));
            }

            if (node.HasElement(BxXmlConfigField.unitCate))
            {
                string s1 = node.GetElementValue(BxXmlConfigField.unitCate);
                string s2 = node.GetElementValue(BxXmlConfigField.unit);
                Unit = BxSystemInfo.Instance.UnitsCenter.Parse(s1).Parse(s2);
            }
        }
Пример #2
0
        public override void LoadStorageNode(IBxStorageNode node)
        {
            string val = node.GetElementValue(BxStorageLable.elementValue);
            string uc  = node.GetElementValue(BxStorageLable.elementUnitCate);
            string u   = node.GetElementValue(BxStorageLable.elementUnit);

            if (!string.IsNullOrEmpty(uc))
            {
                IBxUnit unit = BxSystemInfo.Instance.UnitsCenter.Parse(uc).Parse(u);
                SetUIValue(val, unit);
            }
        }
Пример #3
0
        public override void LoadStorageNode(IBxStorageNode node)
        {
            int count = Convert.ToInt32(node.GetElementValue(BxStorageLable.elementCount));

            RemoveAll();
            AppendRange(count);

            IEnumerable <IBxElementSite> elements = ChildSites;
            IEnumerable <IBxStorageNode> childs   = node.ChildNodes;

            using (IEnumerator <IBxStorageNode> itor = childs.GetEnumerator())
            {
                itor.Reset();
                foreach (IBxElementSite one in elements)
                {
                    if (one is IBxPersistStorageNode)
                    {
                        if (!itor.MoveNext())
                        {
                            break;
                        }
                        (one as IBxPersistStorageNode).LoadStorageNode(itor.Current);
                    }
                }
            }
        }
Пример #4
0
        public override void LoadStorageNode(IBxStorageNode node)
        {
            base.LoadStorageNode(node);
            string sID = node.GetElementValue(BxStorageLable.elementValueID);

            if (string.IsNullOrEmpty(sID))
            {
                return;
            }
            node.Storage.SVA.RequestRestoreRefer(this, sID);
        }
Пример #5
0
        public virtual void LoadStorageNode(IBxStorageNode node)
        {
            string sVal = node.GetElementValue(BxStorageLable.elementValue);

            if (string.IsNullOrEmpty(sVal))
            {
                _valid = false;
            }
            else
            {
                LoadFromString(sVal);
            }
        }
Пример #6
0
        public override void LoadStorageNode(IBxStorageNode node)
        {
            base.LoadStorageNode(node);
            string id = node.GetElementValue(BxStorageLable.elementValueID);

            if (string.IsNullOrEmpty(id))
            {
                Value.LoadStorageNode(node);
            }
            else
            {
                node.Storage.SVA.LoadValue(_value, id);
            }
        }
Пример #7
0
        public virtual void LoadStorageNode(IBxStorageNode node)
        {
            string sVal = node.GetElementValue(BxStorageLable.elementValue);

            if (string.IsNullOrEmpty(sVal))
            {
                _valid = false;
            }
            else
            {
                LoadFromString(sVal);
            }

            sVal = node.GetElementValue(BxStorageLable.elementValueDefault);
            if (string.IsNullOrEmpty(sVal))
            {
                _isDefault = false;
            }
            else
            {
                bool.TryParse(sVal, out _isDefault);
            }
        }
Пример #8
0
        public void Load(IBxStorageNode node)
        {
            string assName = node.GetElementValue(BxSSL.elementValue);

            _ass = Assembly.Load(assName);

            IEnumerable <IBxStorageNode> childs = node.ChildNodes;

            _types.Clear();
            Type   temp;
            string typeName;

            foreach (IBxStorageNode one in childs)
            {
                typeName = one.GetElementValue(BxSSL.elementValue);
                temp     = _ass.GetType(typeName);
                _types.Add(temp);
            }
        }
Пример #9
0
        protected virtual void LoadElement(IBxStorageNode node)
        {
            string id = node.GetElementValue(BxStorageLable.elementValueID);

            if (string.IsNullOrEmpty(id))
            {
                (Element as IBxPersistStorageNode).LoadStorageNode(node);
            }
            else
            {
                if (IsRefer)
                {
                    node.Storage.SVA.RequestRestoreRefer(this as IBxElementReferer, id);
                }
                else
                {
                    node.Storage.SVA.LoadValue(Element as IBxReferableElement, id);
                }
            }
        }
Пример #10
0
        public virtual void LoadStorageNode(IBxStorageNode node)
        {
            if (node.HasElement(BxXmlConfigField.id))
            {
                _id = node.GetElementValue(BxXmlConfigField.id);
            }

            if (node.HasElement(BxXmlConfigField.name))
            {
                Name = node.GetElementValue(BxXmlConfigField.name);
            }
            if (node.HasElement(BxXmlConfigField.flag))
            {
                _flag.LoadFromString(node.GetElementValue(BxXmlConfigField.flag));
            }
            if (node.HasElement(BxXmlConfigField.controlType))
            {
                ControlType = Convert.ToInt32(node.GetElementValue(BxXmlConfigField.controlType));
            }

            if (node.HasElement(BxXmlConfigField.unitCate))
            {
                string s1 = node.GetElementValue(BxXmlConfigField.unitCate);
                string s2 = node.GetElementValue(BxXmlConfigField.unit);
                Unit = BxSystemInfo.Instance.UnitsCenter.EMFind(s1, s2);
            }
            if (node.HasElement(BxXmlConfigField.decimalDigits))
            {
                _decimalDigits = Convert.ToInt32(node.GetElementValue(BxXmlConfigField.decimalDigits));
            }

            if (node.HasElement(BxXmlConfigField.uiColumn))
            {
                _column = node.GetElementValue(BxXmlConfigField.uiColumn);
            }

            if (node.HasElement(BxXmlConfigField.uiColumnID))
            {
                _columnID = node.GetElementValue(BxXmlConfigField.uiColumnID);
            }

            if (node.HasElement(BxXmlConfigField.icon))
            {
                _icon = node.GetElementValue(BxXmlConfigField.icon);
            }

            //差Range

            if (node.HasElement(BxXmlConfigField.menuWidth))
            {
                _menuWidth = node.GetElementValue(BxXmlConfigField.menuWidth);
            }
            if (node.HasElement(BxXmlConfigField.HelpString))
            {
                _helpString = node.GetElementValue(BxXmlConfigField.HelpString);
            }

            IBxStorageNode subc = node.GetChildNode("subc");

            if (subc != null)
            {
                if (_subColumns != null)
                {
                    _subColumns.LoadStorageNode(subc);
                }
            }
        }
Пример #11
0
 public override void LoadStorageNode(IBxStorageNode node)
 {
     LoadFromString(node.GetElementValue(BxStorageLable.elementValue));
 }
Пример #12
0
 public static string GetVersion(IBxStorageNode node)
 {
     return(node.GetElementValue(BxSSL.elementVersion));
 }