Пример #1
0
        public void Save()
        {
            StorageBuilder storage_builder = new StorageBuilder();

            storage_builder.Add((uint)(users.Count));
            foreach (User user in users.Values)
            {
                storage_builder.Add(user.UserName);
                storage_builder.Add(user.Password);
            }

            storage_builder.Add((uint)(files.Count));
            foreach (File file in files.Values)
            {
                storage_builder.Add(file.Path);
                storage_builder.Add(file.Owner);
                storage_builder.Add((byte)((file.CanEveryoneRead ? FileFlags.CanEveryoneRead : FileFlags.Nothing) | (file.CanEveryoneWrite ? FileFlags.CanEveryoneWrite : FileFlags.Nothing)));
                storage_builder.AddSequence(file.Data);
            }
            Storage = storage_builder.Base64;
        }