Esempio n. 1
0
 public void New(IBxStorageNode nodeSva)
 {
     _nodeSva = nodeSva;
     _nodeVS  = _nodeSva.CreateChildNode(BxSSL.nodeVS);
     _items   = new List <Item>();
     _tSaver  = null;
 }
Esempio n. 2
0
        public void Load(IBxStorageNode nodeSva)
        {
            _nodeSva = nodeSva;
            _nodeVS  = null;
            _items   = null;
            _tSaver  = null;

            IBxStorageNode nodeTS = _nodeSva.GetChildNode(BxSSL.nodeTS);

            if (nodeTS != null)
            {
                _tSaver = new BxSvaTypeSaver();
                _tSaver.Load(nodeTS);
            }

            _nodeVS = _nodeSva.GetChildNode(BxSSL.nodeVS);
            if (_nodeVS != null)
            {
                _items = new List <Item>();
                IEnumerable <IBxStorageNode> childs = _nodeVS.ChildNodes;
                int    index = 0;
                Item   temp  = null;
                string id    = null;
                Type   type  = null;
                IBxReferableElement tempVal = null;
                foreach (IBxStorageNode one in childs)
                {
                    temp = new Item(index, one);
                    index++;
                    _items.Add(temp);
                    if (one.HasElement(BxSSL.elementTypeID))
                    {
                        id         = one.GetElementValue(BxSSL.elementTypeID);
                        type       = _tSaver.Get(id);
                        tempVal    = type.GetConstructor(null).Invoke(null) as IBxReferableElement;
                        temp.Value = tempVal;
                    }
                }
            }
        }