コード例 #1
0
        protected internal override VariableValue Read_(BinaryReader reader, List <Object> objects, short version)
        {
            var count = reader.ReadInt32();
            var list  = new VariableList();

            for (var i = 0; i < count; i++)
            {
                var item = ReadValue(reader, objects, version);
                list.AddVariable(item);
            }

            return(VariableValue.Create(list));
        }
コード例 #2
0
        public void LoadFrom(VariableList variables, string availability)
        {
            foreach (Variable fromVariable in variables._variables)
            {
                var index = _schema != null?_schema.GetIndex(fromVariable.Name) : -1;

                if (index >= 0)
                {
                    if (availability == null || _schema[index].Availability == availability)
                    {
                        SetValue(index, fromVariable.Value);
                    }
                }
            }
        }
コード例 #3
0
        public void SaveTo(VariableList variables, string availability)
        {
            foreach (Variable fromVariable in _variables)
            {
                var index = _schema != null?_schema.GetIndex(fromVariable.Name) : -1;

                if (index >= 0)
                {
                    if (availability == null || _schema[index].Availability == availability)
                    {
                        variables._variables.Add(fromVariable);
                    }
                }
            }

            variables._version = _version;
        }