Пример #1
0
        private void CreateTVDevicePropities()
        {
            ControllerPropities controllerPropities;

            controllerPropities = JsonWorker.ReadControllerPropities(Path.Combine(path, "controller.json"));
            JsonWorker.CreateEmptyTVDevicePropities(Path.Combine(path, "tv.json"), controllerPropities);
            Console.WriteLine("---------------------------------------------------------------------");
            Console.WriteLine("-----------TV json was generated. Please enter valid data------------");
            Console.WriteLine("---------------------------------------------------------------------");
        }
Пример #2
0
 private bool Search(List <object> searchIn, string search)
 {
     foreach (object cur in searchIn)
     {
         if (JsonWorker.FirstInObject(cur) == search)
         {
             return(true);
         }
     }
     return(false);
 }
Пример #3
0
        private List <ProjectorDevicePropities> ReadProjectorDevicePropities()
        {
            List <ProjectorDevicePropities> projectorDevicePropities = new List <ProjectorDevicePropities>();
            List <object> list = JsonWorker.ReadDevices(Path.Combine(path, "projector.json"));

            foreach (object current in list)
            {
                projectorDevicePropities.Add(ProjectorDevicePropities.ConvertFromJObject(current));
            }
            return(projectorDevicePropities);
        }
Пример #4
0
        private List <TVDevicePropities> ReadTVDevicePropities()
        {
            List <TVDevicePropities> tVDevices = new List <TVDevicePropities>();
            List <object>            list      = JsonWorker.ReadDevices(Path.Combine(path, "tv.json"));

            foreach (object current in list)
            {
                tVDevices.Add(TVDevicePropities.ConvertFromJObject(current));
            }

            return(tVDevices);
        }
Пример #5
0
        public void SaveDevices(List <object?> device)
        {
            string firstDeviceInObject = JsonWorker.FirstInObject(device);

            JsonWorker.DeviceSave(JsonWorker.SerializeDevice(device), Path.Combine(path, GetTypeOfDevice(firstDeviceInObject)));
        }
Пример #6
0
 private ControllerPropities ReadControllerPropities()
 {
     return(JsonWorker.ReadControllerPropities(Path.Combine(path, "controller.json")));
 }
Пример #7
0
 private ConnectionPropities ReadConnectPropities()
 {
     return(JsonWorker.ReadConnection(Path.Combine(path, "connect.json")));
 }