Пример #1
0
        public ISiteModelMachineDesign CreateNew(string name)
        {
            var existingOne = Locate(name);

            if (existingOne != null)
            {
                return(existingOne);
            }

            ISiteModelMachineDesign result = new SiteModelMachineDesign(GetLastId() + 1, name);

            Add(result);

            return(result);
        }
Пример #2
0
        /// <summary>
        /// Deserializes the list of machine designs using the given reader
        /// </summary>
        /// <param name="reader"></param>
        public void Read(BinaryReader reader)
        {
            this.Clear();

            VersionSerializationHelper.CheckVersionByte(reader, VERSION_NUMBER);

            int count = reader.ReadInt32();

            Capacity = count;

            for (int i = 0; i < count; i++)
            {
                SiteModelMachineDesign siteModelMachineDesign = new SiteModelMachineDesign();
                siteModelMachineDesign.Read(reader);
                Add(siteModelMachineDesign);
            }
        }