private Device GetDeviceInstance(DeviceType type, JsonData current,
                                         Dictionary <string, List <File> > filesPerDevice)
        {
            Device result = null;

            switch (type)
            {
            case DeviceType.Normal:
                result = new Device();
                break;

            case DeviceType.Passworded:
                result = new PasswordedDevice();
                break;
            }

            SetDeviceBaseProperties(result, current, filesPerDevice);

            if (type == DeviceType.Passworded)
            {
                SetPasswordedDeviceProperties(result as PasswordedDevice, current);
            }

            return(result);
        }
 private void SetPasswordedDeviceProperties(PasswordedDevice device, JsonData current)
 {
     device.Password = current["AditionalData"].ToString();
 }