aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.WinForms/VirtualEnvironments.cs
blob: 5faa6ff73df3fadbddbbae8566a27c36888107b5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ShiftOS.WinForms
{
    public static class VirtualEnvironments
    {
        private static List<ShiftOSEnvironment> _environments = new List<ShiftOSEnvironment>();

        public static void Create(string sysname, List<ShiftOS.Objects.ClientSave> users, ulong cp, ShiftOS.Objects.ShiftFS.Directory fs)
        {
            var env = new ShiftOSEnvironment
            {
                SystemName = sysname,
                Users = users,
                Codepoints = cp,
                Filesystem = fs
            };
            _environments.Add(env);
        }

        public static void Clear()
        {
            _environments.Clear();
        }

        public static ShiftOSEnvironment Get(string sysname)
        {
            return _environments.FirstOrDefault(x => x.SystemName == sysname);
        }
    }

    public class ShiftOSEnvironment
    {
        public string SystemName { get; set; }
        public ulong Codepoints { get; set; }
        public ShiftOS.Objects.ShiftFS.Directory Filesystem { get; set; }
        public List<ShiftOS.Objects.ClientSave> Users { get; set; }
    }
}