Example #1
0
        public static StreamArray <T> Create(Stream s, int len)
        {
            var sd = new StreamArray <T>();

            sd.Create(s);
            s.WriteArray(len);
            return(sd);
        }
Example #2
0
        protected override void SetValue(StoredProgramData t)
        {
            Stream.WriteString(t.name);
            Stream.WriteString(t.commands);
            var programArray = StreamArray <StoredProgram> .Create(Stream, t.programs.Length);

            programArray.Value = t.programs;
        }
Example #3
0
        public static StoredProgram Create(Stream stream, IProgram program)
        {
            var result = new StoredProgram();

            result.Create(stream);
            stream.WriteString(program.Name);
            stream.WriteString(StoredProgramData.SetCommands(program.Steps));
            var programs     = program.Programs.ToArray();
            var programArray = StreamArray <StoredProgram> .Create(stream, programs.Length);

            programArray.Value = programs.Select(p => StoredProgram.Create(stream, p)).ToArray();
            return(result);
        }
Example #4
0
        public static StoredProgramFolder Create(Stream stream, IProgramFolder source)
        {
            var result = new StoredProgramFolder();

            result.Create(stream);
            stream.WriteString(source.Name);
            var programs    = source.Programs.ToArray();
            var folders     = source.Folders.ToArray();
            var programData = StreamArray <StoredProgram> .Create(stream, programs.Length);

            var folderData = StreamArray <StoredProgramFolder> .Create(stream, folders.Length);

            programData.Value = programs.Select(p => StoredProgram.Create(stream, p)).ToArray();
            folderData.Value  = folders.Select(p => StoredProgramFolder.Create(stream, p)).ToArray();
            return(result);
        }